|
Our software application supports a custom Flash File System (FFS) that uses the upper 24KB of the flash of the AT91SAM7XC512 as storage medium. The self-programming API of the EFC is used by our flash driver to update the flash pages of the files in the file system. Every now and then re-programming a flash page goes wrong. Although the EFC does not report an error, one or more bits in a flash page are not programmed correctly. All relevant code and data for the flash driver is of course located in RAM.
Is there anybody else who uses the EFCs in a similar way and encountered similar problems?
Notes: 1. We have seen this problem only with AT91SAM7XC512, never with AT91SAM7XC256. For both microcontrollers we use the same flash driver, which is compiled with same GNU toolchain. 2. The problem only occurs when exactly one 16-bit word in the page needs to be changed. It never occurs when more than one word in a page needs to be changed at the same time. 3. Of all attempts to change one word in a page about 20 to 40% will fail. If the error occurs, then the workaround is to clear the page erase bit (NEBP) and try again. (i.e. re-program same page with same data) This resolves the situation every time. However, it takes one extra erase cycle and therewith reduces the life time of the chip. 4. If the error occurs, then most of the time only one bit is wrong. Which bit is random, although the faulty bit is always in the word that needed to change or in one of its two neighboring words. (address-1, address+1) 5. The error occurs with both EFC controllers of the AT91SAM7XC512. We tested this by an experiment which involved moving the FFS storage area down to the low end of the internal flash memory. 6. We have tested/tried/double checked the following aspects, none with any success – in each case the problem persisted: • Interrupts disabled during programming. • Dummy read just before writing programming command to EFC Flash Command Register. (FCR) • Pause before reading from flash after EFC signals programming is complete with FRDY bit. • Increased number of flash wait states. • Double checked FMCN value. Tried slightly larger value. • Double programming. Does not work - EFC is ready immediately. • SPI bus DMA disabled during programming. • Brownout detector + reset are enabled through GPNVM0 and GPNVM1 bits - no brownout resets occurred ever.
Regards,
Robert
|