26.6.1 Control B

Name: CTRLB
Offset: 0x04
Reset: 0x00000000
Property: Local Write-Protection

Bit 3130292827262524 
          
Access  
Reset  
Bit 2322212019181716 
          
Access  
Reset  
Bit 15141312111098 
 CMDEX[7:0] 
Access R/WR/WR/WR/WR/WR/WR/WR/W 
Reset 00000000 
Bit 76543210 
  CMD[6:0] 
Access R/WR/WR/WR/WR/WR/WR/W 
Reset 0000000 

Bits 15:8 – CMDEX[7:0] Command Execution

When this bit field is written with the key value 0xA5, the command written to the Command bit field in the Control B register (CTRLB.CMD) will be executed. If a value different from the key value is used, the write will not be performed, and the Programming Error bit in the Status register (STATUS.PROGE) will be set. STATUS.PROGE is also set if a previously written command has not yet completed.

The key value must be written at the same time as CTRLB.CMD. If a command is issued through the APB bus on the same cycle as an AHB bus access, the AHB bus access will be given priority. The command will then be executed when both the NVM block and the AHB bus are idle.

The Ready flag in the Interrupt Flag Status and Clear register (INTFLAG.READY) must be '1' when the command is issued.

Bit 0 of the CTRLB.CMDEX bit field will read back as '1' until the command is issued.

ValueNameDescription
0xA5KEYExecution key
OtherReserved

Bits 6:0 – CMD[6:0] Command

This bit field defines the command to be executed when the correct key is written to the Command Execution bit field in the Command register (CTRLB.CMDEX). Write to this bit field to enable or issue a command. The Chip Erase command is started when the command is written. The others enable an erase or write operation. The operation is started by performing a store to the address location. A change from one command to another should always go through NOCMD or NOOP. If an attempt is made to write a programming command while the Flash is busy, STATUS.PROGE is set.

ValueNameDescription
0x00NOCMDNo command
0x01NOOPNo operation
0x02FLWRFlash Write Enable
0x08FLPERFlash Page Erase Enable
0x09FLMPER2Flash 2-page Erase Enable
0x0AFLMPER4Flash 4-page Erase Enable
0x0BFLMPER8Flash 8-page Erase Enable
0x0CFLMPER16Flash 16-page Erase Enable
0x0DFLMPER32Flash 32-page Erase Enable
0x0ELRLock Region. Sets the bit in the Region n Lock Bits bit field in the Lock Section register (NVMCTRL.LOCK) corresponding to the address location in the ADDR register.
0x0FURUnlock Region. Clears the bit in NVMCTRL.LOCK corresponding to the address location in the ADDR register.
0x10EBOOTCFGErase BOOTCFG Page Enable
0x11WBOOTCFGWrite BOOTCFG Page Enable
0x12WLOCKREGIONWrite Enable to ROMCFG.NVMLOCKREGION. Writes to other addresses will cause STATUS.PROGE to be set.
0x20WROMCFGWrite ROMCFG Page Enable. The ROMCFG Page is used by the boot ROM to store Debug Access Level (DAL) bits and other security or protection bits for such as CEHL and Immutable boot.
0x21CHER

Erase Flash

Requires DAL == 2 or SYSINT privileges

OtherReserved