6.7 Flash Memory Programming
The Flash Controller (FC) works with a single panel made from 4 KB pages, with each page containing four rows of Flash data. A row is the largest selectable region for contiguous programming of write words.
The FC state machine accepts commands from the NVMCON register NVMOP commands (NVMCON.NVMOP).
A page of Flash is the smallest unit of memory that can be erased in a single operation. The whole Program Flash Memory (PFM) region can be erased in a single operation.
- Row Programming - Word-by-word programming until the whole row is programmed. The FC reads the data from the system SRAM
- Quad Word Programming - The FC performs four writes of data from holding registers
- Single Word Programming - The FC performs one write of data from holding registers
- Page Erase
The following procedures must be used to program the device Flash using DSU. Programming the Flash is only possible when the device is not code protected. If the device is already code protected, issue the chip erase procedure to make the device unprotected and programming ready.
- Issue the cold plugging procedure to enter into the DAP mode.
- Issue a chip erase procedure (only if device is code protected as described in Chip Erase).
- This step is needed only if programming the BFM memory region.
- Perform the system unlock sequence and write to the NVMLBWP register (0x440006F0)= 0x80000000.
- Clear LBWPn bits of NVMLBWP to remove the write protect on the corresponding page. Note: At Reset, all LBWPn bits of NVMLBWP are set to logic
1
, write protecting all user accessible NVR pages (BFM). - Set DSUEXT.TESTMODE (@0x410001FC) bit 3 to
1
.
- Perform the procedures mentioned in Row Programming Sequence.
Programming BCFG Single Boot Page for Configurations
- Issue the cold plugging procedure to enter into the DAP mode.
- Perform the below steps to disable write protection.
- Perform the system unlock sequence and write to the NVMLBWP register (0x440006F0)= 0x80000000.
- Clear the LBWP5 bit (page 5) of NVMLBWP to remove the write protect on the corresponding page.
- Set DSUEXT.TESTMODE (@0x410001FC) bit 3 to
1
.
- Issue a page erase procedure.
- Perform the procedures mentioned in Row Programming Sequence.