Common Operations Using the Flash Controller
460
SLAU356I – March 2015 – Revised June 2019
Copyright © 2015–2019, Texas Instruments Incorporated
Flash Controller (FLCTL)
9.2.4.2
Mass Erase Mode
In the mass erase mode, the flash controller is set up to erase the entire flash memory. Mass erase is
simultaneously applied to both Banks.
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 9-5. MSP432 Driver Library API for Flash Mass Erase Operation
MSP432 Driver Library API
Function
FlashCtl_performMassErase
Performs a mass erase on all unprotected flash sectors. Protected sectors are ignored.
9.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 honored. 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 is required to erase a portion of the main memory, say 128kB out of 256kB.
In such a case 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.
MSP432 Driver Library API in
can be used to setup program or erase protection.
Table 9-6. MSP432 Driver Library API for Setting up Program or Erase Operation
MSP432 Driver Library API
Function
FlashCtl_protectSector
Enables program protection on the given sector mask.
FlashCtl_unprotectSector
Disables program protection on the given sector mask.
9.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
MSP432 Driver Library MSP432P4xx User's Guide
(see Chapter 8,
Flash Memory Controller
).
In applications where custom software is used 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/erase operations. Failure to implement the required verification stages and to follow the exact
routines listed in the "Software Flow" sections could result in the MSP432 flash being programmed or
erased incorrectly. TI recommends users read and understand the requirements for custom in-system
programming before implementation.
9.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: