Migrating nRF53 Zigbee project to nRF54 results in ZBOSS errors

Hi,

I try to migrate a working nRF53 Zigbee project from SDK 2.7 to the latest SDK and an nRF54. As described here, I also switched to Zigbee R23. The project structure is shown below.

But the build exit with the error message

C:/Users/konta/Desktop/BeeLight/firmware/ncs-zigbee/subsys/osif/zb_nrf_nvram.c:16:32: error: 'PM_ZBOSS_NVRAM_SIZE' undeclared here (not in a function); did you mean 'PM_SRAM_SIZE'?
   16 | #define ZBOSS_NVRAM_PAGE_SIZE (PM_ZBOSS_NVRAM_SIZE / CONFIG_ZIGBEE_NVRAM_PAGE_COUNT)
      |                                ^~~~~~~~~~~~~~~~~~~
C:/Users/konta/Desktop/BeeLight/firmware/zephyr/include/zephyr/toolchain/gcc.h:87:52: note: in definition of macro 'BUILD_ASSERT'
   87 | #define BUILD_ASSERT(EXPR, MSG...) _Static_assert((EXPR), "" MSG)
      |                                                    ^~~~
C:/Users/konta/Desktop/BeeLight/firmware/ncs-zigbee/subsys/osif/zb_nrf_nvram.c:18:15: note: in expansion of macro 'ZBOSS_NVRAM_PAGE_SIZE'
   18 | BUILD_ASSERT((ZBOSS_NVRAM_PAGE_SIZE % PHYSICAL_PAGE_SIZE) == 0,
      |               ^~~~~~~~~~~~~~~~~~~~~
C:/Users/konta/Desktop/BeeLight/firmware/zephyr/include/zephyr/toolchain/gcc.h:87:51: error: expression in static assertion is not an integer
   87 | #define BUILD_ASSERT(EXPR, MSG...) _Static_assert((EXPR), "" MSG)
      |                                                   ^
C:/Users/konta/Desktop/BeeLight/firmware/ncs-zigbee/subsys/osif/zb_nrf_nvram.c:18:1: note: in expansion of macro 'BUILD_ASSERT'
   18 | BUILD_ASSERT((ZBOSS_NVRAM_PAGE_SIZE % PHYSICAL_PAGE_SIZE) == 0,
      | ^~~~~~~~~~~~
C:/Users/konta/Desktop/BeeLight/firmware/ncs-zigbee/subsys/osif/zb_nrf_nvram.c: In function 'zb_osif_nvram_init':
C:/Users/konta/Desktop/BeeLight/firmware/ncs-zigbee/subsys/osif/zb_nrf_nvram.c:39:31: error: 'PM_ZBOSS_NVRAM_ID' undeclared (first use in this function)
   39 |         ret = flash_area_open(PM_ZBOSS_NVRAM_ID, &fa);
      |                               ^~~~~~~~~~~~~~~~~
C:/Users/konta/Desktop/BeeLight/firmware/ncs-zigbee/subsys/osif/zb_nrf_nvram.c:39:31: note: each undeclared identifier is reported only once for each function it appears in
C:/Users/konta/Desktop/BeeLight/firmware/ncs-zigbee/subsys/osif/zb_nrf_nvram.c:45:31: error: 'PM_ZBOSS_PRODUCT_CONFIG_ID' undeclared (first use in this function)
   45 |         ret = flash_area_open(PM_ZBOSS_PRODUCT_CONFIG_ID, &fa_pc);
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/konta/Desktop/BeeLight/firmware/ncs-zigbee/subsys/osif/zb_nrf_nvram.c: In function 'zb_get_nvram_page_length':
C:/Users/konta/Desktop/BeeLight/firmware/ncs-zigbee/subsys/osif/zb_nrf_nvram.c:55:1: warning: control reaches end of non-void function [-Wreturn-type]
   55 | }
      | ^
[449/492] Building C object modules/nrfxlib/nrf_802154/nrf_802154/driver/CMakeFiles/nrf-802154-driver.dir/src/nrf_802154_trx_dppi.c.obj

What causes this issue and how can I fix it?

Parents
  • Hi,

    Did you also follow the steps in the migration guides from 2.7.0 and incrementally up to 3.0.1 i.e https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/releases_and_maturity/migration_guides.html with emphasis on https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/releases_and_maturity/migration/migration_sysbuild.html if you're coming from child/parent images?

    If you're unsure about the sysbuild migration, what does your project folder look like? Are you using child images or sysbuild? https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-8-sysbuild/topic/sysbuild-explained/ 

    Kind regards,
    Andreas

  • Hi,

    thanks to the answer. The project is built with Sysbuild and when removing Zigbee from the project, the build runs smoothly.

    I´ve pushed the latest version of the project to my GitHub so you can see the structure:

    github.com/.../firmware

  • Hi Andreas,

    It was a bit painful and caused me a lot of gray hairs, but I´ve tested different things.

    1. I run "west init -m "">github.com/.../ncs-zigbee" --mr main" to get the Zigbee stuff
    2. I´ve put my project into the "samples" directory and changed the layout to match the light bulb example
    3. I´ve compiled the light bulb example for the nrf54l15 (successfully)

    rm -rf build && west build -b nrf54l15dk/nrf54l15/cpuapp --force -p

    4. I´ve compiled my code for my board (the custom board makes issues -> will fix it later)

    rm -rf build && west build -b beelight@1/nrf54l15/cpuapp -- -DBOARD_ROOT="."

    I´ve figured out that the APDS9306 driver is not available in this Zephyr version (v2.9.0). An upgrade to v3.0.1 causes the light bulb example not to build -> will fix it later. I disabled BSEC and the light sensor for now

    5. Compiling my application is successful now

    Questions:
    1. How can I use this ncs-zigbee in my project (I. e. checking it out with west)? I want to have my app ("beelight") with the right ncs and ncs-zigbee structure with BSEC according to the Nordic guide. Maybe by forking "ncs-zigbee" and adding everything to the west.yml?

    2. Is it possible to upgrade to NCS 3.0.1? I get this error at the moment when switching to NCS 3.0.1

    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/Users/konta/Downloads/zigbee/ncs-zigbee/samples/beelight
    -- CMake version: 3.27.6
    -- Found Python3: C:/Users/konta/.platformio/penv/Scripts/python.exe (found suitable version "3.11.7", minimum required is "3.10") found components: Interpreter
    -- Cache files will be written to: C:/Users/konta/Downloads/zigbee/zephyr/.cache
    -- Zephyr version: 4.0.99 (C:/Users/konta/Downloads/zigbee/zephyr)
    -- Found west (found suitable version "1.3.0", minimum required is "0.14.0")
    -- Board: beelight, Revision: 1, qualifiers: nrf54l15/cpuapp
    -- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
    CMake Error at C:/Users/konta/Downloads/zigbee/zephyr/cmake/modules/FindZephyr-sdk.cmake:159 (find_package):
      Could not find a package configuration file provided by "Zephyr-sdk"
      (requested version 0.16) with any of the following names:
    
        Zephyr-sdkConfig.cmake
        zephyr-sdk-config.cmake
    
      Add the installation prefix of "Zephyr-sdk" to CMAKE_PREFIX_PATH or set
      "Zephyr-sdk_DIR" to a directory containing one of the above files.  If
      "Zephyr-sdk" provides a separate development package or SDK, be sure it has
      been installed.
    Call Stack (most recent call first):
      C:/Users/konta/Downloads/zigbee/zephyr/cmake/modules/FindHostTools.cmake:53 (find_package)
      C:/Users/konta/Downloads/zigbee/zephyr/cmake/modules/dts.cmake:9 (find_package)
      C:/Users/konta/Downloads/zigbee/zephyr/cmake/modules/zephyr_default.cmake:133 (include)
      C:/Users/konta/Downloads/zigbee/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      C:/Users/konta/Downloads/zigbee/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      CMakeLists.txt:3 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    CMake Error at cmake/modules/sysbuild_extensions.cmake:514 (message):
      CMake configure failed for Zephyr project: beelight
    
      Location: C:/Users/konta/Downloads/zigbee/ncs-zigbee/samples/beelight
    Call Stack (most recent call first):
      cmake/modules/sysbuild_images.cmake:43 (ExternalZephyrProject_Cmake)
      cmake/modules/sysbuild_default.cmake:21 (include)
      C:/Users/konta/Downloads/zigbee/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
      C:/Users/konta/Downloads/zigbee/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      C:/Users/konta/Downloads/zigbee/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
      template/CMakeLists.txt:10 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    FATAL ERROR: command exited with status 1: 'C:\Program Files\CMake\bin\cmake.EXE' -DWEST_PYTHON=C:/Users/konta/.platformio/penv/Scripts/python.exe '-BC:\Users\konta\Downloads\zigbee\ncs-zigbee\samples\beelight\build' -GNinja -DBOARD=beelight@1/nrf54l15/cpuapp -DBOARD_ROOT=. '-SC:\Users\konta\Downloads\zigbee\zephyr\share\sysbuild' '-DAPP_DIR:PATH=C:\Users\konta\Downloads\zigbee\ncs-zigbee\samples\beelight'
    

    -> Solved. For some reason, the build after an upgrade to NCS 3.0.1 is working in VS Code. I changed the version in the west.yml of ncs-zigbee to v3.0.1, ran west update, restarted code, and built everything

  • Hi Andreas,

    Another update:
    I´ve got everything working so far (BSEC, NCS 3.0.1, Zigbee), and I´ve changed the directory structure to this.

    Now I have to work on the west.yml file for my application to initialize everything correctly.

  • Hi again,

    I see that you've had some progress here with customizing, but I may have some news that could either be good or bad for you. 

    I had a chat with one of the Zigbee devs and I might have a few pointers.

    The idea behind the addon is to an extension to NCS, but it is not flexible in a sense that you can whatever ncs version you would like to. You will have to use a certain NCS release together with the Addon that is only meant to be compatible with a given  ZBOSS stack version and NCP host version. There may be options to customize this more later, but for now what we support is only what is mentioned here: https://docs.nordicsemi.com/bundle/addon-zigbee-r23-latest/page/release-notes.html 

    This means that the support for v3.0.1 is not within the supported list of SDK versions that we support fwith R23. This does also mean that taking an addon from NCS v3.0.1 will most likely not compile or work together with R23 out of the box.

    I'm sorry for not mentioning this earlier. The addon-system is also relatively new for me.

    In other words, the first item that I was recommended to relay to you is to make sure that you're using compatible versions of the SDK, addon and to follow the setup steps there.

    The second item is to continue with the Zigbee Template sample and to add your application step by step on top of the template for your board.

    Kind regards,
    Andreas

  • Hi Andreas,

    thanks for the effort. I will try it with v2.9.0 now, at least until I got Zigbee running (I also have this issue: nRF54L Zigbee R23 production configuration understanding issues . The sensor drivers doesn´t care for now because I have to patch the light sensor driver anyway, so I can use a patch to add it.

    But the code is compiling without any issues now. So I think the structure of the project is good. I´ve created the structure based on the template project by adding my code as an additional template and then moving everything around and changing the configuration files accordingly. The result was always the same.

  • Hi Andreas,

    update: Thanks to Marte (see the other thread), flashing of the Zigbee config is successful now, and this results in a successful join attempt (the data aren´t correct atm, but doesn´t care for now):

    The device is leaving the network after a short time. I think because of the wrong data...

Reply Children
Related