Datasheet
3. Configure registers NVM_FERSTAT and NVM_FPROT to disable protection in the
flash and EEPROM memory.
4. Execute the erase all blocks command write sequence to erase the flash and
EEPROM memory. Alternately, the unsecure NVM command can be executed.
If the flash and EEPROM memory are verified as erased, the MCU will be
unsecured. All BDM. commands will now be enabled and the flash security byte may
be programmed to the unsecure state by continuing with the steps that follow.
5. Execute the program flash command write sequence to program the flash security
byte to the unsecured state.
6. Reset the MCU.
4.5.2.7.3 Mode and security effects on flash and EEPROM command
availability
The availability of flash and EEPROM module commands depends on the MCU
operating mode and security state as shown in Table 4-9.
4.5.2.8 Flash and EEPROM commands
4.5.2.8.1 Flash commands
The following table summarizes the valid flash commands as well as the effects of the
commands on the flash block and other resources within the flash and EEPROM module.
Table 4-17. Flash commands
FCMD Command Function on flash memory
0x01 Erase verify all blocks Verify that all flash (and EEPROM) blocks are erased
0x02 Erase verify block Verify that a flash block is erased
0x03 Erase verify flash section Verify that a given number of words starting at the address provided are erased
0x04 Read Once
Read a dedicated 64 byte field in the nonvolatile information register in flash
block that was previously programmed using the program once command
0x06 Program flash Program up to two longwords in a flash block
0x07 Program once
Program a dedicated 64 byte field in the nonvolatile information register in flash
block that is allowed to be programmed only once
0x08 Erase all block
Erase all flash and EEPROM blocks
An erase of all flash blocks is possible only when the FPROT[FPLDIS],
FPROT[FPHDIS], and FPROT[FPOEN] bits and the EEPROT[DPOPEN] bit are
set prior to launching the command
Table continues on the next page...
Chapter 4 Memory map
MC9S08PA60 Reference Manual, Rev. 1, 9/2012
Freescale Semiconductor, Inc. 89
