NVS Settings subsys custom partition placement

Hi,

I am working on a project where I use the Settings subsys with the NVS backend.
I am using a "provisioning" firmware that is used to initialize the settings partition with default values and to provision the modem with certificates and keys.

Now I would like to be sure that the settings_storage partition is located at the same address for my provisioning and my main applications (end of flash).
To do so I would like to specify it using a custom partition manager configuration file and not use the default generated one, which raise multiple questions:

1. where can I define a custom partition ? (I tried in a pm.yml file at the root of the project but it seems to be ignored. I am not sure to have fully understood everything about multi image build)
2. will my custom partition be in conflict with the one that is automatically added by the settings subsys ?
3. is there any sample where the partition is used to define a custom partition ?

Regards

Alexandre

  • Hi,

    It looks like you're correct. 

    In your pm_static you can use overlay/dts APIs such as DT_CHOSEN to for instance fetch the devices, but it looks like you can't use the config-parameters defined such as sizes (for instance CONFIG_PM_PARTITION_SIZE_SETTINGS_STORAGE ) seems to not be included in pm_static.yml, but are however included in pm.yml, which are different.

    mcuboot_secondary:
      address: 0x0
      device: DT_CHOSEN(nordic_pm_ext_flash)
      end_address: 0xf4000
      placement:
        align:
          start: 0x4
      region: external_flash
      share_size:
      - mcuboot_primary
      size: 0xf4000

    I will keep looking into this during the next week, but my initial conclusion is atleast what I just said

    Kind regards,
    Andreas

  • Hi,

    Thanks for your answer.
    I keep this ticket open in case you come with updates.

    Thanks for your help.

    Regards.

Related