SPRUIW9C October 2021 – March 2024 TMS320F280033 , TMS320F280034 , TMS320F280034-Q1 , TMS320F280036-Q1 , TMS320F280036C-Q1 , TMS320F280037 , TMS320F280037-Q1 , TMS320F280037C , TMS320F280037C-Q1 , TMS320F280038-Q1 , TMS320F280038C-Q1 , TMS320F280039 , TMS320F280039-Q1 , TMS320F280039C , TMS320F280039C-Q1
When the target Flash is erased, the Flash reads as all 1s. This state is called 'blank.' The erase function must be executed before programming. The user cannot skip erase on sectors that read as 'blank' because these sectors can require additional erasing due to marginally erased bits columns. The FSM provides an Erase Sector command to erase the target sector. The erase function erases the data and the ECC together. Bank erase is also supported in this device.
To provide the correct sector mask for the bank erase command is important. If the mask is mistakenly chosen to erase an inaccessible sector (belongs to another security zone), the bank erase command continues attempting to erase the sector endlessly and the FSM never exits (since erase does not succeed). To avoid such a situation, the user must take care to provide the correct mask. However, given that there is a chance of choosing an incorrect mask, TI suggests to initialize the maximum allowed erase pulses to zero after the maximum number of pulses are issued by the FSM for the bank erase operation. This makes sure that the FSM ends the bank erase command after trying to erase the inaccessible sector up to the maximum allowed erase pulses.
The Example_EraseBanks() function in the C2000Ware’s Flash API usage example depicts the implementation of this sequence (content of the while loop waiting for the FSM to complete the bank erase command). Users must use this code as-is irrespective of whether or not security is used by the application to also make sure that the FSM exits from bank erase operations in case of an erase-failure.