Advanced Operations using the Flash Controller
538
SLAU356I – March 2015 – Revised June 2019
Copyright © 2015–2019, Texas Instruments Incorporated
Flash Controller A (FLCTL_A)
10.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 the user application to implement the routines 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 verification of the 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 need 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. See the example of erase verify in
. If the burst read gives an error, then
perform the erase again 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 user code to perform the verification.
lists the
available MSP432 driver library functions for erase operations.
Table 10-11. MSP432 Driver Library API for FLCTL_A Erase Operations
MSP432 Driver Library API
Function
FlashCtl_A_eraseSector
Erases a sector of MAIN or INFO flash memory. This is a blocking API.
FlashCtl_A_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_A_performMassErase
Performs a mass erase on all unprotected flash sectors. This is a blocking API.
FlashCtl_A_initiateMassErase
Initiates a mass erase and returns control back to the program. This is a nonblocking API.
10.3.3.1 Software Flow for Flash Erase
The following 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 must 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 of erase verify in
.