AnsweredAssumed Answered

Flashx write errors

Question asked by Derek Krouze on Jan 8, 2013
Latest reply on Mar 5, 2013 by David Nomiddlename Wu



Recently I made the switch to MQX 3.8.1 from 3.7, for better DDR performance, and have been noticing that the flashx driver does not seem to function the same as it used to. The project is being developed on a K61 with 1MB of flash space and both the user_config.h and linker file allow the entire flash space to be used. The current configuration is using the DDR region as ram and using the SRAM as the uncached data zone. I also do not currently use PE components.


This is a bootloader project that reads an SREC line and writes it to flash, about 76 bytes at a time. I have noticed errors on consective flash writes. The first flash write will go through but trying to write the next chunk of data always returns the FTFE_ERR_MGSTAT0 error. I have tried to read entires sectors, modify and write them back and the data that gets put back into flash has arbitrary chunks of 0xFFFFFFFF scattered about. Putting the old MQX 3.7 flash code produced similar results until disabling the icache ( _ICACHE_DISABLE()) during writes. It is unclear to me if I need to set up the flash or system cache differently than I currently have it. Disabling the flash cache using the FMC_PFBxx registers didn't seem to make a difference either.


Everything besides the DDR ran fine in 3.7 so any help would be appreciated.