Common Operations Using the Flash Controller
527
SLAU356I – March 2015 – Revised June 2019
Copyright © 2015–2019, Texas Instruments Incorporated
Flash Controller A (FLCTL_A)
10.2.4.2 Mass Erase Mode
In the mass erase mode, the flash controller erases the entire flash memory. Mass erase is
simultaneously applied to both banks.
The MSP432 Driver Library API in
can be used to mass erase flash. This function is blocking
and does not exit until operation has either completed or failed due to an error. Master interrupts are
disabled throughout execution of this function.
Table 10-5. MSP432 Driver Library API for FLCTL_A Mass Erase Operation
MSP432 Driver Library API
Function
FlashCtl_A_performMassErase
Performs a mass erase on all unprotected flash sectors. Protected sectors are ignored.
10.2.5 Flash Program and Erase Protection
The flash memory implements one PROT (write and erase protection) bit per sector of flash memory. If
the PROT bit is set to 1, that sector becomes a read-only type of memory, and any program or erase
commands to addresses in that sector are not performed. The flash controller provides access to PROT
configuration registers for the main and information memory regions, with one bit dedicated to each flash
sector. Using these bits, the application can protect sectors from inadvertent program or erase operations.
In addition, these bits can also be used to optimize erase timing.
For example, if the application must erase a portion of the main memory (for example, 128KB out of
2048KB), one option is to carry out the erase as 32 individual sector erase operations. Alternatively, the
application can set the PROT bits of the targeted 128KB of memory to 0. All other PROT bits for the main
and information memory space are set to 1. This is followed by initiating a mass erase operation, which
clears the targeted 128KB in one erase cycle, thereby saving time and energy overhead.
NOTE:
If IP protection is enabled, the configuration of the PROT bit for the IP protected sectors of
flash memory is ignored by the flash controller.
The MSP432 Driver Library API in
can be used to set program or erase protection.
Table 10-6. MSP432 Driver Library API for Setting up FLCTL_A Program or Erase Protection
MSP432 Driver Library API
Function
FlashCtl_A_protectSector
Enables program protection on the given sector mask.
FlashCtl_A_unprotectSector
Disables program protection on the given sector mask.
10.3 Advanced Operations using the Flash Controller
The MSP432 Driver Library allow the flash Module to be accessed through a simple and easy-to-use
interface for a number of commonly used flash operations such as read, write and erase. TI recommends
incorporating MSP432 Driver Library APIs for all flash operations to ensure safe execution of flash
routines as per the required specification. A full listing of MSP432 Driver Library APIs is available in the
Flash Memory Controller
chapter of the
MSP432 Driver Library MSP432P4xx User's Guide
In applications that use custom software for in-system program or erase of flash, it is important to know
that programming and erasing MSP432 flash requires verification stages in addition to the write or erase
operations. Failure to implement the required verification stages and to follow the exact routines listed in
the following
Software Flow
sections can result in the MSP432 flash being programmed or erased
incorrectly. TI recommends that users read and understand the requirements for custom in-system
programming before implementation.
10.3.1 Advanced Flash Read
The MSP432P flash controller can be programmed to output data from the flash memory in different read
modes. The different read modes supported on the device are: