Write user data to NVM

Hi,

I'm working with nRF5340 and would like to store my own data in the NVM (2 bytes in total).

I couldn't figure out which flash partition is relevant for this and what is its address. I looked at the memory map (P.20), but it doesn't specify that.

I would appreciate your help with doing so, and also to understand if using nrfx_nvmc library is relevant or should I user another method.

Thank you!

Parents
  • Hi,

    Since the minimum erase unit for the flash is 4kB, you would need to reserve at least 4kB of flash even if you only need 2 bytes of storage (actually 4 bytes, since that is the minimum write size).

    If you are using any of the SDK samples with wireless connectivity, it is a good chance that it is already using the Settings Subsystem to manage storage of persistent application data. In that case, I would recommend you use the same module for storing your own data to allow you to use the existing storage partition in flash (You can run the 'Memory report' action in the vs code extension to see where in flash the storage partition is placed).

    Best regards,

    Vidar

Reply
  • Hi,

    Since the minimum erase unit for the flash is 4kB, you would need to reserve at least 4kB of flash even if you only need 2 bytes of storage (actually 4 bytes, since that is the minimum write size).

    If you are using any of the SDK samples with wireless connectivity, it is a good chance that it is already using the Settings Subsystem to manage storage of persistent application data. In that case, I would recommend you use the same module for storing your own data to allow you to use the existing storage partition in flash (You can run the 'Memory report' action in the vs code extension to see where in flash the storage partition is placed).

    Best regards,

    Vidar

Children
Related