HI,
I have a problem with read operation from flash memory.
While testing of the code, we found a strange problem with flash memory.
For example: If the write operation (done using Kinetis Flash driver)is unsuccessful and during my next reboot if i try to read the specific location of the memory where it (got halt/ corrupted etc) was unsuccessful, i get a hard fault.
I was expecting that kinetics controller will handle the data integrity automatically.
can you give me any suggestion on handling this issue. Is there any built in driver which will solve this reading issue( like detection of corrupted memory)
Thanks in advance
Sandeep
Hi
Hard Faults reading program Flash memory
https://community.nxp.com/message/574401?commentID=574401#comment-574401
And various others when a search for "hard fault Flash" is made.
Regards
Mark
Hi
Thanks for the response.
I thought we will be reading the garbage value instead of getting hard fault.
So If some thing goes wrong while writing, then it will go to hard fault while reading ??
Sandeep
It depends on the Kinetis part being used. Newer parts (like K64) will hard-fault if the Flash area is corrupted - older types may not. There is no official documentation about this behavior but can be observed with various parts.
Regards
Mark
Hi Hui_Ma, Hi Mark
Thanks for the response.
We are observing this hard fault in K24F series. Thanks for letting us know about this behavior.
Regards,
Sandeep
Hi
Embedded flash memory is grouped into blocks. Each block contains the circuitry required to read, erase, and program within that block. Most of the flash memory technologies have a limitation of not allowing read operations at the same time as an erase or program operation is occurring within the same block. Thus, erasing/programming a sector is not allowed if code execution (fetching instructions = reading) is taking place within the same block even if the read is in a different flash sector than the erase/program. This is called a Read While Write (RWW) violation and will result in a Read Collision error on Kinetis and other micro-controllers.
More detailed info, please check application note AN4695.
Wish it helps.
Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------