Advanced Operations using the Flash Controller
471
SLAU356I – March 2015 – Revised June 2019
Copyright © 2015–2019, Texas Instruments Incorporated
Flash Controller (FLCTL)
9.3.3 Advanced Flash Erase
Erasing MSP432 flash requires the following stages to be incorporated into user software:
1. Initiate Erase
2. Post-verify
The MSP432 flash controller requires that user application implements the exact routines listed in
. Failure to follow the documented software flow could result in the MSP432 flash being
erased incorrectly. TI recommends that users read and understand the requirements for custom in-system
programming and erasing before implementation.
An erase operation must be followed by a read of the erased locations to confirm that erase was
successful. Verification of erase operation must be initiated by the user application and hardware support
is not available for automatic verification. The auto-verify feature described in
is only
available when programming.
During the verification of erase operation, flash reads must be done by setting the bank in Erase-Verify-
Read mode by using RD_MODE bits in the FLCTL_BANKx_RDCTL register.
Additionally, because the flash controller is optimized to provide energy and time-efficient erase
operations, user application software may be required to execute the two stages of erasing multiple times,
thereby subjecting the flash memory to multiple erase "pulses".
An efficient software implementation of erase verification should use the burst read and compare feature
of the FLCTL. Refer to the example on erase verify in
. If burst read gives an error, then re-
initiate erase until the maximum number of erase tries is met.
Each device supports a maximum number of erase pulses that is defined by the flash maximum erase
pulses parameter in the device data sheet,
Device Descriptors (TLV)
section.
The following flash erase modes are supported:
•
Sector erase
•
Mass erase
In both sector and mass erase modes, Driver Library APIs are available that implement the recommended
erase flow. These APIs are also categorized into blocking and nonblocking, and the user can select
whether to use the blocking version, which includes the erase verify stage, or the nonblocking version,
which simply initiates the erase and relies on the user code to perform the verification.
lists the
available MSP432 driver library functions for this purpose.
Table 9-11. MSP432 Driver Library API for Flash Erase Operations
MSP432 Driver Library API
Function
FlashCtl_eraseSector
Erases a sector of MAIN or INFO flash memory. This is a blocking API.
FlashCtl_initiateSectorErase
Initiates a sector erase of MAIN or INFO flash memory. Note that this function simply initiates
the sector erase, but does no verification which is required by the flash controller. This is a
nonblocking API.
FlashCtl_performMassErase
Performs a mass erase on all unprotected flash sectors. This is a blocking API.
FlashCtl_initiateMassErase
Initiates a mass erase and returns control back to the program. This is a nonblocking API.
9.3.3.1
Software Flow for Flash Erase
The below flow must be followed for any erase operation into the flash memory.
•
An erase operation must be followed by a read of the erased locations to confirm that erase was
successful.
•
Verification of erase operation is to be done in software and no hardware support is available for
automatic verification (unlike program operation).
•
The read for verification of erase operation must be done by setting the bank in Erase Verify read
mode.
•
An efficient software implementation of erase verification should use the burst read and compare
feature of the FLCTL. See the example on erase verify in
.