Writing data - SECUREAPPROTECT disabled

Use the standard Serial Wire Debug (SWD) Arm® CoreSight™ Debug Access Port (DAP) protocol to write data into flash.

The Non-volatile Memory Controller (NVMC) peripheral has two different base addresses:
  1. Set the CONFIG register of the NVMC to WEN.Wen by writing 0x00000001 to the following addresses:
    • Application core - 0x50039504
    • Network core - 41080504
    This enables writing to the non-volatile memory.
  2. Read the READY register (0x50039400) of the NVMC until the value is 0x00000001. Read the following addresses:
    • Application core - 0x50039400
    • Network core - 0x41080400
    When this value is read, the NVMC is ready and not currently performing any operations.
  3. Write the data to the desired, word-aligned address.
  4. Read the READY register of the NVMC until the value is 0x00000001 before continuing to ensure the write operation has completed. Read the following addresses:
    • Application core - 0x50039400
    • Network core - 0x41080400
  5. Continue writing and then reading the READY register as necessary.
  6. Set the CONFIG register of the NVMC to WEN.Ren by writing 0x00000000 to the following addresses:
    • Application core - 0x50039504
    • Network core - 41080504
    This configures the non-volatile memory as read-only.

The ranges of writeable addresses are:

You can write to flash using different methods. For nRF5340, a good flash algorithm should take around 11 seconds to write the entire flash to the application core, and around 3 seconds for the network core. If you cannot achieve this time, contact Nordic Semiconductor for assistance.