6.5.7.1.8 Programming a Flash Page
| Steps | Commands |
|---|---|
| Enable automatic writes | dap_write_word(NVMCTRL_CTRLB,
NVMCTRL_CMD_FLWR); |
| Wait for Unlock to complete | while (0 == (dap_read_word(NVMCTRL_INTFLAG) &
1)); |
| <begin loop> | |
| Write Data | dap_write_word(addr, data); |
| Wait for Write to complete | while (0 == (dap_read_word(NVMCTRL_INTFLAG) &
1)); |
| <end loop> | |
| Disable the Write Command | dap_write_word(NVMCTRL_CTRLB,
NVMCTRL_CMD_NOCMD); |
This sequence assumes that the page is not locked by LOCK fuses or BOOTPROT.
