Issues going from SDK 2.6.3 to 2.9.1

Hi

I've recently tried to move from SDK version 2.6.3 to 2.9.1. However i've run into issues with this transistion.

I made a new custom board, by following the guide provided in the Academy, and this compiles with at_client and hello_world with no issues.

However another more advanced application gives me the following error when trying to build the application:

 In file included from C:/ncs/v2.9.1/zephyr/include/zephyr/storage/flash_map.h:300,
from C:/ncs/v2.9.1/zephyr/subsys/dfu/boot/mcuboot.c:12:
C:/ncs/v2.9.1/zephyr/subsys/dfu/boot/mcuboot.c: In function 'boot_is_img_confirmed':
C:/ncs/v2.9.1/nrf/include/flash_map_pm.h:47:22: error: 'PM_mcuboot_primary_ID' undeclared (first use in this function)
47 | #define PM_ID(label) PM_##label##_ID
| ^~~
C:/ncs/v2.9.1/nrf/include/flash_map_pm.h:52:35: note: in expansion of macro 'PM_ID'
52 | #define FIXED_PARTITION_ID(label) PM_ID(label)
| ^~~~~
C:/ncs/v2.9.1/zephyr/subsys/dfu/boot/mcuboot_priv.h:22:34: note: in expansion of macro 'FIXED_PARTITION_ID'
22 | #define FLASH_AREA_IMAGE_PRIMARY FIXED_PARTITION_ID(SLOT0_LABEL)
| ^~~~~~~~~~~~~~~~~~
C:/ncs/v2.9.1/zephyr/subsys/dfu/boot/mcuboot.c:236:30: note: in expansion of macro 'FLASH_AREA_IMAGE_PRIMARY'
236 | rc = flash_area_open(FLASH_AREA_IMAGE_PRIMARY, &fa);
| ^~~~~~~~~~~~~~~~~~~~~~~~
C:/ncs/v2.9.1/nrf/include/flash_map_pm.h:47:22: note: each undeclared identifier is reported only once for each function it appears in
47 | #define PM_ID(label) PM_##label##_ID
| ^~~
C:/ncs/v2.9.1/nrf/include/flash_map_pm.h:52:35: note: in expansion of macro 'PM_ID'
52 | #define FIXED_PARTITION_ID(label) PM_ID(label)
| ^~~~~
C:/ncs/v2.9.1/zephyr/subsys/dfu/boot/mcuboot_priv.h:22:34: note: in expansion of macro 'FIXED_PARTITION_ID'
22 | #define FLASH_AREA_IMAGE_PRIMARY FIXED_PARTITION_ID(SLOT0_LABEL)
| ^~~~~~~~~~~~~~~~~~
C:/ncs/v2.9.1/zephyr/subsys/dfu/boot/mcuboot.c:236:30: note: in expansion of macro 'FLASH_AREA_IMAGE_PRIMARY'
236 | rc = flash_area_open(FLASH_AREA_IMAGE_PRIMARY, &fa);
| ^~~~~~~~~~~~~~~~~~~~~~~~
C:/ncs/v2.9.1/zephyr/subsys/dfu/boot/mcuboot.c: In function 'boot_write_img_confirmed':
C:/ncs/v2.9.1/zephyr/subsys/dfu/boot/mcuboot.c:68:49: error: 'PM_MCUBOOT_PRIMARY_ID' undeclared (first use in this function)
68 | #define ACTIVE_SLOT_FLASH_AREA_ID PM_MCUBOOT_PRIMARY_ID
| ^~~~~~~~~~~~~~~~~~~~~
C:/ncs/v2.9.1/zephyr/subsys/dfu/boot/mcuboot.c:263:29: note: in expansion of macro 'ACTIVE_SLOT_FLASH_AREA_ID'
263 | if (flash_area_open(ACTIVE_SLOT_FLASH_AREA_ID, &fa) != 0) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~

I cannot make sense of the issue, other than it seems to have something to do with partition managing. 

The same application worked perfectly with SDK Version 2.6.3.

Hope someone can help!

Parents
  • Hello,

    It looks like the problem arises when you build a project that includes MCUBoot, but was unable to reproduce this here. I tested with a test board I created using the Board generator wizard in VS code:

    5481.boards.zip

    Does your board dts include the mcuboot partition as shown here: 

    ?

    Best regards,

    Vidar

  • Hi

    Yes the following is from a dtsi file:

    &flash0 {
         partitions {
             compatible = "fixed-partitions";
             #address-cells = <1>;
             #size-cells = <1>;
     
             boot_partition: partition@0 {
                 label = "mcuboot";
                 reg = <0x00000000 0x10000>;
             };
             slot0_partition: partition@10000 {
                 label = "image-0";
                 reg = <0x00010000 0x40000>;
             };
             slot0_ns_partition: partition@50000 {
                 label = "image-0-nonsecure";
                 reg = <0x00050000 0x35000>;
             };
             slot1_partition: partition@85000 {
                 label = "image-1";
                 reg = <0x00085000 0x40000>;
             };
             slot1_ns_partition: partition@c5000 {
                 label = "image-1-nonsecure";
                 reg = <0x000c5000 0x35000>;
             };
             storage_partition: partition@fa000 {
                 label = "storage";
                 reg = <0x000fa000 0x00006000>;
             };
         };
     };
Reply
  • Hi

    Yes the following is from a dtsi file:

    &flash0 {
         partitions {
             compatible = "fixed-partitions";
             #address-cells = <1>;
             #size-cells = <1>;
     
             boot_partition: partition@0 {
                 label = "mcuboot";
                 reg = <0x00000000 0x10000>;
             };
             slot0_partition: partition@10000 {
                 label = "image-0";
                 reg = <0x00010000 0x40000>;
             };
             slot0_ns_partition: partition@50000 {
                 label = "image-0-nonsecure";
                 reg = <0x00050000 0x35000>;
             };
             slot1_partition: partition@85000 {
                 label = "image-1";
                 reg = <0x00085000 0x40000>;
             };
             slot1_ns_partition: partition@c5000 {
                 label = "image-1-nonsecure";
                 reg = <0x000c5000 0x35000>;
             };
             storage_partition: partition@fa000 {
                 label = "storage";
                 reg = <0x000fa000 0x00006000>;
             };
         };
     };
Children
Related