Hai all,
My application is hanging while I am trying to read data flash sector 1(0x0080_4000) of MCU. All other sectors are working fine.
I have already performed around 10000 write cycle to sector 1. I am reading the sector using an 'unsigned long' pointer.
Please help me to identify the reason. Any help will be appreciated.
Thank you.
Solved! Go to Solution.
Hi,
It is caused by ECC error, most likely. Each word in data flash memory has hidden 7bit ECC syndrome. The ECC mechanism provides correction of single-bit faults and reporting of multiple-bit errors.
ECC error can occur if:
- erase or program operation is terminated by unexpected reset, so the flash is left in undefined state
- if we programmed word in data flash that is not fully erased (different from 0xFFFFFFFF)
- if we performed too many erase/program cycles (flash wear-out)
In case of single-bit fault, the ECC circuitry automatically corrects the data. In case of multiple-bit error, the flash controller returns bus error and exception is triggered. Take a look at this document and examples for details:
https://community.freescale.com/docs/DOC-103300
The solution is to erase whole flash block. Then it can be programmed and read again.
Regards,
Lukas
Hi,
It is caused by ECC error, most likely. Each word in data flash memory has hidden 7bit ECC syndrome. The ECC mechanism provides correction of single-bit faults and reporting of multiple-bit errors.
ECC error can occur if:
- erase or program operation is terminated by unexpected reset, so the flash is left in undefined state
- if we programmed word in data flash that is not fully erased (different from 0xFFFFFFFF)
- if we performed too many erase/program cycles (flash wear-out)
In case of single-bit fault, the ECC circuitry automatically corrects the data. In case of multiple-bit error, the flash controller returns bus error and exception is triggered. Take a look at this document and examples for details:
https://community.freescale.com/docs/DOC-103300
The solution is to erase whole flash block. Then it can be programmed and read again.
Regards,
Lukas
Hi,
Same code is working fine in another board. What could be the reason for hanging in the other board?