This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS570LC4357: EEPROM flash does not reliably erase

Part Number: TMS570LC4357

I am working on a project where we store configuration data in flash. When attempting to write data into bank 7 sector 0 (address 0xf0200000) I follow the recommended procedure in the documentation for erasing and writing (SPNU501H–December 2012–Revised April 2015 section 6). The write verify fails and when I look on the debugger the data in the flash (displaying memory address 0xf0200000 in the memory browser) does not match the data I attempted to write.

The erase/write/verify is handled via a state machine which I have slowed down so that it only actions one part of the flow every 500 ms

After the erase has been requested via a call to

Fapi_issueAsyncCommandWithAddress( Fapi_EraseSector, address )

the data is still present when viewed on the debugger. (occasionally the erase succeeds and the data goes to all 'F's and sometimes it partially succeeds with 32 byes being erased). The 

THe write then fails to update the flash because it has not been erased. When the erase does succeed then I can see the data being writed as each write happens.

I am only writing 38 bytes so I would not expect it is a size issue.

  • Hello Andy,

    Does Fapi_issueAsyncCommandWithAddress return success?

    What is the value of the FMSTAT register after the erase command fails?

    Best,

    Alex

  • yes Fapi_issueAsyncCommandWithAddress  returns success and FMSTAT is zero. Furthermore, I have now discovered that restarting the application results in the flash getting updated. If I restart after the erase, then the debugger memory browser window shows the sector as erased. If I restart after the update fails, then the new data is now present. Maybe the update is held pending rather than failing and there is some kind of high priority mode active during a restart?

  • Hello Andy,

    Does the write verify still fail after restarting the application?

    After issuing the program command and waiting for completion, can you try refreshing the memory browser in CCS? Does the data show up then?

    Additionally, are you correctly initializing the Flash API using Fapi_initializeFlashBanks(<your clock speed in MHz>) and Fapi_setActiveFlashBank(Fapi_FlashBank7)?

    Best,

    Alex