Hello,
I'm working writing a custom bootloader for a MK20FN1MVMD12, but I'm running into an issue when I erase block 0. After erasing the entire block by successively calling the erase sector command, any software reads to an address in block 0 results in reading the previous value (not 0xFF). No error is being reported, and the "read 1s section" command indicates that everything was erased properly.
Some potentially important information:
Any thoughts?
Solved! Go to Solution.
The flash memory controller will come up in a valid configuration with the cache and prefetch buffers enabled.
If a firmware driver is used to program flash values, then a flush of the cache might be needed. The cache has no means of snooping to know when a program operation occurs, so a flush is needed to ensure that the cache does not return stale data.
Wish it helps.
best regards,
Ma Hui
The flash memory controller will come up in a valid configuration with the cache and prefetch buffers enabled.
If a firmware driver is used to program flash values, then a flush of the cache might be needed. The cache has no means of snooping to know when a program operation occurs, so a flush is needed to ensure that the cache does not return stale data.
Wish it helps.
best regards,
Ma Hui
The cache was definitely the problem for me. My NOR driver was not flushing the cache after it wrote or erased which was causing all my problems.
Thanks for your help,
Jordan
I am checking this issue. I will let you know when there with any updated info.
Thank you for the patience.
Best regards,
Ma Hui