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
  • Hi, 

    I have tried to make some some additions in prj_usb.conf for light_switch example which is attached here.

    prj_usb.conf

    And also disabled the warning in the shell example as below

    prj_usb.conf

    Remember that you need to compile this two projects with 

    Then it seems to compile ok for me

    Sorry do not have to the time to test these changes in hardware.

  • Hi  !

    Thanks again for your reply

    With the board nrf52840dk/nrf52840 I can compile, but after uploading on my board, nothing happen... No error, no COM serial port appearing, nothing in HomeAssistant.

    So I tried to build with `nrf52840_mdk_usb_dongle`


    Unfortunately, with the board `nrf52840_mdk_usb_dongle` I have this issue:

    ```

    [421/424] Generating isr_tables.c, isr_tables_vt.ld, isr_tables_swi.ld
    FAILED: zephyr/isr_tables.c zephyr/isr_tables_vt.ld zephyr/isr_tables_swi.ld C:/ncs/v2.9.0/nrf/build/light_switch/zephyr/isr_tables.c C:/ncs/v2.9.0/nrf/build/light_switch/zephyr/isr_tables_vt.ld C:/ncs/v2.9.0/nrf/build/light_switch/zephyr/isr_tables_swi.ld
    cmd.exe /C "cd /D C:\ncs\v2.9.0\nrf\build\light_switch\zephyr && C:\ncs\toolchains\b620d30767\opt\bin\python.exe C:/ncs/v2.9.0/zephyr/scripts/build/gen_isr_tables.py --output-source isr_tables.c --linker-output-files isr_tables_vt.ld isr_tables_swi.ld --kernel C:/ncs/v2.9.0/nrf/build/light_switch/zephyr/zephyr_pre0.elf --intlist-section .intList --intlist-section intList --sw-isr-table --vector-table"
    gen_isr_tables.py: error: multiple registrations at table_index 39 for irq 39 (0x27)
    Existing handler 0x4f9b3, new handler 0x4f9b3
    Has IRQ_CONNECT or IRQ_DIRECT_CONNECT accidentally been invoked on the same irq multiple times?

    ninja: build stopped: subcommand failed.
    FAILED: _sysbuild/sysbuild/images/light_switch-prefix/src/light_switch-stamp/light_switch-build C:/ncs/v2.9.0/nrf/build/_sysbuild/sysbuild/images/light_switch-prefix/src/light_switch-stamp/light_switch-build
    cmd.exe /C "cd /D C:\ncs\v2.9.0\nrf\build\light_switch && C:\ncs\toolchains\b620d30767\opt\bin\cmake.exe --build ."
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\b620d30767\opt\bin\cmake.EXE' --build C:/ncs/v2.9.0/nrf/build

    ```

    I Googled quickly and added following line to prj_usb.conf:

    CONFIG_SHARED_INTERRUPTS=y

    And then had this error:

    ```

    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/ncs/v2.9.0/nrf/build/light_switch
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/ncs/v2.9.0/nrf/build
    ←[92m-- west build: building application
    [5/10] Performing build step for 'light_switch'

    [4/425] Generating include/generated/zephyr/version.h
    -- Zephyr version: 3.7.99 (C:/ncs/v2.9.0/zephyr), build: v3.7.99-ncs2
    [422/425] Generating isr_tables.c, isr_tables_vt.ld, isr_tables_swi.ld
    FAILED: zephyr/isr_tables.c zephyr/isr_tables_vt.ld zephyr/isr_tables_swi.ld C:/ncs/v2.9.0/nrf/build/light_switch/zephyr/isr_tables.c C:/ncs/v2.9.0/nrf/build/light_switch/zephyr/isr_tables_vt.ld C:/ncs/v2.9.0/nrf/build/light_switch/zephyr/isr_tables_swi.ld
    cmd.exe /C "cd /D C:\ncs\v2.9.0\nrf\build\light_switch\zephyr && C:\ncs\toolchains\b620d30767\opt\bin\python.exe C:/ncs/v2.9.0/zephyr/scripts/build/gen_isr_tables.py --output-source isr_tables.c --linker-output-files isr_tables_vt.ld isr_tables_swi.ld --kernel C:/ncs/v2.9.0/nrf/build/light_switch/zephyr/zephyr_pre0.elf --intlist-section .intList --intlist-section intList --sw-isr-table --vector-table"
    gen_isr_tables.py: error: Attempting to register the same ISR/arg pair twice.

    ninja: build stopped: subcommand failed.
    FAILED: _sysbuild/sysbuild/images/light_switch-prefix/src/light_switch-stamp/light_switch-build C:/ncs/v2.9.0/nrf/build/_sysbuild/sysbuild/images/light_switch-prefix/src/light_switch-stamp/light_switch-build
    cmd.exe /C "cd /D C:\ncs\v2.9.0\nrf\build\light_switch && C:\ncs\toolchains\b620d30767\opt\bin\cmake.exe --build ."
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\b620d30767\opt\bin\cmake.EXE' --build C:/ncs/v2.9.0/nrf/build

    (v2.9.0) C:\ncs\v2.9.0\nrf>

    ```

  • The MakerDiary nrf52840_mdk_usb_dongle board configuration you are compiling for does not activate the Zigbee stack. Consequently samples/zigbee/shell fails in Kconfig with the error " symbol ZIGBEE…​”: the board does not choose the IEEE 802.15.4 radio nor the Nordic Zigbee elements therefore those symbols are absent.

    When switching to the Nordic Connect SDK  and compiling the Zigbee shell, with the Nordic nrf52840dongle_nrf52840 board (west build -b nrf52840dongle_nrf52840 nrf/samples/zigbee/shell) the build finishes successfully since that board configuration already includes ZBOSS and the 15.4 driver.

    If you prefer to stay on the MakerDiary board, you will need to clone/override it in your tree and add the missing capabilities like set CONFIG_HAS_HW_NRFIEEE802154=y, pull in the Zigbee defconfig snippets, make sure the pin mapping matches the dongle. Without that, any Zigbee sample might be stopping at Kconfig because the required subsystem is never enabled for that board.

Reply
  • The MakerDiary nrf52840_mdk_usb_dongle board configuration you are compiling for does not activate the Zigbee stack. Consequently samples/zigbee/shell fails in Kconfig with the error " symbol ZIGBEE…​”: the board does not choose the IEEE 802.15.4 radio nor the Nordic Zigbee elements therefore those symbols are absent.

    When switching to the Nordic Connect SDK  and compiling the Zigbee shell, with the Nordic nrf52840dongle_nrf52840 board (west build -b nrf52840dongle_nrf52840 nrf/samples/zigbee/shell) the build finishes successfully since that board configuration already includes ZBOSS and the 15.4 driver.

    If you prefer to stay on the MakerDiary board, you will need to clone/override it in your tree and add the missing capabilities like set CONFIG_HAS_HW_NRFIEEE802154=y, pull in the Zigbee defconfig snippets, make sure the pin mapping matches the dongle. Without that, any Zigbee sample might be stopping at Kconfig because the required subsystem is never enabled for that board.

Children
No Data
Related