Generation of MCUboot and application addresses, offsets, and padding when pm_static.yml is not present (Peripheral LBS Sample).

I am using peipheral lbs sample and modifying it for my project use. By default it doesnot has pm_static.yml where addresses could have been defined. Once i build the modified application it results in partitions.yml file and pm.config file. These files have all the relevant placement data of mcuboot, primary and secondary partitions, padding etc. From where these files are getting the relevant data ?
I have checked the following files but couldnt get much info. 

  • C:/ncs/v2.7.0/nrf/cmake/partition_manager.cmake
  • files in C:/ncs/v2.7.0/nrf/subsys/partition_manager/
  • files in C:/ncs/v2.7.0/zephyr/boards/nordic/nrf52dk/
  • .dts file for nrf52dk , this one has some info but not all of it
1- From where these files partitions.yml file and pm.config are getting the relevant addresses, offsets and size of mcuboot and app?
2- I want to have and understanding of this process. The purpose is to know how to flash bootloader and app separately on relevant addresses.
3- Where can I find documentation or literature explaining how to define and use macros in pm_static.yml for configuring flash partitions?
4- Which CMake file in NCS is responsible for merging the bootloader and application into the final firmware image?
Parents
  • Build Logs

    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: Directory/Project
    -- CMake version: 3.21.0
    -- Found Python3: C:/ncs/toolchains/ce3b5ff664/opt/bin/python.exe (found suitable version "3.9.13", minimum required is "3.8") found components: Interpreter
    -- Cache files will be written to: C:/ncs/v2.7.0/zephyr/.cache
    -- Zephyr version: 3.6.99 (C:/ncs/v2.7.0/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf52dk, qualifiers: nrf52832
    -- Found host-tools: zephyr 0.16.5 (C:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.5 (C:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk)
    -- Found Dtc: C:/ncs/toolchains/ce3b5ff664/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found BOARD.dts: C:/ncs/v2.7.0/zephyr/boards/nordic/nrf52dk/nrf52dk_nrf52832.dts
    -- Generated zephyr.dts: Directory/Project/build_2/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: Directory/Project/build_2/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: Directory/Project/build_2/zephyr/dts.cmake
    Parsing Directory/Project/Kconfig
    Loaded configuration 'C:/ncs/v2.7.0/zephyr/boards/nordic/nrf52dk/nrf52dk_nrf52832_defconfig'
    Merged configuration 'Directory/Project/prj.conf'
    Configuration saved to 'Directory/Project/build_2/zephyr/.config'
    Kconfig header saved to 'Directory/Project/build_2/zephyr/include/generated/autoconf.h'
    -- Found GnuLd: c:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd.exe (found version "2.38")
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    -- Found Python3: C:/ncs/toolchains/ce3b5ff664/opt/bin/python.exe (found version "3.9.13") found components: Interpreter

    === child image mcuboot - begin ===
    loading initial cache file Directory/Project/build_2/mcuboot/child_image_preload.cmake
    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/ncs/v2.7.0/bootloader/mcuboot/boot/zephyr
    -- CMake version: 3.21.0
    -- Found Python3: C:/ncs/toolchains/ce3b5ff664/opt/bin/python.exe (found suitable version "3.9.13", minimum required is "3.8") found components: Interpreter
    -- Cache files will be written to: C:/ncs/v2.7.0/zephyr/.cache
    -- Zephyr version: 3.6.99 (C:/ncs/v2.7.0/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf52dk, qualifiers: nrf52832
    -- Found host-tools: zephyr 0.16.5 (C:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.5 (C:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk)
    -- Found Dtc: C:/ncs/toolchains/ce3b5ff664/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found BOARD.dts: C:/ncs/v2.7.0/zephyr/boards/nordic/nrf52dk/nrf52dk_nrf52832.dts
    -- Found devicetree overlay: C:/ncs/v2.7.0/bootloader/mcuboot/boot/zephyr/app.overlay
    -- Generated zephyr.dts: Directory/Project/build_2/mcuboot/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: Directory/Project/build_2/mcuboot/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: Directory/Project/build_2/mcuboot/zephyr/dts.cmake
    Parsing C:/ncs/v2.7.0/bootloader/mcuboot/boot/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v2.7.0/zephyr/boards/nordic/nrf52dk/nrf52dk_nrf52832_defconfig'
    Merged configuration 'C:/ncs/v2.7.0/bootloader/mcuboot/boot/zephyr/prj.conf'
    Merged configuration 'C:/ncs/v2.7.0/nrf/subsys/partition_manager/partition_manager_enabled.conf'
    Merged configuration 'Directory/Project/build_2/mcuboot/zephyr/misc/generated/extra_kconfig_options.conf'
    Configuration saved to 'Directory/Project/build_2/mcuboot/zephyr/.config'
    Kconfig header saved to 'Directory/Project/build_2/mcuboot/zephyr/include/generated/autoconf.h'
    -- Found GnuLd: c:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd.exe (found version "2.38")
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    CMake Deprecation Warning at C:/ncs/v2.7.0/nrf/cmake/partition_manager.cmake:32 (message):

    ---------------------------------------------------------------------
    --- WARNING: Child and parent image functionality is deprecated ---
    --- and should be replaced with sysbuild. Child and parent image ---
    --- support remains only to allow existing customer applications ---
    --- to build and allow porting to sysbuild, it is no longer ---
    --- receiving updates or new features and it will not be possible ---
    --- to build using child/parent image at all in nRF Connect SDK ---
    --- version 2.9 onwards. ---
    ---------------------------------------------------------------------
    Call Stack (most recent call first):
    C:/ncs/v2.7.0/zephyr/cmake/modules/kernel.cmake:253 (include)
    C:/ncs/v2.7.0/zephyr/cmake/modules/zephyr_default.cmake:141 (include)
    C:/ncs/v2.7.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
    C:/ncs/v2.7.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
    CMakeLists.txt:12 (find_package)


    MCUBoot bootloader key file: C:/ncs/v2.7.0/bootloader/mcuboot/root-rsa-2048.pem
    -- Configuring done
    -- Generating done
    -- Build files have been written to: Directory/Project/build_2/mcuboot
    === child image mcuboot - end ===

    CMake Warning at C:/ncs/v2.7.0/nrf/modules/mcuboot/CMakeLists.txt:382 (message):

    ---------------------------------------------------------
    --- WARNING: Using default MCUBoot key, it should not ---
    --- be used for production. ---
    ---------------------------------------------------------

     

    CMake Warning at C:/ncs/v2.7.0/zephyr/CMakeLists.txt:2027 (message):
    __ASSERT() statements are globally ENABLED


    CMake Deprecation Warning at C:/ncs/v2.7.0/nrf/cmake/partition_manager.cmake:32 (message):

    ---------------------------------------------------------------------
    --- WARNING: Child and parent image functionality is deprecated ---
    --- and should be replaced with sysbuild. Child and parent image ---
    --- support remains only to allow existing customer applications ---
    --- to build and allow porting to sysbuild, it is no longer ---
    --- receiving updates or new features and it will not be possible ---
    --- to build using child/parent image at all in nRF Connect SDK ---
    --- version 2.9 onwards. ---
    ---------------------------------------------------------------------
    Call Stack (most recent call first):
    C:/ncs/v2.7.0/zephyr/cmake/modules/kernel.cmake:253 (include)
    C:/ncs/v2.7.0/zephyr/cmake/modules/zephyr_default.cmake:141 (include)
    C:/ncs/v2.7.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
    C:/ncs/v2.7.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
    CMakeLists.txt:8 (find_package)


    CMake Warning at C:/ncs/v2.7.0/nrf/cmake/partition_manager.cmake:102 (message):

    ---------------------------------------------------------------------
    --- WARNING: Using a bootloader without pm_static.yml. ---
    --- There are cases where a deployed product can consist of ---
    --- multiple images, and only a subset of these images can be ---
    --- upgraded through a firmware update mechanism. In such cases, ---
    --- the upgradable images must have partitions that are static ---
    --- and are matching the partition map used by the bootloader ---
    --- programmed onto the device. ---
    ---------------------------------------------------------------------

    Call Stack (most recent call first):
    C:/ncs/v2.7.0/zephyr/cmake/modules/kernel.cmake:253 (include)
    C:/ncs/v2.7.0/zephyr/cmake/modules/zephyr_default.cmake:141 (include)
    C:/ncs/v2.7.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
    C:/ncs/v2.7.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
    CMakeLists.txt:8 (find_package)


    -- Configuring done
    -- Generating done
    -- Build files have been written to: Directory/Project/build_2
    -- west build: building application
    [8/270] Generating include/generated/version.h
    -- Zephyr version: 3.6.99 (C:/ncs/v2.7.0/zephyr), build: v3.6.99-ncs2
    [6/271] Generating include/generated/version.h
    -- Zephyr version: 3.6.99 (C:/ncs/v2.7.0/zephyr), build: v3.6.99-ncs2
    [271/271] Linking C executable zephyr\zephyr.elf
    Memory region Used Size Region Size %age Used
    FLASH: 32848 B 48 KB 66.83%
    RAM: 23744 B 64 KB 36.23%
    IDT_LIST: 0 GB 32 KB 0.00%
    Generating files from Directory/Project/build_2/mcuboot/zephyr/zephyr.elf for board: nrf52dk
    [262/270] Linking C executable zephyr\zephyr.elf
    Memory region Used Size Region Size %age Used
    FLASH: 192984 B 232960 B 82.84%
    RAM: 50784 B 64 KB 77.49%
    IDT_LIST: 0 GB 32 KB 0.00%
    Generating files from Directory/Project/build_2/zephyr/zephyr.elf for board: nrf52dk
    [265/270] Generating ../../zephyr/app_update.bin
    image.py: sign the payload
    [266/270] Generating ../../zephyr/app_signed.hex
    image.py: sign the payload
    [268/270] Generating ../../zephyr/app_test_update.hex
    image.py: sign the payload
    [270/270] Generating zephyr/merged.hex
    * Terminal will be reused by tasks, press any key to close it.

Reply
  • Build Logs

    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: Directory/Project
    -- CMake version: 3.21.0
    -- Found Python3: C:/ncs/toolchains/ce3b5ff664/opt/bin/python.exe (found suitable version "3.9.13", minimum required is "3.8") found components: Interpreter
    -- Cache files will be written to: C:/ncs/v2.7.0/zephyr/.cache
    -- Zephyr version: 3.6.99 (C:/ncs/v2.7.0/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf52dk, qualifiers: nrf52832
    -- Found host-tools: zephyr 0.16.5 (C:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.5 (C:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk)
    -- Found Dtc: C:/ncs/toolchains/ce3b5ff664/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found BOARD.dts: C:/ncs/v2.7.0/zephyr/boards/nordic/nrf52dk/nrf52dk_nrf52832.dts
    -- Generated zephyr.dts: Directory/Project/build_2/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: Directory/Project/build_2/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: Directory/Project/build_2/zephyr/dts.cmake
    Parsing Directory/Project/Kconfig
    Loaded configuration 'C:/ncs/v2.7.0/zephyr/boards/nordic/nrf52dk/nrf52dk_nrf52832_defconfig'
    Merged configuration 'Directory/Project/prj.conf'
    Configuration saved to 'Directory/Project/build_2/zephyr/.config'
    Kconfig header saved to 'Directory/Project/build_2/zephyr/include/generated/autoconf.h'
    -- Found GnuLd: c:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd.exe (found version "2.38")
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    -- Found Python3: C:/ncs/toolchains/ce3b5ff664/opt/bin/python.exe (found version "3.9.13") found components: Interpreter

    === child image mcuboot - begin ===
    loading initial cache file Directory/Project/build_2/mcuboot/child_image_preload.cmake
    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/ncs/v2.7.0/bootloader/mcuboot/boot/zephyr
    -- CMake version: 3.21.0
    -- Found Python3: C:/ncs/toolchains/ce3b5ff664/opt/bin/python.exe (found suitable version "3.9.13", minimum required is "3.8") found components: Interpreter
    -- Cache files will be written to: C:/ncs/v2.7.0/zephyr/.cache
    -- Zephyr version: 3.6.99 (C:/ncs/v2.7.0/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf52dk, qualifiers: nrf52832
    -- Found host-tools: zephyr 0.16.5 (C:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.5 (C:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk)
    -- Found Dtc: C:/ncs/toolchains/ce3b5ff664/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found BOARD.dts: C:/ncs/v2.7.0/zephyr/boards/nordic/nrf52dk/nrf52dk_nrf52832.dts
    -- Found devicetree overlay: C:/ncs/v2.7.0/bootloader/mcuboot/boot/zephyr/app.overlay
    -- Generated zephyr.dts: Directory/Project/build_2/mcuboot/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: Directory/Project/build_2/mcuboot/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: Directory/Project/build_2/mcuboot/zephyr/dts.cmake
    Parsing C:/ncs/v2.7.0/bootloader/mcuboot/boot/zephyr/Kconfig
    Loaded configuration 'C:/ncs/v2.7.0/zephyr/boards/nordic/nrf52dk/nrf52dk_nrf52832_defconfig'
    Merged configuration 'C:/ncs/v2.7.0/bootloader/mcuboot/boot/zephyr/prj.conf'
    Merged configuration 'C:/ncs/v2.7.0/nrf/subsys/partition_manager/partition_manager_enabled.conf'
    Merged configuration 'Directory/Project/build_2/mcuboot/zephyr/misc/generated/extra_kconfig_options.conf'
    Configuration saved to 'Directory/Project/build_2/mcuboot/zephyr/.config'
    Kconfig header saved to 'Directory/Project/build_2/mcuboot/zephyr/include/generated/autoconf.h'
    -- Found GnuLd: c:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd.exe (found version "2.38")
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    CMake Deprecation Warning at C:/ncs/v2.7.0/nrf/cmake/partition_manager.cmake:32 (message):

    ---------------------------------------------------------------------
    --- WARNING: Child and parent image functionality is deprecated ---
    --- and should be replaced with sysbuild. Child and parent image ---
    --- support remains only to allow existing customer applications ---
    --- to build and allow porting to sysbuild, it is no longer ---
    --- receiving updates or new features and it will not be possible ---
    --- to build using child/parent image at all in nRF Connect SDK ---
    --- version 2.9 onwards. ---
    ---------------------------------------------------------------------
    Call Stack (most recent call first):
    C:/ncs/v2.7.0/zephyr/cmake/modules/kernel.cmake:253 (include)
    C:/ncs/v2.7.0/zephyr/cmake/modules/zephyr_default.cmake:141 (include)
    C:/ncs/v2.7.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
    C:/ncs/v2.7.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
    CMakeLists.txt:12 (find_package)


    MCUBoot bootloader key file: C:/ncs/v2.7.0/bootloader/mcuboot/root-rsa-2048.pem
    -- Configuring done
    -- Generating done
    -- Build files have been written to: Directory/Project/build_2/mcuboot
    === child image mcuboot - end ===

    CMake Warning at C:/ncs/v2.7.0/nrf/modules/mcuboot/CMakeLists.txt:382 (message):

    ---------------------------------------------------------
    --- WARNING: Using default MCUBoot key, it should not ---
    --- be used for production. ---
    ---------------------------------------------------------

     

    CMake Warning at C:/ncs/v2.7.0/zephyr/CMakeLists.txt:2027 (message):
    __ASSERT() statements are globally ENABLED


    CMake Deprecation Warning at C:/ncs/v2.7.0/nrf/cmake/partition_manager.cmake:32 (message):

    ---------------------------------------------------------------------
    --- WARNING: Child and parent image functionality is deprecated ---
    --- and should be replaced with sysbuild. Child and parent image ---
    --- support remains only to allow existing customer applications ---
    --- to build and allow porting to sysbuild, it is no longer ---
    --- receiving updates or new features and it will not be possible ---
    --- to build using child/parent image at all in nRF Connect SDK ---
    --- version 2.9 onwards. ---
    ---------------------------------------------------------------------
    Call Stack (most recent call first):
    C:/ncs/v2.7.0/zephyr/cmake/modules/kernel.cmake:253 (include)
    C:/ncs/v2.7.0/zephyr/cmake/modules/zephyr_default.cmake:141 (include)
    C:/ncs/v2.7.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
    C:/ncs/v2.7.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
    CMakeLists.txt:8 (find_package)


    CMake Warning at C:/ncs/v2.7.0/nrf/cmake/partition_manager.cmake:102 (message):

    ---------------------------------------------------------------------
    --- WARNING: Using a bootloader without pm_static.yml. ---
    --- There are cases where a deployed product can consist of ---
    --- multiple images, and only a subset of these images can be ---
    --- upgraded through a firmware update mechanism. In such cases, ---
    --- the upgradable images must have partitions that are static ---
    --- and are matching the partition map used by the bootloader ---
    --- programmed onto the device. ---
    ---------------------------------------------------------------------

    Call Stack (most recent call first):
    C:/ncs/v2.7.0/zephyr/cmake/modules/kernel.cmake:253 (include)
    C:/ncs/v2.7.0/zephyr/cmake/modules/zephyr_default.cmake:141 (include)
    C:/ncs/v2.7.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
    C:/ncs/v2.7.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
    CMakeLists.txt:8 (find_package)


    -- Configuring done
    -- Generating done
    -- Build files have been written to: Directory/Project/build_2
    -- west build: building application
    [8/270] Generating include/generated/version.h
    -- Zephyr version: 3.6.99 (C:/ncs/v2.7.0/zephyr), build: v3.6.99-ncs2
    [6/271] Generating include/generated/version.h
    -- Zephyr version: 3.6.99 (C:/ncs/v2.7.0/zephyr), build: v3.6.99-ncs2
    [271/271] Linking C executable zephyr\zephyr.elf
    Memory region Used Size Region Size %age Used
    FLASH: 32848 B 48 KB 66.83%
    RAM: 23744 B 64 KB 36.23%
    IDT_LIST: 0 GB 32 KB 0.00%
    Generating files from Directory/Project/build_2/mcuboot/zephyr/zephyr.elf for board: nrf52dk
    [262/270] Linking C executable zephyr\zephyr.elf
    Memory region Used Size Region Size %age Used
    FLASH: 192984 B 232960 B 82.84%
    RAM: 50784 B 64 KB 77.49%
    IDT_LIST: 0 GB 32 KB 0.00%
    Generating files from Directory/Project/build_2/zephyr/zephyr.elf for board: nrf52dk
    [265/270] Generating ../../zephyr/app_update.bin
    image.py: sign the payload
    [266/270] Generating ../../zephyr/app_signed.hex
    image.py: sign the payload
    [268/270] Generating ../../zephyr/app_test_update.hex
    image.py: sign the payload
    [270/270] Generating zephyr/merged.hex
    * Terminal will be reused by tasks, press any key to close it.

Children
No Data
Related