Using NCS 1.2 SMP_SVR example compiled with custom board DT

Hi,

I am using NCS 1.2 with Zephyr SMP_SVR example compiling with my own board DTS and using MCUBOOT

I have my own partitions configured in my DTS (attached down at the bottom of this message)

I understood that NCS is using PM (Partition manager and overrides this DTS configuration

In such case as read here:

http://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.2.0/nrf/scripts/partition_manager/partition_manager.html#partition-manager

I should config the desired partitions under the PM.yml of the child (which is the bootloader MCUboot)

I don't that this is the right way to do it - I might be missing something.

Another thing I tried is entering menuconfig of the application (smp_svr) and search PM there, I only got:

Which I don't really understand how to use/configure

Bottom line, I want to understand what is the correct way and how should I configure the flash partitions for bootloader, slot-0 slot-1 scratch and storage to match the muli-build of smp_svr example build with mcuboot

boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 0x0000C000>;
};
slot0_partition: partition@c000 {
label = "image-0";
reg = <0x0000C000 0x000036000>;
};
slot1_partition: partition@42000 {
label = "image-1";
reg = <0x00042000 0x000036000>;
};
scratch_partition: partition@78000 {
label = "image-scratch";
reg = <0x00078000 0x00008000>;
};
storage_partition: partition@80000 {
label = "storage";
reg = <0x00080000 0x00080000>;
};

  • Hello, 

    The  Zephyr SMP Server Sample (SMP_SVR) is a sample made by the Zephyr community for nRF52x, and not by the NCS team in Nordic. At the moment NCS is lacking full support for nRF52 devices. Therefore I would recommend asking the Zephyr community for help.

    Kind regards,
    Øyvind

  • Dear Øyvind,

    Partition manager is NCS related module, I am asking what is the designed way to configure partitions, SMP_SVR is a Zephyr example included in the NCS package and uses Partition Manager

  •  If you want to enter the configuration of mcuboot to configure the partition configurations 

     
    ninja/make mcuboot_menuconfig
    To change the configuration, you could either specify a specific config file for MCUBoot 

    Through
    CmakeFile:
    
    set(mcuboot_CONF_FILE mcuboot.conf)
    
    or
    cmake -Dmcuboot_CONF_FILE=mcuboot.conf


    or change 
    <NCS root dir>/bootloader/mcuboot/boot/zephyr/pm.yml
    If you want a specific configuration, I would recommend trying to define a pm_static.yml file in your project folder.

    If you want to look at what is generated, look in your <build_root>/partitions.yml or pm.config depending on what you prefer to read.

    The generated correlated
    <build root>mcuboot/zephyr/include/generated/pm_config.h
    <build root>zephyr/include/generated/pm_config.h
     header files are found at:
    To better answer, your question is that you would have to set:

    PM_PARTITION_SIZE_MCUBOOT=0xc000
    PM_PARTITION_SIZE_MCUBOOT_STORAGE=0x80000
    PM_PARTITION_SIZE_MCUBOOT_SCRATCH=8000
    Unfortunately, you won't be able to set the partition size as that's what partition manager will calculate for you so the rest of the space will be split in to and be slot_0 and slot_1 and both storage and scratch is placed accordingly. So if you want a 1:1 match you'll have to use pm_static.yml. Look at the generated partitions.yml after setting the configuration you want and tune the placement afterward would be my suggestion.
  • dear 

    Thanks for your reply it's very helpful,

    I generated this pm_ststic.yml, it supposes (according to my understanding) to correspond with the DTS partitions configuration

    but unfortunately, I am getting error in compilation:

    File "/home/eshaul/workspace/ncs/nrf/scripts/partition_manager.py", line 490, in get_dynamic_area_start_and_size
    assert len(gaps) == 1, "Incorrect amount of gaps found"

    Can you help my understanding if indeed the pm_static.yml is corresponding with DTS partition configuration?

    For example, I don't have the scratch partition there...

    Is there any documentation specific to how pm_static.yml structure should be?

    Thanks

    Erez.

    app:
      address: 0xc200
      size: 0x35e00
    littlefs_storage:
      address: 0x80000
      placement:
        after:
        - app
      size: 0x80000
    mcuboot:
      address: 0x0
      placement:
        before:
        - mcuboot_primary
      size: 0xc000
    mcuboot_pad:
      address: 0xc000
      placement:
        align:
          start: 0x1000
        before:
        - mcuboot_primary_app
      size: 0x200
    mcuboot_primary:
      address: 0xc000
      orig_span: &id001
      - mcuboot_pad
      - app
      sharers: 0x1
      size: 0x36000
      span: *id001
    mcuboot_primary_app:
      address: 0xc200
      orig_span: &id002
      - app
      size: 0x35e00
      span: *id002
    mcuboot_secondary:
      address: 0x42000
      placement:
        after:
        - mcuboot_primary
        align:
          start: 0x1000
      share_size:
      - mcuboot_primary
      size: 0x36000
    

    boot_partition: partition@0 {
    label = "mcuboot";
    reg = <0x00000000 0x0000C000>;
    };
    slot0_partition: partition@c000 {
    label = "image-0";
    reg = <0x0000C000 0x000036000>;
    };
    slot1_partition: partition@42000 {
    label = "image-1";
    reg = <0x00042000 0x000036000>;
    };
    scratch_partition: partition@78000 {
    label = "image-scratch";
    reg = <0x00078000 0x00008000>;
    };
    storage_partition: partition@80000 {
    label = "storage";
    reg = <0x00080000 0x00080000>;
    };

  • File "/home/eshaul/workspace/ncs/nrf/scripts/partition_manager.py", line 490, in get_dynamic_area_start_and_size
    assert len(gaps) == 1, "Incorrect amount of gaps found"

    So this error comes if your partitions are not address aligned directly after each other. Try to create an empty partition between the sections which are not aligned. So that you fill the gaps which are between your partitions.

Related