Board - iMXRT1040-EVK, SDK - mcuXpresso SDK v25.03.00, Windows, McuXpresso IDE
Hi,
I am trying to read data from the external NOR Flash on the EVK. I am using the flexspi nor edma example, but instead of using memcpy to read data I want to use "flexspi_nor_read_data()" function. Below is my code:
int main(void)
{
...
status = flexspi_nor_read_data( EXAMPLE_FLEXSP, (EXAMPLE_FLEXSPI_AMBA_BASE + EXAMPLE_SECTOR * SECTOR_SIZE),(void*)s_nor_read_buffer,sizeof(s_nor_read_buffer));
if (memcmp(s_nor_read_buffer, s_nor_program_buffer, sizeof(s_nor_program_buffer)) != 0)
{
PRINTF("Program data - read out data value incorrect !\r\n ");
return -1;
}
else
{
PRINTF("Program data - successfully. \r\n");
}
...
}
status_t flexspi_nor_read_data(FLEXSPI_Type *base, uint32_t startAddress, uint32_t *buffer, uint32_t length)
{
...
g_completionFlag = false;
status = FLEXSPI_TransferEDMA(base, &flexspiHandle, &flashXfer);
if (status != kStatus_Success)
{
return status;
}
/* Wait for transfer completed. */
while (!g_completionFlag)
{
}
...
}
The program goes to an infinite loop at while (!g_completionFlag) and I am getting status as 7002 as a return value from "FLEXSPI_TransferEDMA()"
I also tried the flexspi polling example, but getting the same output.
Why would the read function not work but we are able to read using memcpy?
Thanks