This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

C implementation for writing to NVMC

Hello,

I am looking through the data sheet for the NRF52 and do not see anything for writing to NVMC.

I see you can erase and configure the NVMC using:

NRF_NVMC -> CONFIG = 0x2; NRF_NVMC -> ERASEPAGE = 0x0150;

I was expecting see some thing like

NRF_NVMC -> WRITEPAGE = 0x0150; NRF_NVMC -> DATA = 0x3350;

How would I go about writing data to a specific address in flash?

Thanks,

Eric

Parents
  • Straight out of the manual

    The Non-volatile memory controller (NVMC) is used for writing and erasing the internal Flash memory and the UICR.

    Before a write can be performed, the NVMC must be enabled for writing in CONFIG.WEN. Similarly, before an erase can be performed, the NVMC must be enabled for erasing in CONFIG.EEN, see CONFIG. The user must make sure that writing and erasing are not enabled at the same time. Failing to do so may result in unpredictable behavior.

    Writing to Flash

    When writing is enabled, the Flash is written by writing a full 32-bit word to a word-aligned address in the Flash.

Reply
  • Straight out of the manual

    The Non-volatile memory controller (NVMC) is used for writing and erasing the internal Flash memory and the UICR.

    Before a write can be performed, the NVMC must be enabled for writing in CONFIG.WEN. Similarly, before an erase can be performed, the NVMC must be enabled for erasing in CONFIG.EEN, see CONFIG. The user must make sure that writing and erasing are not enabled at the same time. Failing to do so may result in unpredictable behavior.

    Writing to Flash

    When writing is enabled, the Flash is written by writing a full 32-bit word to a word-aligned address in the Flash.

Children
Related