I am running the SDK example to write to the QSPI flash on my imx rt 1020 dev board. I have 8MB of external flash available. The example app is really small, so I changed the flash size for the example to 0x40000.
Then I have changed some defines to write flash starting from 0x10000000, and then let the SDK example write 8KB of 256 pages.
When I then run the example, it will
- read all pages / sectors, and validate they are all set to 0xFF
- erase all pages / sectors
- write the incrementing counter 'i' to some array, and program that to every sector/page in the range (again, starting from 0x10000000, and then writing 8KB with i++).
- verify all data is written to flash
- and erase again. But this step I deleted. I want to leave the flash altered.
Then, I stop the debugger, press F5 again. Same program, so I expect nothing will be actually erased / programmed as a result of starting the debugger. Next, I would expect that this code would fall into a trap, because the program expects the flash to be erased, while it isn't (because I deleted the last erase step). So the first read all sectors and verify 0xFF bytes, should now fail.
But the program doesn't fall into a trap, because the flash indeed is erased all again (0xFF).
What am I doing wrong? Who can elaborate on this please?
Many thanks in advance.
Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
Firstly, I'd like to know the part number of the QSPI on your board, then, please share the schematic of connecting the QSPI.
Last, I'd like to know whether the demo works well without commenting out the final erase sector.
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
Firstly, I'd like to know the part number of the QSPI on your board, then, please share the schematic of connecting the QSPI.
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
I am clearly missing something.
I have modified the example as such:
#define FLASH_SIZE 0x200000
#define NOR_FLASH_START_ADDRESS 0x100000
and instead of the incrementing int `i` I just write pages filled with 0xCC bytes
/* Program the page data. */
/* Initialize the write buffers. */
for (uint32_t i = 0; i < norHandle.bytesInPageSize; i++)
{
mem_writeBuffer[i] = 0xCC;
}
And I commented out the final erase sector:
Then, when the program runs, it finally gets into the final never ending while:
And I just finished writing 0xCC to a huge portion of my flash. But when I look into the memory, everything is still 0xFF. Why? What am I doing wrong?
I attached my modified example project. Greatly appreciate a hint ;-).
Many thx in advance