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

nRF9160: where does the flash partitions address are been picked?

Hi,

I just enabled the CONFIG_BOOTLOADER_MCUBOOT=y for serial LTE modem application to understand the flash partitions and to perform the serial DFU(not sure if its really supported), but i was confused seeing the rom_report, the build system disregarded the partition addresses defined in the DTS files and overwritten with different start address and sizes, could you help me understand where there partition defined?

i refereed the following documentation but couldn't get the answer.

http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_multi_image.html

http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/scripts/partition_manager/partition_manager.html

regards

KK

Parents Reply
  • Hi KK, 

    My sincere apologies for the late reply, I have been working to find an answer. 

    kk2mkk said:
    No i dont have any pm.yml in added to to the SLM project does its required? even the HTTP Application Update sample dint have either. What is the default partition configuration is picked up by the build subsystem?

    No, pm.yml is not required, but if you had one that would configure the partition. By default the partition is configured depending on what you inlude in your project. Adding a pm_static.yml or pm.yml will manually configure the partitions for you, and is more advanced. 

    Adding B0 (Immutable bootloader) + MCUboot (upgradeble bootloader) in your project will dynamically configure the partition for you, and ensure that it is working. These are added when setting CONFIG_BOOTLOADER_MCUBOOT and CONFIG_SECURE_BOOT, as according to the Secure Bootloader chain documentation.

    Our developer adds:

    So when you include the bootloader(b0) https://github.com/nrfconnect/sdk-nrf/blob/master/samples/bootloader/pm.yml this pm.yml is added to the dynamic resolving of partitions and this one https://github.com/nrfconnect/sdk-nrf/blob/master/samples/spm/pm.yml is for spm. Here is a few different configurations which also add ram partitioning depending on what's included https://github.com/nrfconnect/sdk-nrf/tree/master/subsys/partition_manager and in this is for MCUBoot https://github.com/nrfconnect/sdk-mcuboot/blob/master/boot/zephyr/pm.yml
    As you can see some of the sizes are possible to configure by Kconfig but I would suggest using the defaults as they are optimised for the size of flash being locked. If they don't use flash locking they are free to change it as they please as long as it is big enough to fit the whole image(firmware being built(b0, mcuboot, spm) etc in each respective partition.
    Flash locking is recommended from a security/safety standpoint.
    For the HTTP Application update sample, which has only CONFIG_BOOTLOADER_MCUBOOT set, you will not be able to update mcuboot since b0 is not included. Adding CONFIG_SECURE_BOOT will enable b0 and create s0 and s1 for mcuboot. So that you use s0/s1 for switching between mcuboot upgrades and secondary slot vs primary in mcuboot for the application.

    See the Immutable Bootloader sample for more information. 

    Kind regards,

    Øyvind

Children
Related