We have a product with the BF547M connected to a NAND flash. The boot ROM loads U-Boot from NAND, which then loads a uClinux uImage. We recently inspected an RMA'd unit and found that a single bit had flipped in the uImage, thus the CRC check failed, and it wouldn't boot.
We have hardware ECC enabled in the NAND drivers for both U-Boot and Linux. I believe the ECC should be capable of correcting any single bit flip in a 256-byte block. I've experimented with intentionally flipping random bits in Flash and it does work as expected most of the time.
However, the correction is NOT working for the particular 256-byte block of data that was corrupted in the RMA'd unit. After this block of data is read or written, the value in the ECC registers is all zeros, which seems unlikely to be correct. When the block is written, the all-zero ECC is stored in the OOB region. If a bit is then flipped, and then block is read, the NAND driver does not correct or even detect the error.
The issue has been reproduced on multiple devices. The behavior is the same in Linux and U-Boot. We need assistance finding a solution to this problem.
I've attached dumps of the 2048 byte page in question including the 64 byte OOB. In the bad_page_oob.bin file, you can see that the byte at offset 0x165 has changed from 0x01 to 0x05. The ECC stored for this 256-byte chunk is at offset 0x82B - 0x82D.