I've been trying to read the Id of my aps256xxn device on the stm32n6dk and noticed something strange. The XSPI wont allow me to read with an odd starting address. So when i call ReadID, the address is automatically floored to 0 instead of staying at 1. This results in me receiving MR0 and MR1 instead of MR1 and MR2. This is in line with the "Address Alignment and Data Number" section of the reference manual.
My question is, is my understanding correct. Did you guys observe this as well?
If so maybe the read register function should compensate for this issue, or maybe this constraint needs to be mentioned somewhere
Heres my XSPI Init function for context
static void MX_XSPI1_Init(void)
{
/* USER CODE BEGIN XSPI1_Init 0 */
/* USER CODE END XSPI1_Init 0 */
XSPIM_CfgTypeDef sXspiManagerCfg = {0};
/* USER CODE BEGIN XSPI1_Init 1 */
/* USER CODE END XSPI1_Init 1 */
/* XSPI1 parameter configuration*/
hxspi1.Instance = XSPI1;
hxspi1.Init.FifoThresholdByte = 1;
hxspi1.Init.MemoryMode = HAL_XSPI_SINGLE_MEM;
hxspi1.Init.MemoryType = HAL_XSPI_MEMTYPE_APMEM_16BITS;
hxspi1.Init.MemorySize = HAL_XSPI_SIZE_256MB;
hxspi1.Init.ChipSelectHighTimeCycle = 2;
hxspi1.Init.FreeRunningClock = HAL_XSPI_FREERUNCLK_DISABLE;
hxspi1.Init.ClockMode = HAL_XSPI_CLOCK_MODE_0;
hxspi1.Init.WrapSize = HAL_XSPI_WRAP_NOT_SUPPORTED;
hxspi1.Init.ClockPrescaler = 0;
hxspi1.Init.SampleShifting = HAL_XSPI_SAMPLE_SHIFT_NONE;
hxspi1.Init.DelayHoldQuarterCycle = HAL_XSPI_DHQC_DISABLE;
hxspi1.Init.ChipSelectBoundary = HAL_XSPI_BONDARYOF_2KB;
hxspi1.Init.MaxTran = 0;
hxspi1.Init.Refresh = 64;
hxspi1.Init.MemorySelect = HAL_XSPI_CSSEL_NCS1;
if (HAL_XSPI_Init(&hxspi1) != HAL_OK)
{
Error_Handler();
}
sXspiManagerCfg.nCSOverride = HAL_XSPI_CSSEL_OVR_NCS1;
sXspiManagerCfg.IOPort = HAL_XSPIM_IOPORT_1;
sXspiManagerCfg.Req2AckTime = 1;
if (HAL_XSPIM_Config(&hxspi1, &sXspiManagerCfg, HAL_XSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN XSPI1_Init 2 */
/* USER CODE END XSPI1_Init 2 */
}
and heres some of the code in main after xspi initialization
/* USER CODE BEGIN 2 */
int32_t returnVal = APS256XX_Reset(&hxspi1);
uint8_t id[4] = {0xff,0xff,0xff,0xff};
returnVal = APS256XX_ReadID(&hxspi1,id, APS256XX_READ_REG_LATENCY(APS256XX_READ_LATENCY_5)); //gives 0x08, 0x0d
fillBuf(id,sizeof(id)); // just resets id to {0,1,2,3 }
returnVal = APS256XX_ReadReg(&hxspi1, 0, id, APS256XX_READ_REG_LATENCY(APS256XX_READ_LATENCY_5)); // gives 0x08, 0x8d like expected
fillBuf(id,sizeof(id));
returnVal = APS256XX_ReadReg(&hxspi1, 1, id, APS256XX_READ_REG_LATENCY(APS256XX_READ_LATENCY_5)); // also gives 0x08, 0x8d
I've been trying to read the Id of my aps256xxn device on the stm32n6dk and noticed something strange. The XSPI wont allow me to read with an odd starting address. So when i call ReadID, the address is automatically floored to 0 instead of staying at 1. This results in me receiving MR0 and MR1 instead of MR1 and MR2. This is in line with the "Address Alignment and Data Number" section of the reference manual.
My question is, is my understanding correct. Did you guys observe this as well?
If so maybe the read register function should compensate for this issue, or maybe this constraint needs to be mentioned somewhere
Heres my XSPI Init function for context
and heres some of the code in main after xspi initialization