Cannot make Zigbee sample working with nrf52840_mdk_usb_dongle

Hello dear community!

Few months ago I bought a NRF52840 from MakerDiary (https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/) for a personal project arounf Zigbee

Weeks ago I reached this site about difficulties to set up environnement to program nrf52840.
I'm now able to setup a stable environnement, but I'm stuck with building sample to experiment Zigbee protocol.


I can build firmware for hello world, blinky and so on with the command (please note the board's name, I had to change it even if the documentation mentionned another board):
west build -p always -b nrf52840_mdk_usb_dongle samples/hello_world

But when I tried this one:
west build -p always -b nrf52840_mdk_usb_dongle samples/zigbee/shell

I had many errors (please find them below). It seems that these samples are note fully configured to work with nrf52840_mdk_usb_dongle board?

Would you mind to help me solving this issue? I think i'm lake of skills about configuring Zephyr or whatever... I'm confused with all documentation and very lost :(

Thanks,




######## LOG ERROR FOR nrf52840_mdk_usb_dongle WITH SAMPLE ZIGBEE/SHELL ########


$ west build -p always -b nrf52840_mdk_usb_dongle samples/zigbee/shell
-- west build: making build dir /home/greg/Documents/distro-pyhton-home/my-workspace/ncs-playground/build pristine
-- west build: generating a build system
Loading Zephyr module(s) (Zephyr base): sysbuild_default
-- Found Python3: /run/host/var/home/greg/venv/bin/python3 (found suitable version "3.12.3", minimum required is "3.10") found components: Interpreter
-- Cache files will be written to: /var/home/greg/Documents/distro-pyhton-home/.cache/zephyr
-- Found west (found suitable version "1.5.0", minimum required is "0.14.0")
-- Board: nrf52840_mdk_usb_dongle, qualifiers: nrf52840
Parsing /home/greg/Documents/distro-pyhton-home/my-workspace/zephyr/share/sysbuild/Kconfig
Loaded configuration '/home/greg/Documents/distro-pyhton-home/my-workspace/ncs-playground/build/_sysbuild/empty.conf'
Merged configuration '/home/greg/Documents/distro-pyhton-home/my-workspace/ncs-playground/build/_sysbuild/empty.conf'
Configuration saved to '/home/greg/Documents/distro-pyhton-home/my-workspace/ncs-playground/build/zephyr/.config'
Kconfig header saved to '/home/greg/Documents/distro-pyhton-home/my-workspace/ncs-playground/build/_sysbuild/autoconf.h'
--
***************************
* Running CMake for shell *
***************************

Loading Zephyr default modules (Zephyr base).
-- Application: /home/greg/Documents/distro-pyhton-home/my-workspace/ncs-playground/samples/zigbee/shell
-- CMake version: 4.1.2
-- Found Python3: /run/host/var/home/greg/venv/bin/python (found suitable version "3.12.3", minimum required is "3.10") found components: Interpreter
-- Cache files will be written to: /var/home/greg/Documents/distro-pyhton-home/.cache/zephyr
-- Zephyr version: 4.2.99 (/home/greg/Documents/distro-pyhton-home/my-workspace/zephyr)
-- Found west (found suitable version "1.5.0", minimum required is "0.14.0")
-- Board: nrf52840_mdk_usb_dongle, qualifiers: nrf52840
-- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
-- Found host-tools: zephyr 0.16.1 (/var/home/greg/Documents/distro-pyhton-home/zephyr-sdk-0.16.1)
-- Found toolchain: zephyr 0.16.1 (/var/home/greg/Documents/distro-pyhton-home/zephyr-sdk-0.16.1)
-- Found Dtc: /var/home/greg/Documents/distro-pyhton-home/zephyr-sdk-0.16.1/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.6.0", minimum required is "1.4.6")
-- Found BOARD.dts: /home/greg/Documents/distro-pyhton-home/my-workspace/zephyr/boards/makerdiary/nrf52840_mdk_usb_dongle/nrf52840_mdk_usb_dongle.dts
-- Generated zephyr.dts: /home/greg/Documents/distro-pyhton-home/my-workspace/ncs-playground/build/shell/zephyr/zephyr.dts
-- Generated pickled edt: /home/greg/Documents/distro-pyhton-home/my-workspace/ncs-playground/build/shell/zephyr/edt.pickle
-- Generated devicetree_generated.h: /home/greg/Documents/distro-pyhton-home/my-workspace/ncs-playground/build/shell/zephyr/include/generated/zephyr/devicetree_generated.h

warning: LOG_PROCESS_THREAD_STARTUP_DELAY_MS (defined at
boards/common/usb/Kconfig.cdc_acm_serial.defconfig:43, subsys/logging/Kconfig.processing:64) was
assigned the value '1000' but got the value ''. Check these unsatisfied dependencies: ((LOG &&
BOARD_SERIAL_BACKEND_CDC_ACM && BOARD_NRF52840_MDK_USB_DONGLE) || (LOG_PROCESS_THREAD &&
LOG_MODE_DEFERRED && !LOG_FRONTEND_ONLY && !LOG_MODE_MINIMAL && LOG)) (=n). See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_LOG_PROCESS_THREAD_STARTUP_DELAY_MS and/or
look up LOG_PROCESS_THREAD_STARTUP_DELAY_MS in the menuconfig/guiconfig interface. The Application
Development Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices sections of
the manual might be helpful too.


warning: LOG_PROCESS_THREAD_STACK_SIZE (defined at soc/nordic/nrf54h/Kconfig.defconfig:45,
subsys/logging/Kconfig.processing:78) was assigned the value '1024' but got the value ''. Check
these unsatisfied dependencies: ((LOG && PM && SOC_SERIES_NRF54HX && SOC_FAMILY_NORDIC_NRF) ||
(LOG_PROCESS_THREAD && LOG_MODE_DEFERRED && !LOG_FRONTEND_ONLY && !LOG_MODE_MINIMAL && LOG)) (=n).
See http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_LOG_PROCESS_THREAD_STACK_SIZE and/or
look up LOG_PROCESS_THREAD_STACK_SIZE in the menuconfig/guiconfig interface. The Application
Development Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices sections of
the manual might be helpful too.


warning: LOG_BUFFER_SIZE (defined at /home/greg/Documents/distro-pyhton-home/my-
workspace/nrf/modules/../subsys/net/openthread/Kconfig.defconfig:118,
subsys/logging/Kconfig.processing:121) was assigned the value '4096' but got the value ''. Check
these unsatisfied dependencies: (OPENTHREAD || (LOG_MODE_DEFERRED && !LOG_FRONTEND_ONLY &&
!LOG_MODE_MINIMAL && LOG)) (=n). See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_LOG_BUFFER_SIZE and/or look up
LOG_BUFFER_SIZE in the menuconfig/guiconfig interface. The Application Development Primer, Setting
Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful
too.


warning: LOG_CMDS (defined at subsys/logging/Kconfig.misc:6) was assigned the value 'y' but got the
value 'n'. Check these unsatisfied dependencies: SHELL (=n), LOG (=n). See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_LOG_CMDS and/or look up LOG_CMDS in the
menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration Values,
and Kconfig - Tips and Best Practices sections of the manual might be helpful too.


warning: SHELL_BACKEND_SERIAL_RX_RING_BUFFER_SIZE (defined at
subsys/shell/backends/Kconfig.backends:89) was assigned the value '128' but got the value ''. Check
these unsatisfied dependencies: (SHELL_BACKEND_SERIAL_API_INTERRUPT_DRIVEN ||
SHELL_BACKEND_SERIAL_API_POLLING) (=n), SHELL_BACKEND_SERIAL (=n), SHELL_BACKENDS (=n), SHELL (=n).
See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_SHELL_BACKEND_SERIAL_RX_RING_BUFFER_SIZE
and/or look up SHELL_BACKEND_SERIAL_RX_RING_BUFFER_SIZE in the menuconfig/guiconfig interface. The
Application Development Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices
sections of the manual might be helpful too.


warning: The choice symbol LOG_MODE_DEFERRED (defined at subsys/logging/Kconfig.mode:11) was
selected (set =y), but no symbol ended up as the choice selection. See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_LOG_MODE_DEFERRED and/or look up
LOG_MODE_DEFERRED in the menuconfig/guiconfig interface. The Application Development Primer, Setting
Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful
too.


/home/greg/Documents/distro-pyhton-home/my-workspace/ncs-playground/samples/zigbee/shell/prj.conf:26: warning: attempt to assign the value 'y' to the undefined symbol ZIGBEE

/home/greg/Documents/distro-pyhton-home/my-workspace/ncs-playground/samples/zigbee/shell/prj.conf:27: warning: attempt to assign the value 'y' to the undefined symbol ZIGBEE_APP_UTILS

/home/greg/Documents/distro-pyhton-home/my-workspace/ncs-playground/samples/zigbee/shell/prj.conf:28: warning: attempt to assign the value 'y' to the undefined symbol ZIGBEE_ROLE_ROUTER

/home/greg/Documents/distro-pyhton-home/my-workspace/ncs-playground/samples/zigbee/shell/prj.conf:47: warning: attempt to assign the value 'y' to the undefined symbol ZIGBEE_SHELL

/home/greg/Documents/distro-pyhton-home/my-workspace/ncs-playground/samples/zigbee/shell/prj.conf:48: warning: attempt to assign the value 'y' to the undefined symbol ZIGBEE_SHELL_DEBUG_CMD

/home/greg/Documents/distro-pyhton-home/my-workspace/ncs-playground/samples/zigbee/shell/prj.conf:49: warning: attempt to assign the value '64' to the undefined symbol ZIGBEE_SHELL_ENDPOINT
Parsing /home/greg/Documents/distro-pyhton-home/my-workspace/zephyr/Kconfig
Loaded configuration '/home/greg/Documents/distro-pyhton-home/my-workspace/zephyr/boards/makerdiary/nrf52840_mdk_usb_dongle/nrf52840_mdk_usb_dongle_defconfig'
Merged configuration '/home/greg/Documents/distro-pyhton-home/my-workspace/ncs-playground/samples/zigbee/shell/prj.conf'
Merged configuration '/home/greg/Documents/distro-pyhton-home/my-workspace/ncs-playground/build/shell/zephyr/.config.sysbuild'

error: Aborting due to Kconfig warnings

CMake Error at /home/greg/Documents/distro-pyhton-home/my-workspace/zephyr/cmake/modules/kconfig.cmake:387 (message):
command failed with return code: 1
Call Stack (most recent call first):
/home/greg/Documents/distro-pyhton-home/my-workspace/nrf/cmake/modules/kconfig.cmake:94 (include)
/home/greg/Documents/distro-pyhton-home/my-workspace/zephyr/cmake/modules/zephyr_default.cmake:131 (include)
/home/greg/Documents/distro-pyhton-home/my-workspace/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
/home/greg/Documents/distro-pyhton-home/my-workspace/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
CMakeLists.txt:9 (find_package)


-- Configuring incomplete, errors occurred!
CMake Error at cmake/modules/sysbuild_extensions.cmake:531 (message):
CMake configure failed for Zephyr project: shell

Location:
/home/greg/Documents/distro-pyhton-home/my-workspace/ncs-playground/samples/zigbee/shell
Call Stack (most recent call first):
cmake/modules/sysbuild_images.cmake:43 (ExternalZephyrProject_Cmake)
cmake/modules/sysbuild_default.cmake:21 (include)
/home/greg/Documents/distro-pyhton-home/my-workspace/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
/home/greg/Documents/distro-pyhton-home/my-workspace/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
/home/greg/Documents/distro-pyhton-home/my-workspace/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: /usr/bin/cmake -DWEST_PYTHON=/run/host/var/home/greg/venv/bin/python3 -B/home/greg/Documents/distro-pyhton-home/my-workspace/ncs-playground/build -GNinja -DBOARD=nrf52840_mdk_usb_dongle -S/home/greg/Documents/distro-pyhton-home/my-workspace/zephyr/share/sysbuild -DAPP_DIR:PATH=/home/greg/Documents/distro-pyhton-home/my-workspace/ncs-playground/samples/zigbee/shell

Parents Reply Children
  • Hello  !

    Thanks for your answer!

    I tried several SDK:

    Each time basic sample are ok (blinking, hello world), but as soon as I'm trying more advanced sample I'm stuck (I think) in board configuration (cmake and so on...).  

    The one I copy/paste above is ncs-playground (normally official one).

    But I could give another try to nRF Connect SDKv2.9.0 and make a feedback to you Thumbsup tone2

    Thanks and have a nice day! 

  • ncs-playground is not official repos. They are experimental as the name suggests (playground)

    GTG said:
    But I could give another try to nRF Connect SDKv2.9.0 and make a feedback to you Thumbsup tone2

    Thanks  please do so :)

  • Hi  !

    I successful build the zigbee/shell sample! Below this message my full fresh install and build commands

    But once uploaded on my nrf52840 board I have no idea of next steps with this new firmware... I cannot play with the button, it's not discovered by my HomeAssistant...

    Anyway, I decided to build the light_switch sample:

    west build -p always -b nrf52840_mdk_usb_dongle nrf/samples/zigbee/light_switch -- -DFILE_SUFFIX=fota

    And it gave me this error:

    /var/home/greg/Documents/nordicsemi/nordichome/ncs/v2.9.0/nrf/subsys/zigbee/osif/zb_nrf_crypto.c:18:2: error: #error No crypto suite for Zigbee stack has been selected
       18 | #error No crypto suite for Zigbee stack has been selected
          |  ^~~~~
    /var/home/greg/Documents/nordicsemi/nordichome/ncs/v2.9.0/nrf/subsys/zigbee/osif/zb_nrf_crypto.c: In function 'zb_osif_aes128_hw_encrypt':
    /var/home/greg/Documents/nordicsemi/nordichome/ncs/v2.9.0/nrf/subsys/zigbee/osif/zb_nrf_crypto.c:112:9: warning: implicit declaration of function 'encrypt_aes' [-Wimplicit-function-declaration]
      112 |         encrypt_aes(key, msg, c);

    What do you think?

    Thanks!!

    .:: MY FRESH INSTALL ::.
    sudo chmod +x /appdata/nrfutil
    export PATH=$PATH/appdata
    sudo apt install ./JLink_Linux_V888_x86_64.deb
    sudo apt install ./nrf-udev_1.0.1-all.deb
    nrfutil install toolchain-manager
    nrfutil toolchain-manager install --ncs-version v2.9.0
    cd ncs/
    nrfutil toolchain-manager launch --shell
    cd /lib/x86_64-linux-gnu/
    sudo ln -sf libunistring.so libunistring.so.2
    cd
    west init -m github.com/.../sdk-nrf --mr v2.9.0 v2.9.0
    cd v2.9.0/
    west update
    west zephyr-export
    source zephyr/zephyr-env.sh
    python3 -m pip install --pre -U git+github.com/.../uf2utils.git@main
    west build -p always -b nrf52840_mdk_usb_dongle nrf/samples/zigbee/light_switch
    uf2conv -f 0xADA52840 -c -b 0x1000 -o shell.uf2 build/shell/zephyr/zephyr.bin
  • Can you show me your prj,conf for that sample? I tink you need to select a crypto backend for that sample. I think in the SDK version you are using, the sample does not automatically select that for you. Can you add this below in your light_switch sample prj.conf?

    CONFIG_NRF_SECURITY=y
    CONFIG_NRF_CC3XX_PLATFORM=y
    # or select oberon library that should work for 52840 CONFIG_NRF_OBERON=y
    

  • Hi  !

    Here is the prj.conf:

    #
    # Copyright (c) 2020 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    
    CONFIG_NCS_SAMPLES_DEFAULTS=y
    
    CONFIG_UART_INTERRUPT_DRIVEN=y
    CONFIG_SERIAL=y
    CONFIG_GPIO=y
    
    # Make sure printk is not printing to the UART console
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=y
    
    CONFIG_HEAP_MEM_POOL_SIZE=2048
    
    CONFIG_ZIGBEE=y
    CONFIG_ZIGBEE_APP_UTILS=y
    CONFIG_ZIGBEE_ROLE_END_DEVICE=y
    
    # Enable DK LED and Buttons library
    CONFIG_DK_LIBRARY=y
    
    # This example requires more workqueue stack
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    
    # Enable API for powering down unused RAM parts
    CONFIG_RAM_POWER_DOWN_LIBRARY=y
    
    # Networking
    CONFIG_NET_IPV6=n
    CONFIG_NET_IP_ADDR_CHECK=n
    CONFIG_NET_UDP=n
    

    I tired two time with adding

    CONFIG_NRF_SECURITY=y
    CONFIG_NRF_CC3XX_PLATFORM=y

    And then

    CONFIG_NRF_SECURITY=y
    CONFIG_NRF_CC3XX_PLATFORM=y
    CONFIG_NRF_OBERON=y
    

    But result is still this error:

    [...]
    /v2.9.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/var/home/greg/Documents/nordicsemi/nordichome/ncs/v2.9.0=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -Wno-packed-bitfield-compat -MD -MT modules/nrf/subsys/zigbee/CMakeFiles/..__nrf__subsys__zigbee.dir/osif/zb_nrf_crypto.c.obj -MF modules/nrf/subsys/zigbee/CMakeFiles/..__nrf__subsys__zigbee.dir/osif/zb_nrf_crypto.c.obj.d -o modules/nrf/subsys/zigbee/CMakeFiles/..__nrf__subsys__zigbee.dir/osif/zb_nrf_crypto.c.obj -c /var/home/greg/Documents/nordicsemi/nordichome/ncs/v2.9.0/nrf/subsys/zigbee/osif/zb_nrf_crypto.c
    /var/home/greg/Documents/nordicsemi/nordichome/ncs/v2.9.0/nrf/subsys/zigbee/osif/zb_nrf_crypto.c:18:2: error: #error No crypto suite for Zigbee stack has been selected
       18 | #error No crypto suite for Zigbee stack has been selected
          |  ^~~~~
    /var/home/greg/Documents/nordicsemi/nordichome/ncs/v2.9.0/nrf/subsys/zigbee/osif/zb_nrf_crypto.c: In function 'zb_osif_aes128_hw_encrypt':
    /var/home/greg/Documents/nordicsemi/nordichome/ncs/v2.9.0/nrf/subsys/zigbee/osif/zb_nrf_crypto.c:112:9: warning: implicit declaration of function 'encrypt_aes' [-Wimplicit-function-declaration]
      112 |         encrypt_aes(key, msg, c);
          |         ^~~~~~~~~~~
    [231/393] Building C object zephyr/drivers/serial/CMakeFiles/drivers__serial.dir/uart_nrfx_uarte.c.obj
    ninja: build stopped: subcommand failed.
    FAILED: _sysbuild/sysbuild/images/light_switch-prefix/src/light_switch-stamp/light_switch-build /var/home/greg/Documents/nordicsemi/nordichome/ncs/v2.9.0/build/_sysbuild/sysbuild/images/light_switch-prefix/src/light_switch-stamp/light_switch-build 
    cd /var/home/greg/Documents/nordicsemi/nordichome/ncs/v2.9.0/build/light_switch && /var/home/greg/Documents/nordicsemi/nordichome/ncs/toolchains/b77d8c1312/usr/local/bin/cmake --build .
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: /var/home/greg/Documents/nordicsemi/nordichome/ncs/toolchains/b77d8c1312/usr/local/bin/cmake --build /var/home/greg/Documents/nordicsemi/nordichome/ncs/v2.9.0/build

Related