6.1.7.2 Row Programming Sequence
The largest block of data that can be programmed by a single NVMOP command is one row. A row is 1024 bytes of data. NVMADDR is the row-aligned address where the Flash address starts programming the data. The controller ignores the sub-row address bits and always starts programming at the beginning of a row.
Follow this sequence of steps for row programming:
- Write the entire row of data to be programmed into the system SRAM. The source address must be word-aligned but is otherwise unrestricted.
- Set NVMADDR with the address of the flash row to be programmed.
- Set NVMSRCADDR with the 32-bit physical source address from step 1.
- Run the following sequencer start
unlock sequence using the row program command to start the sequence:
- Set NVMCON.WREN =
1
(allow writes to NVMCON.NVMWR), and set NVMCON.NVMOP to ROW (using a single write). - Set NVMKEY = 0x00000000 (reset key).
- Set NVMKEY = 0xAA996655.
- Set NVMKEY = 0x556699AA.
- Write to the target register NVMCONSET to set the NVMWR bit (not the NVMCON register itself). This starts the FC operation.
Note: The program sequence completes when the hardware clears the NVMCOM.NVMWR bit. This pulses the Flash event. - Set NVMCON.WREN =
- Clear the NVMCON.NVMWREN bit.
- Check the NVMCON.NVMERR and NVMCON.BORERR bits to ensure that the programming is successful.