Migration to sysbuid - fixed partition is not recognized

Hello !

I recently updated our project SDK from 2.6.0 to 2.7.0 and our custom board to HW v2 layout. Everything went almost seemless until I tried to enable sysbuild option (on NRF52, single image build - application only, no bootloader).

On legacy cmake build, compilation is successfull. But on sysbuild, I get the following build errors (prt error log at the end).

Our storage fixed-partitions are correctly defined in our board DTS, so I assume I miss some SB specific options, but I don't know which ones (I tried SB partition manager but it didn't work)

Could you provide me support with this ?

Thanks !

--------------------------------------------------------------------------

In file included from C:/workspaces/firmware-ng/zephyr/include/zephyr/sys/util_macro.h:34,
                 from C:/workspaces/firmware-ng/zephyr/include/zephyr/sys/util.h:17,
                 from C:/workspaces/firmware-ng/zephyr/include/zephyr/sys/atomic.h:18,
                 from C:/workspaces/firmware-ng/zephyr/include/zephyr/kernel_includes.h:25,
                 from C:/workspaces/firmware-ng/zephyr/include/zephyr/kernel.h:17,
                 from C:/workspaces/firmware-ng/firmware-zephyr/applications/label/src/subsys/flash/flash_storage.c:2:
C:/workspaces/firmware-ng/firmware-zephyr/applications/label/src/subsys/flash/flash_storage.c: In function 'flash_storage_init':  
C:/workspaces/firmware-ng/nrf/include/flash_map_pm.h:52:18: error: 'PM_PM_PM_storage_partition_ID_LABEL_OFFSET' undeclared (first use in this function)
   52 |         UTIL_CAT(PM_, UTIL_CAT(UTIL_CAT(PM_, UTIL_CAT(PM_ID(label), _LABEL)), x))
      |                  ^~~
C:/workspaces/firmware-ng/zephyr/include/zephyr/sys/util_internal.h:105:36: note: in definition of macro 'UTIL_PRIMITIVE_CAT'     
  105 | #define UTIL_PRIMITIVE_CAT(a, ...) a##__VA_ARGS__
      |                                    ^
C:/workspaces/firmware-ng/nrf/include/flash_map_pm.h:52:9: note: in expansion of macro 'UTIL_CAT'
   52 |         UTIL_CAT(PM_, UTIL_CAT(UTIL_CAT(PM_, UTIL_CAT(PM_ID(label), _LABEL)), x))
      |         ^~~~~~~~
C:/workspaces/firmware-ng/nrf/include/flash_map_pm.h:55:39: note: in expansion of macro 'FIXED_PARTITION_DATA_FIELD'
   55 | #define FIXED_PARTITION_OFFSET(label) FIXED_PARTITION_DATA_FIELD(label, _OFFSET)
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
C:/workspaces/firmware-ng/firmware-zephyr/applications/label/src/subsys/flash/flash_storage.c:13:45: note: in expansion of macro  
FIXED_PARTITION_OFFSET'
   13 | #define STORAGE_PARTITION_OFFSET            FIXED_PARTITION_OFFSET(STORAGE_PARTITION)
      |                                             ^~~~~~~~~~~~~~~~~~~~~~
C:/workspaces/firmware-ng/firmware-zephyr/applications/label/src/subsys/flash/flash_storage.c:192:32: note: in expansion of macro 'STORAGE_PARTITION_OFFSET'
  192 |     ctx.buffer.config.offset = STORAGE_PARTITION_OFFSET;
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~
C:/workspaces/firmware-ng/nrf/include/flash_map_pm.h:52:18: note: each undeclared identifier is reported only once for each function it appears in
   52 |         UTIL_CAT(PM_, UTIL_CAT(UTIL_CAT(PM_, UTIL_CAT(PM_ID(label), _LABEL)), x))
      |                  ^~~
C:/workspaces/firmware-ng/zephyr/include/zephyr/sys/util_internal.h:105:36: note: in definition of macro 'UTIL_PRIMITIVE_CAT'     
  105 | #define UTIL_PRIMITIVE_CAT(a, ...) a##__VA_ARGS__
      |                                    ^
C:/workspaces/firmware-ng/nrf/include/flash_map_pm.h:52:9: note: in expansion of macro 'UTIL_CAT'
   52 |         UTIL_CAT(PM_, UTIL_CAT(UTIL_CAT(PM_, UTIL_CAT(PM_ID(label), _LABEL)), x))
      |         ^~~~~~~~
C:/workspaces/firmware-ng/nrf/include/flash_map_pm.h:55:39: note: in expansion of macro 'FIXED_PARTITION_DATA_FIELD'
   55 | #define FIXED_PARTITION_OFFSET(label) FIXED_PARTITION_DATA_FIELD(label, _OFFSET)
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
C:/workspaces/firmware-ng/firmware-zephyr/applications/label/src/subsys/flash/flash_storage.c:13:45: note: in expansion of macro  
FIXED_PARTITION_OFFSET'
   13 | #define STORAGE_PARTITION_OFFSET            FIXED_PARTITION_OFFSET(STORAGE_PARTITION)
      |                                             ^~~~~~~~~~~~~~~~~~~~~~
C:/workspaces/firmware-ng/firmware-zephyr/applications/label/src/subsys/flash/flash_storage.c:192:32: note: in expansion of macro 'STORAGE_PARTITION_OFFSET'
  192 |     ctx.buffer.config.offset = STORAGE_PARTITION_OFFSET;
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~
C:/workspaces/firmware-ng/nrf/include/flash_map_pm.h:52:18: error: 'PM_PM_PM_storage_partition_ID_LABEL_SIZE' undeclared (first use in this function)
   52 |         UTIL_CAT(PM_, UTIL_CAT(UTIL_CAT(PM_, UTIL_CAT(PM_ID(label), _LABEL)), x))
      |                  ^~~
C:/workspaces/firmware-ng/zephyr/include/zephyr/sys/util_internal.h:105:36: note: in definition of macro 'UTIL_PRIMITIVE_CAT'     
  105 | #define UTIL_PRIMITIVE_CAT(a, ...) a##__VA_ARGS__
      |                                    ^
C:/workspaces/firmware-ng/nrf/include/flash_map_pm.h:52:9: note: in expansion of macro 'UTIL_CAT'
   52 |         UTIL_CAT(PM_, UTIL_CAT(UTIL_CAT(PM_, UTIL_CAT(PM_ID(label), _LABEL)), x))
      |         ^~~~~~~~
C:/workspaces/firmware-ng/nrf/include/flash_map_pm.h:58:37: note: in expansion of macro 'FIXED_PARTITION_DATA_FIELD'
   58 | #define FIXED_PARTITION_SIZE(label) FIXED_PARTITION_DATA_FIELD(label, _SIZE)
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
C:/workspaces/firmware-ng/firmware-zephyr/applications/label/src/subsys/flash/flash_storage.c:14:45: note: in expansion of macro  
FIXED_PARTITION_SIZE'
   14 | #define STORAGE_PARTITION_SIZE              FIXED_PARTITION_SIZE(STORAGE_PARTITION)
      |                                             ^~~~~~~~~~~~~~~~~~~~
C:/workspaces/firmware-ng/firmware-zephyr/applications/label/src/subsys/flash/flash_storage.c:193:30: note: in expansion of macro 'STORAGE_PARTITION_SIZE'
  193 |     ctx.buffer.config.size = STORAGE_PARTITION_SIZE;
      |                              ^~~~~~~~~~~~~~~~~~~~~~

Parents
  • Hi, 

    Without Sysbuild and single image build, the Partition Manager was not used, meaning the DTS partition was used.

    With Sysbuild the partition manager has likely been enabled, and the user must use the partition manager for their partition

    Which type of file system are you using?

    Regards,
    Amanda H. 

  • Hi Amanda ! We do not use a filesystem, we directly use flash driver to read/write the partition

  • Hi Amanda, I went a bit farer in my investigations, I now manage to compile my code in sysbuild, but I need to remove these 2 macro calls:

    FIXED_PARTITION_OFFSET(STORAGE_PARTITION)
    FIXED_PARTITION_SIZE(STORAGE_PARTITION)
    These macros are correct in flash_map.h, but cannot be resolved using flash_map_pm.h.
    I also ran the partition manager report, everything seems now correctly set:
      flash_primary (0x80000 - 512kB):
    +----------------------------------------------+
    | 0x0: app (0x60000 - 384kB)                   |
    | 0x60000: asset_partition (0x1000 - 4kB)      |
    | 0x61000: storage_partition (0x1f000 - 124kB) |
    +----------------------------------------------+

      sram_primary (0xf400 - 61kB):
    +------------------------------------------+
    | 0x20000000: sram_primary (0xf400 - 61kB) |
    +------------------------------------------+
Reply
  • Hi Amanda, I went a bit farer in my investigations, I now manage to compile my code in sysbuild, but I need to remove these 2 macro calls:

    FIXED_PARTITION_OFFSET(STORAGE_PARTITION)
    FIXED_PARTITION_SIZE(STORAGE_PARTITION)
    These macros are correct in flash_map.h, but cannot be resolved using flash_map_pm.h.
    I also ran the partition manager report, everything seems now correctly set:
      flash_primary (0x80000 - 512kB):
    +----------------------------------------------+
    | 0x0: app (0x60000 - 384kB)                   |
    | 0x60000: asset_partition (0x1000 - 4kB)      |
    | 0x61000: storage_partition (0x1f000 - 124kB) |
    +----------------------------------------------+

      sram_primary (0xf400 - 61kB):
    +------------------------------------------+
    | 0x20000000: sram_primary (0xf400 - 61kB) |
    +------------------------------------------+
Children
Related