Unexpected warning message: partition_manager.cmake says I do not use pm_static.yml, even though it is there.

Hello,

I am using a nRF5340 with mcuboot and multiple customer-specific partitions.
I did not finish creating a separate board definition yet. Currently, we are using the nRF5340-DK board definition and remove development kit specific items while adding our components. Just for reference.
Concerning the partitions, I created pm_static.yml in out project's base directory (where src/, build/ and child_image/ directories also reside). The partition handling seemed to work in our main application.

When I perform a pristine build, I receive an error message, telling me that I would not use a static partition configuration (pm_static.yml). although it is there.

[{  "resource": "/c:/ncs/v2.5.2/nrf/cmake/partition_manager.cmake",
    "owner": "nrf-connect",
    "severity": 4,
    "message": "CMake Warning at C:/ncs/v2.5.2/nrf/cmake/partition_manager.cmake:79 (message):",
    "source": "cmake",
    "startLineNumber": 79,
    "startColumn": 1,
    "endLineNumber": 79,
    "endColumn": 2147483647
}]

...and if I double-click on the message, I see this piece of code in partition_manager.cmake:

if (NOT static_configuration AND
  (CONFIG_BOOTLOADER_MCUBOOT OR CONFIG_SECURE_BOOT))
      message(WARNING "
        ---------------------------------------------------------------------
        --- 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.                                   ---
        ---------------------------------------------------------------------
        \n"
      )
endif()

What went wrong here? Is my pm_static.yml applied successfully?

Best regards,
Michael

  • Hi, if I remember correctly, the app region is used as a placeholder to place the main application or so... maybe this could be the reason? Please check in the Nordic Academy courses about partitions. Unfortunately, I can't help you with this, as I'm still struggling with some aspects of the build system myself.

    I would suggest to automatically create a net core partitioning file and use it as basis for your pm_static_NETCORE.yml. In this file, there should be a partition for ipc_radio or so which you could move (togther with the app partition... it is a bit confusing with overlapping partition names).

    Best regards,
    Michael

  • Hi Michael,

    Yes, the pm_static_CPUNET file is taken over from the dynamic build, and has correct definitions.

    The point is, since the netcore contains both B0n and the app, the solution you provided works only for the B0n partition on the netcore, but not for the app partition.

    That’s why the second screenshot shows only:
    Partition 'b0n' is not included in the dynamic resolving since it is statically defined.
    Partition 'b0n_container' is not included in the dynamic resolving since it is statically defined.
    Partition 'provision' is not included in the dynamic resolving since it is statically defined.

    But it’s missing:
    Partition 'app_image' is not included in the dynamic resolving since it is statically defined.

    (which is visible in the first screenshot, as the pm_static for the APPCore works correctly).

    => the app region from pm_static_CPUNET.yml is not taken into account — only the b0n region is.

    Sure, no problem.

    Thank you.
    BR.
    Milan

  • Hi Milan,

    I don't know what your 'app_image' partition is as I don't have it in my setup. Though I can say that neither for the net core nor for the app core, I have this 'not included' message for the main image (which would be hci_ipc on the net core in my case). In my case, moving the 'hci_ipc' partition to reserve some extra space to b0n for possible future updates worked without any problems.

    One more hint I can give you: Check if there are flash pages not covered by any partition in your net core pm_static. I remember reading somewhere that the 'app' partition was just a placeholder for the remaining free space which is eventually used for the main application. If you want to add some reserved unused space to your pm_static, create a dummy partition for it. And in my setup, 'app' and 'hci_ipc' are overlapping partitions with exactly the same offset and size (where 'app' has this strange span syntax included).

    Best regards,
    Michael

Related