# Flash Interface

Address | Register Name | Register Write | Register Read | Default | Description
--- | --- | --- | --- | --- | ---
0x40000800 | FLASH0_IF_CTRL | (16) NOT_LOAD_AUTO | (16) NOT_LOAD_AUTO | 0x0 | Do not automatically load the configuration registers and the patch information from MNVR sector after the command WAKEUP is completed.
|  | (12) VREAD1_MODE | (12) VREAD1_MODE | 0x0 | Control VREAD1: Read data after erase with more stringent condition than normal read. Changing this bit will execute the CMD_SET_VREAD1 or CMD_UNSET_VREAD1 command.
|  | (10) RECALL | (10) RECALL | 0x0 | Set the recall pins mode during CMD_READ. Changing this bit will execute the CMD_SET_RECALL or CMD_UNSET_RECALL command.
|  | (9:8) RETRY | (9:8) RETRY | 0x0 | Configures the erase retry iteration. This impacts the Flash endurance time. Also used by Flash programming.
|  | (0) LP_MODE | (0) LP_MODE | 0x0 | Set the low power mode. Changing this bit will execute the CMD_SET_LOW_POWER or CMD_UNSET_LOW_POWER command.
0x40000804 | FLASH0_MAIN_WRITE_UNLOCK | (31:0) UNLOCK_KEY | - | N/A | 32-bit key to allow for write accesses into the Flash MAIN Block
0x40000808 | FLASH0_MAIN_CTRL | (11) DATA_A_35K_TO_40K_W_EN | (11) DATA_A_35K_TO_40K_W_EN | 0x0 | Authorize the write access to the Flash MAIN Data array from 35K to 40K word block through the FLASH_IF registers.
|  | (10) DATA_A_30K_TO_35K_W_EN | (10) DATA_A_30K_TO_35K_W_EN | 0x0 | Authorize the write access to the Flash MAIN Data array from 30K to 35K word block through the FLASH_IF registers.
|  | (9) DATA_A_25K_TO_30K_W_EN | (9) DATA_A_25K_TO_30K_W_EN | 0x0 | Authorize the write access to the Flash MAIN Data array from 25K to 30K word block through the FLASH_IF registers.
|  | (8) DATA_A_20K_TO_25K_W_EN | (8) DATA_A_20K_TO_25K_W_EN | 0x0 | Authorize the write access to the Flash MAIN Data array from 20K to 25K word block through the FLASH_IF registers.
|  | (7) DATA_A_15K_TO_20K_W_EN | (7) DATA_A_15K_TO_20K_W_EN | 0x0 | Authorize the write access to the Flash MAIN Data array from 15K to 20K word block through the FLASH_IF registers.
|  | (6) DATA_A_10K_TO_15K_W_EN | (6) DATA_A_10K_TO_15K_W_EN | 0x0 | Authorize the write access to the Flash MAIN Data array from 10K to 15K word block through the FLASH_IF registers.
|  | (5) DATA_A_5K_TO_10K_W_EN | (5) DATA_A_5K_TO_10K_W_EN | 0x0 | Authorize the write access to the Flash MAIN Data array from 5K to 10K word block through the FLASH_IF registers.
|  | (4) DATA_A_0K_TO_5K_W_EN | (4) DATA_A_0K_TO_5K_W_EN | 0x0 | Authorize the write access to the Flash MAIN Data array from 0 to 5K word block through the FLASH_IF registers.
|  | (3) CODE_A_66K_TO_88K_W_EN | (3) CODE_A_66K_TO_88K_W_EN | 0x0 | Authorize the write access to the Flash MAIN Code array from 66K to 88K word block through the FLASH_IF registers.
|  | (2) CODE_A_44K_TO_66K_W_EN | (2) CODE_A_44K_TO_66K_W_EN | 0x0 | Authorize the write access to the Flash MAIN Code array from 44K to 66K word block through the FLASH_IF registers.
|  | (1) CODE_A_22K_TO_44K_W_EN | (1) CODE_A_22K_TO_44K_W_EN | 0x0 | Authorize the write access to the Flash MAIN Code array from 22K to 44K word block through the FLASH_IF registers.
|  | (0) CODE_A_0K_TO_22K_W_EN | (0) CODE_A_0K_TO_22K_W_EN | 0x0 | Authorize the write access to the Flash MAIN Code array from 0 to 22K word block through the FLASH_IF registers.
0x4000080C | FLASH0_DELAY_CTRL | (7) READ_MARGIN | (7) READ_MARGIN | 0x0 | Flash Read access time margin
|  | (3:0) SYSCLK_FREQ | (3:0) SYSCLK_FREQ | 0x2 | Configure Flash, memory and RF power-up delays
0x40000830 | FLASH0_CMD_CTRL | (5) CMD_END | - | N/A | Terminates an active Flash command if possible (e.g. sequential programming sequence)
|  | (4:0) COMMAND | (4:0) COMMAND | 0x0 | Flash access command only writable when equal to CMD_IDLE
0x40000834 | FLASH0_IF_STATUS | - | (31) TRIMMED_STATUS | 0x0 | Flash trimming status
|  | - | (30) ISOLATE_STATUS | 0x1 | Flash isolate status
|  | - | (29) PROG_SEQ_DATA_REQ | 0x0 | Request new data while in sequential program mode
|  | - | (28) BUSY | 0x0 | Flash interface busy status bit
|  | - | (27) DATA_RED2_W_UNLOCK | 0x0 | Flash Data array RED2 write unlock status bit
|  | - | (26) DATA_RED1_W_UNLOCK | 0x0 | Flash Data array RED1 write unlock status bit
|  | - | (25) CODE_RED2_W_UNLOCK | 0x0 | Flash Code array RED2 write unlock status bit
|  | - | (24) CODE_RED1_W_UNLOCK | 0x0 | Flash Code array RED1 write unlock status bit
|  | - | (22) NVR7_W_UNLOCK | 0x0 | Flash NVR7 write unlock status bit
|  | - | (21) NVR6_W_UNLOCK | 0x0 | Flash NVR6 write unlock status bit
|  | - | (20) NVR5_W_UNLOCK | 0x0 | Flash NVR5 write unlock status bit
|  | - | (19) NVR4_W_UNLOCK | 0x0 | Flash NVR4 write unlock status bit
|  | - | (18) NVR3_W_UNLOCK | 0x0 | Flash NVR3 write unlock status bit
|  | - | (17) NVR2_W_UNLOCK | 0x0 | Flash NVR2 write unlock status bit
|  | - | (16) NVR1_W_UNLOCK | 0x0 | Flash NVR1 write unlock status bit
|  | - | (15) NVR0_W_UNLOCK | 0x0 | Flash NVR0 write unlock status bit
|  | - | (11) DATA_A_35K_TO_40K_W_UNLOCK | 0x0 | Write unlock status bit of the part 35K to 40K of the Flash MAIN Data array
|  | - | (10) DATA_A_30K_TO_35K_W_UNLOCK | 0x0 | Write unlock status bit of the part 30K to 35K of the Flash MAIN Data array
|  | - | (9) DATA_A_25K_TO_30K_W_UNLOCK | 0x0 | Write unlock status bit of the part 25K to 30K of the Flash MAIN Data array
|  | - | (8) DATA_A_20K_TO_25K_W_UNLOCK | 0x0 | Write unlock status bit of the part 20K to 25K of the Flash MAIN Data array
|  | - | (7) DATA_A_15K_TO_20K_W_UNLOCK | 0x0 | Write unlock status bit of the part 15K to 20K of the Flash MAIN Data array
|  | - | (6) DATA_A_10K_TO_15K_W_UNLOCK | 0x0 | Write unlock status bit of the part 10K to 15K of the Flash MAIN Data array
|  | - | (5) DATA_A_5K_TO_10K_W_UNLOCK | 0x0 | Write unlock status bit of the part 5K to 10K of the Flash MAIN Data array
|  | - | (4) DATA_A_0K_TO_5K_W_UNLOCK | 0x0 | Write unlock status bit of the part 0K to 5K of the Flash MAIN Data array
|  | - | (3) CODE_A_66K_TO_88K_W_UNLOCK | 0x0 | Write unlock status bit of the part 66K to 88K of the Flash MAIN Code array
|  | - | (2) CODE_A_44K_TO_66K_W_UNLOCK | 0x0 | Write unlock status bit of the part 44K to 66K of the Flash MAIN Code array
|  | - | (1) CODE_A_22K_TO_44K_W_UNLOCK | 0x0 | Write unlock status bit of the part 22K to 44K of the Flash MAIN Code array
|  | - | (0) CODE_A_0K_TO_22K_W_UNLOCK | 0x0 | Write unlock status bit of the part 0K to 22K of the Flash MAIN Code array
0x40000838 | FLASH0_ADDR | (20:2) FLASH_ADDR | (20:2) FLASH_ADDR | 0x0 | Flash Byte Address
0x4000083C - 0x40000840 | FLASH0_DATA_* | (31:0) DATA | (31:0) DATA | 0x0 | 32-bit Flash Data
0x40000844 | FLASH0_NVR_WRITE_UNLOCK | (31:0) UNLOCK_KEY | - | N/A | 32-bit key to allow for write access to NVR sectors of the Flash
0x40000848 | FLASH0_NVR_CTRL | (7) NVR7_W_EN | (7) NVR7_W_EN | 0x0 | Authorize write access to the Flash NVR7 sector through the FLASH_IF registers.
|  | (6) NVR6_W_EN | (6) NVR6_W_EN | 0x0 | Authorize write access to the Flash NVR6 sector through the FLASH_IF registers.
|  | (5) NVR5_W_EN | (5) NVR5_W_EN | 0x0 | Authorize write access to the Flash NVR5 sector through the FLASH_IF registers.
|  | (4) NVR4_W_EN | (4) NVR4_W_EN | 0x0 | Authorize write access to the Flash NVR4 sector through the FLASH_IF registers.
|  | (3) NVR3_W_EN | (3) NVR3_W_EN | 0x0 | Authorize write access to the Flash NVR3 sector through the FLASH_IF registers.
|  | (2) NVR2_W_EN | (2) NVR2_W_EN | 0x0 | Authorize write access to the Flash NVR2 sector through the FLASH_IF registers.
|  | (1) NVR1_W_EN | (1) NVR1_W_EN | 0x0 | Authorize write access to the Flash NVR1 sector through the FLASH_IF registers.
|  | (0) NVR0_W_EN | (0) NVR0_W_EN | 0x0 | Authorize write access to the Flash NVR0 sector through the FLASH_IF registers.
0x40000864 - 0x40000880 | FLASH0_PATCH_ADDR_* | (31) PATCH_NOT_VALID | (31) PATCH_NOT_VALID | 0x1 | Indicates if the patch address is valid
|  | (20:8) PATCH_ADDR | (20:8) PATCH_ADDR | 0x1FFF |
0x4000088C | FLASH0_COPY_CFG | (18) COMP_ADDR_STEP | (18) COMP_ADDR_STEP | 0x0 | Comparator address increment/decrement by 1 or 2
|  | (17) COMP_ADDR_DIR | (17) COMP_ADDR_DIR | 0x1 | Comparator address-up or address-down
|  | (16) COMP_MODE | (16) COMP_MODE | 0x0 | Comparator Mode
|  | (9) COPY_DEST | (9) COPY_DEST | 0x0 | Destination copier is the CRC or memories
|  | (8) COPY_MODE | (8) COPY_MODE | 0x0 | Select copier mode (32-bit or 40-bit)
|  | (1) PRIORITY | (1) PRIORITY | 0x0 | Copier Priority Configuration
|  | (0) MODE | (0) MODE | 0x0 | Copier or Comparator Mode Configuration
0x40000898 | FLASH0_COPY_CTRL | - | (3) ERROR | 0x0 | Error status
|  | (2) STOP | - | N/A | Stop the transfer
|  | (1) START | - | N/A | Start the transfer
|  | - | (0) BUSY | 0x0 | Busy status
0x4000089C | FLASH0_COPY_SRC_ADDR_PTR | (20:0) COPY_SRC_ADDR_PTR | (20:0) COPY_SRC_ADDR_PTR | 0x0 | Source address pointer
0x400008A0 | FLASH0_COPY_DST_ADDR_PTR | (31:2) COPY_DST_ADDR_PTR | (31:2) COPY_DST_ADDR_PTR | 0x0 | Destination address pointer
0x400008A4 | FLASH0_COPY_WORD_CNT | (16:0) COPY_WORD_CNT | (16:0) COPY_WORD_CNT | 0x0 | Number of words to copy / compare
0x400008A8 | FLASH0_ECC_CTRL | (15:8) ECC_COR_CNT_INT_THRESHOLD | (15:8) ECC_COR_CNT_INT_THRESHOLD | 0x1 | Select the number of corrected errors before sending a CM33 interrupt
|  | (3) COPIER_ECC_CTRL | (3) COPIER_ECC_CTRL | 0x1 |
|  | (2) CMD_ECC_CTRL | (2) CMD_ECC_CTRL | 0x1 |
|  | (0) CBUS_ECC_CTRL | (0) CBUS_ECC_CTRL | 0x1 | Select the operating mode of the Flash ECC
0x400008AC | FLASH0_ECC_STATUS | (6) ECC_COR_ERROR_CNT_CLEAR | - | N/A | Reset the Flash corrected errors counter
|  | (5) ECC_UNCOR_ERROR_CNT_CLEAR | - | N/A | Reset the Flash uncorrected errors counter
|  | (4) ECC_ERROR_ADDR_CLEAR | - | N/A | Reset the Flash address of the last detected error
|  | - | (1) ECC_COR_ERROR_CNT_STATUS | 0x0 | FLASH_ECC_ERROR_COR_CNT status
|  | - | (0) ECC_UNCOR_ERROR_CNT_STATUS | 0x0 | FLASH_ECC_ERROR_UNCOR_CNT status
0x400008B0 | FLASH0_ECC_ERROR_ADDR | - | (20:2) ECC_ERROR_ADDR | 0x0 | Store the Flash address of the latest Flash ECC error
0x400008B4 | FLASH0_ECC_UNCOR_ERROR_CNT | - | (7:0) ECC_UNCOR_ERROR_CNT | 0x0 | Flash ECC uncorrected error counter
0x400008B8 | FLASH0_ECC_COR_ERROR_CNT | - | (7:0) ECC_COR_ERROR_CNT | 0x0 | Flash ECC corrected error counter
0x400008BC | FLASH0_NVM_STATUS | (16) CLEAR_NVM_STATUS | - | N/A | Clear all the NVM status bits
|  | - | (8) NVM_BIT_FAILURE | 0x0 | Indicates if a bit has failed in an address from the CC-NVM layout used by the CryptoCell
|  | - | (5:0) FAILED_NVM_ADDRESS | 0x0 | Last failing word address in CC-NVM layout (0x00 to 0x3F)
0x400008C0 | FLASH0_MAIN_MASK | - | (11) DATA_A_35K_TO_40K_W_MASK | 0x1 | Authorize the access to the Flash MAIN Data array from 35K to 40K word block through the FLASH_IF registers.
|  | - | (10) DATA_A_30K_TO_35K_W_MASK | 0x1 | Authorize the access to the Flash MAIN Data array from 30K to 35K word block through the FLASH_IF registers.
|  | - | (9) DATA_A_25K_TO_30K_W_MASK | 0x1 | Authorize the access to the Flash MAIN Data array from 25K to 30K word block through the FLASH_IF registers.
|  | - | (8) DATA_A_20K_TO_25K_W_MASK | 0x1 | Authorize the access to the Flash MAIN Data array from 20K to 25K word block through the FLASH_IF registers.
|  | - | (7) DATA_A_15K_TO_20K_W_MASK | 0x1 | Authorize the access to the Flash MAIN Data array from 15K to 20K word block through the FLASH_IF registers.
|  | - | (6) DATA_A_10K_TO_15K_W_MASK | 0x1 | Authorize the access to the Flash MAIN Data array from 10K to 15K word block through the FLASH_IF registers.
|  | - | (5) DATA_A_5K_TO_10K_W_MASK | 0x1 | Authorize the access to the Flash MAIN Data array from 5K to 10K word block through the FLASH_IF registers.
|  | - | (4) DATA_A_0K_TO_5K_W_MASK | 0x1 | Authorize the access to the Flash MAIN Data array from 0 to 5K word block through the FLASH_IF registers.
|  | - | (3) CODE_A_66K_TO_88K_W_MASK | 0x1 | Authorize the access to the Flash MAIN Code array from 66K to 88K word block through the FLASH_IF registers.
|  | - | (2) CODE_A_44K_TO_66K_W_MASK | 0x1 | Authorize the access to the Flash MAIN Code array from 44K to 66K word block through the FLASH_IF registers.
|  | - | (1) CODE_A_22K_TO_44K_W_MASK | 0x1 | Authorize the access to the Flash MAIN Code array from 22K to 44K word block through the FLASH_IF registers.
|  | - | (0) CODE_A_0K_TO_22K_W_MASK | 0x1 | Authorize the access to the Flash MAIN Code array from 0 to 22K word block through the FLASH_IF registers.
0x400008FC | FLASH0_IF_ID_NUM | - | (20) FLASH_IF_NVR_FOR_CC312 | 0x0 | NVR sectors 0 to 3 are used for the CryptoCell
|  | - | (19:16) FLASH_IF_NUMBER | 0x0 | FLASH_IF Instance number
|  | - | (15:8) FLASH_IF_MAJOR_REVISION | 0x1 | FLASH_IF Major Revision number
|  | - | (7:0) FLASH_IF_MINOR_REVISION | 0x0 | FLASH_IF Minor Revision number