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,

    I use a pre built module from Ezurio and not the blank chip. So I'm pretty sure that the chip is not an engineering sample. 

  • Noted,

    Unfortunately I don't think there's more I can do here other than suggesting things for you to look closer into. Debugging this requires getting your hands dirty and porting from a SDK version using HWm1 and child/parent images to a SDK version using hwm and sysbuild as well as migrating from a 5340 to the 54l15.

    But, the errors seems to be related to this:

    • Since your project comes from a 5340 project, the flash page configurations are different than for your 54l15 project
    • 54L15 uses RRAM and not Flash, might be an error related to settings
    • The 5340 might have custom configurations specific to that board
      • The partitioning layout might be tailored to the 5340

    The best suggestion I can give you is

    1. Get a sample working for the nRF54L15DK
    2. Get your sample working for the nRF54L15DK
      1. Isolate if the issues are wr.t SDK versions, custom drivers, the board files or other
      2. Verify that the partitoning
    Kampino said:
    I haven´t tested it with a DK because I don´t have one. But the board I´ve created is based on the nRF54DK (I basically changed the name and add the Zigbee stuff to it) so I think the result should be the same. But I can test it later if you want.

    W.r.t migrating a template sample from 2.7.0 to R23 and NCS v3.0.0 you can do this:

    1. Create a nrf54l15dk_nrf54l15_cpuapp.overlay (copy it directly from the template sample in R23)
    2. Remove this from prj.conf:
      # Enable nRF ECB driver
      CONFIG_CRYPTO=y
      CONFIG_CRYPTO_NRF_ECB=y
      CONFIG_CRYPTO_INIT_PRIORITY=80
    3. Change CONFIG_ZIGBEE=y to CONFIG_ZIGBEE_ADD_ON=y

    Again, apologies for not being able to point to anything specific.

    Kind regards,
    Andreas

  • 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

Reply
  • 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

Children
  • 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...

  • Kampino said:
    I will try it with v2.9.0 now,

    Allright, let me know if there's still any issues and we'll have a look

    Kampino said:
    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.

    Great! Glad to hear that

    Kind regards,
    Andreas

  • Hi Andreas,

    my device is reporting this when connecting with Zigbee2Mqtt:

    00> [00:06:02.442,995] <inf> zigbee_app_utils: Unimplemented signal (signal: 56, status: 0

    Signal 56 is documented as "ZB_SIGNAL_JOIN_DONE 56U" and I´m curious why this signal is missing. I can´t get my device to stay in the network. It always joining and leaving the network.

  • Hi  

    I found the issue. I must add the install code to Zigbee2Mqtt, but for some reason I can´t add a 16 byte code (I did it wrong probably...). So I disabled the install code in the config

    # Enable channel 11 and 16
    channel_mask: 0x10800
    #install_code: 83FED3407A939723A5C639B26916D505
    extended_address: 86D79AC5BAE41FA3
    tx_power: 9
    app_data: 01ABCD
    Can you tell me what this means?
    app_data: 01ABCD
    Does this number has a specific function or is it a dummy from the template?
Related