How to place some default values in Flash at a fixed address?

Hi Nordic Teams,

Now I'm using Nordic Connect SDK v3.1.0 to development, I want place some default values in Flash at a fixed address, 

But I don't know how to do it. Can anyone provide some help? The following code doesn't work, seems that "at" can't be used anymore.

const uint32_t flash_setting __attribute__((at(0x10000))) = {0x12};

  • Hi,

    You should be able to use the approach described here. Note that additionally you should reserve a partition for this with a pm_static.yml file (or add this to your existing), to make sure th epartition manager does not place anything else here. That could be something like this (addjust address and size as needed):

    config_partition:
      address: 0x7f000
      size: 0x1000
      region: flash_primary

Related