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.

TMS570LS1224: Programming flash using F021 API without erasing it first?

Part Number: TMS570LS1224


Hello everybody!

I have regarding the possibility to program a Flash sector without having erased it first!

I have found rather contradictory information from the following sources:

1. This thread: . The same thread mentions that only programming Flash will not damage it.

2. This thread: . It is mentioned that if the application only uses the program function, then the erase function will not be included in the final .out file.

3. SPNA117A: . On page 4/11, the document mentions that there are several steps required to program Flash using Flash API functions, one of which is erasing the target flash.

So, is erasing Flash a necessary step before programming it?

To give some context to my question: if I want to program a sector in Flash Bank 0 of the TMS570LS1224, do I need to necessarily first erase said sector before programming it?

Thank you in advance!

Mihail

  • Hello Mihail,

    The flash program operation can only change the bit from 1 to 0. The erase operation sets all bits in the sector or bank to 1. With a freshly erased sector, any location can be programmed. However, once a bit has been set to 0, only by erasing the entire sector can it be changed back to 1.

    My answer is the sector has to be erased before programming any data to this sector.