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:
  1. Write the entire row of data to be programmed into the system SRAM. The source address must be word-aligned but is otherwise unrestricted.
  2. Set NVMADDR with the address of the flash row to be programmed.
  3. Set NVMSRCADDR with the 32-bit physical source address from step 1.
  4. Run the following sequencer start unlock sequence using the row program command to start the sequence:
    1. Set NVMCON.WREN = 1 (allow writes to NVMCON.NVMWR), and set NVMCON.NVMOP to ROW (using a single write).
    2. Set NVMKEY = 0x00000000 (reset key).
    3. Set NVMKEY = 0xAA996655.
    4. Set NVMKEY = 0x556699AA.
    5. 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.
  5. Clear the NVMCON.NVMWREN bit.
  6. Check the NVMCON.NVMERR and NVMCON.BORERR bits to ensure that the programming is successful.