Error while building the openthread\coprocessor project for nrf52840_dongle

Dear Nordic Support Team,

I wanted to configure the nRF52840 dongle as radio co-processor. For that I wanted to build and flash the Thread: Co-processor sample in nRF52840 dongle. But when I tried to build the sample I am getting the following error. 

Host platform: Mac OS

Zephyr version: 0.14.1

NCS Version: V2.1.0

Board: nrf52840dongle_nrf52840

-- Application: /Users/das/sdk-nrf/samples/openthread/coprocessor
-- Found Python3: /opt/nordic/ncs/toolchains/v2.1.0/bin/python3.9 (found suitable exact version "3.9.6") found components: Interpreter 
-- Cache files will be written to: /Users/das/Library/Caches/zephyr
-- Zephyr version: 3.1.99 (/opt/nordic/ncs/v2.1.0/zephyr)
-- Found west (found suitable version "0.14.0", minimum required is "0.7.1")
-- Board: nrf52840dongle_nrf52840
-- Found host-tools: zephyr 0.14.1 (/opt/nordic/ncs/toolchains/v2.1.0/opt/zephyr-sdk)
-- Found dtc: /opt/nordic/ncs/toolchains/v2.1.0/bin/dtc (found suitable version "1.6.1", minimum required is "1.4.6")
-- Found toolchain: zephyr 0.14.1 (/opt/nordic/ncs/toolchains/v2.1.0/opt/zephyr-sdk)
-- Found BOARD.dts: /opt/nordic/ncs/v2.1.0/zephyr/boards/arm/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840.dts
-- Found devicetree overlay: usb.overlay
-- Generated zephyr.dts: /Users/das/sdk-nrf/samples/openthread/coprocessor/build/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /Users/das/sdk-nrf/samples/openthread/coprocessor/build/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: /Users/das/sdk-nrf/samples/openthread/coprocessor/build/zephyr/include/generated/device_extern.h
-- Including generated dts.cmake file: /Users/das/sdk-nrf/samples/openthread/coprocessor/build/zephyr/dts.cmake
Parsing /Users/das/sdk-nrf/samples/openthread/coprocessor/Kconfig
Loaded configuration '/opt/nordic/ncs/v2.1.0/zephyr/boards/arm/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840_defconfig'
Merged configuration '/Users/das/sdk-nrf/samples/openthread/coprocessor/prj.conf'
Merged configuration '/Users/das/sdk-nrf/samples/openthread/coprocessor/overlay-usb.conf'
Configuration saved to '/Users/das/sdk-nrf/samples/openthread/coprocessor/build/zephyr/.config'
Kconfig header saved to '/Users/das/sdk-nrf/samples/openthread/coprocessor/build/zephyr/include/generated/autoconf.h'
-- The C compiler identification is GNU 10.3.0
-- The CXX compiler identification is GNU 10.3.0
-- The ASM compiler identification is GNU
-- Found assembler: /opt/nordic/ncs/toolchains/v2.1.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
-- OpenThread Source Directory: /opt/nordic/ncs/v2.1.0/modules/lib/openthread
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Searching 16 bit integer - Using unsigned short
-- Check if the system is big endian - little endian
-- Package Name: OPENTHREAD
-- Setting default package version: thread-reference-20200818-ncs1-rc3-764-g0d19f9112
-- Package Version: thread-reference-20200818-ncs1-rc3-764-g0d19f9112

In file included from /opt/nordic/ncs/v2.1.0/zephyr/include/zephyr/toolchain/gcc.h:88,
from /opt/nordic/ncs/v2.1.0/zephyr/include/zephyr/toolchain.h:50,
from /opt/nordic/ncs/v2.1.0/zephyr/include/zephyr/devicetree/zephyr.h:15,
from /opt/nordic/ncs/v2.1.0/zephyr/include/zephyr/devicetree.h:3101,
from /opt/nordic/ncs/v2.1.0/zephyr/modules/hal_nordic/nrfx/nrfx_config.h:10,
from /opt/nordic/ncs/v2.1.0/modules/hal/nordic/nrfx/nrfx.h:37,
from /opt/nordic/ncs/v2.1.0/modules/hal/nordic/nrfx/hal/nrf_radio.h:37,
from /opt/nordic/ncs/v2.1.0/nrfxlib/nrf_802154/driver/include/nrf_802154_types.h:44,
from /opt/nordic/ncs/v2.1.0/nrfxlib/nrf_802154/driver/include/nrf_802154.h:48,
from /Users/das/sdk-nrf/samples/openthread/coprocessor/src/nrf_802154_radio_wrapper.c:7:
/opt/nordic/ncs/v2.1.0/zephyr/include/zephyr/device.h:96:39: error: '__device_dts_ord_DT_CHOSEN_zephyr_ieee802154_ORD' undeclared here (not in a function)
96 | #define DEVICE_NAME_GET(name) _CONCAT(__device_, name)
| ^~~~~~~~~
/opt/nordic/ncs/v2.1.0/zephyr/include/zephyr/toolchain/common.h:132:26: note: in definition of macro '_DO_CONCAT'
132 | #define _DO_CONCAT(x, y) x ## y
| ^
/opt/nordic/ncs/v2.1.0/zephyr/include/zephyr/device.h:96:31: note: in expansion of macro '_CONCAT'
96 | #define DEVICE_NAME_GET(name) _CONCAT(__device_, name)
| ^~~~~~~
/opt/nordic/ncs/v2.1.0/zephyr/include/zephyr/device.h:276:37: note: in expansion of macro 'DEVICE_NAME_GET'
276 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_NAME(node_id))
| ^~~~~~~~~~~~~~~
/opt/nordic/ncs/v2.1.0/zephyr/include/zephyr/device.h:296:34: note: in expansion of macro 'DEVICE_DT_NAME_GET'
296 | #define DEVICE_DT_GET(node_id) (&DEVICE_DT_NAME_GET(node_id))
| ^~~~~~~~~~~~~~~~~~
/Users/das/sdk-nrf/samples/openthread/coprocessor/src/nrf_802154_radio_wrapper.c:12:2: note: in expansion of macro 'DEVICE_DT_GET'
12 | DEVICE_DT_GET(DT_CHOSEN(zephyr_ieee802154));

Did I miss something to consider in the prj.conf in order to build for nRF52840 dongle. 

Parents Reply
  • Hi Elfving, 

    Thanks!!!

    You are absolutely right Zephyr version is 3.1.99. It's my mistake. I confused with toolchain version and zephyr sdk version. Toolchain version is 0.14.1. 

    Actually before I post the query, I have gone through those previous post and made all the suggestions mentioned there.  I set the usb.overlay config files on CMakeLists but that also doesn't help. 

    When I tried to build Thread: CLI sample it  builds fine for nRF5340 DK. That shows my nRF Connect for VS Code fine right? 

    Do you have any doubts or thoughts on this. 

    Regards

    Vipin Das 

Children
  • I see.

    vipin das said:

    When I tried to build Thread: CLI sample it  builds fine for nRF5340 DK. That shows my nRF Connect for VS Code fine right? 

    Yeah I would think so.

    Though in order to make us a bit more sure of this, could you try building the coprocessor sample for a DK as well, eg. the nRF52840DK. And try another sample for the dongle, just to make sure there is no problem with the dts.

    What MAC version are you using btw?

    Regards,

    Elfving

  • Hi Elfving, 

    Thanks!!! 

    I already tried to built the coprocessor sample for nRF52840DK as well but the error appears the same. 

    [191/424] Building C object CMakeFiles/app.dir/src/nrf_802154_radio_wrapper.c.obj
    FAILED: CMakeFiles/app.dir/src/nrf_802154_radio_wrapper.c.obj 
    ccache /opt/nordic/ncs/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DKERNEL -DMBEDTLS_CONFIG_FILE=\"nrf-config.h\" -DMBEDTLS_USER_CONFIG_FILE=\"nrf-config-user.h\" -DNRF52840_XXAA -DNRF_802154_ACK_TIMEOUT_ENABLED=1 -DNRF_802154_CCA_CORR_LIMIT_DEFAULT=2 -DNRF_802154_CCA_CORR_THRESHOLD_DEFAULT=45 -DNRF_802154_CCA_ED_THRESHOLD_DEFAULT=45 -DNRF_802154_CCA_MODE_DEFAULT=NRF_RADIO_CCA_MODE_ED -DNRF_802154_ECB_PRIORITY=-1 -DNRF_802154_ENCRYPTION_ENABLED=1 -DNRF_802154_IE_WRITER_ENABLED=1 -DNRF_802154_INTERNAL_RADIO_IRQ_HANDLING=0 -DNRF_802154_PENDING_EXTENDED_ADDRESSES=16 -DNRF_802154_PENDING_SHORT_ADDRESSES=16 -DNRF_802154_RX_BUFFERS=16 -DNRF_802154_SECURITY_WRITER_ENABLED=1 -DNRF_802154_SWI_PRIORITY=1 -DNRF_802154_TX_STARTED_NOTIFY_ENABLED=1 -DNRF_802154_USE_RAW_API=1 -DUSE_PARTITION_MANAGER=0 -D_FORTIFY_SOURCE=2 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -I/opt/nordic/ncs/v2.1.2/nrf/drivers/mpsl/clock_control -I/opt/nordic/ncs/v2.1.2/zephyr/include/zephyr -I/opt/nordic/ncs/v2.1.2/zephyr/include -Izephyr/include/generated -I/opt/nordic/ncs/v2.1.2/zephyr/soc/arm/nordic_nrf/nrf52 -I/opt/nordic/ncs/v2.1.2/zephyr/lib/libc/newlib/include -I/opt/nordic/ncs/v2.1.2/zephyr/soc/arm/nordic_nrf/common/. -I/opt/nordic/ncs/v2.1.2/zephyr/subsys/usb/device -I/opt/nordic/ncs/v2.1.2/zephyr/subsys/settings/include -I/opt/nordic/ncs/v2.1.2/nrf/include -I/opt/nordic/ncs/v2.1.2/nrf/lib/multithreading_lock/. -I/opt/nordic/ncs/v2.1.2/zephyr/drivers/flash -I/opt/nordic/ncs/v2.1.2/zephyr/modules/openthread/platform/. -I/opt/nordic/ncs/v2.1.2/modules/hal/cmsis/CMSIS/Core/Include -I/opt/nordic/ncs/v2.1.2/modules/hal/nordic/nrfx -I/opt/nordic/ncs/v2.1.2/modules/hal/nordic/nrfx/drivers/include -I/opt/nordic/ncs/v2.1.2/modules/hal/nordic/nrfx/mdk -I/opt/nordic/ncs/v2.1.2/zephyr/modules/hal_nordic/nrfx/. -I/opt/nordic/ncs/v2.1.2/modules/debug/segger/SEGGER -I/opt/nordic/ncs/v2.1.2/modules/debug/segger/Config -I/opt/nordic/ncs/v2.1.2/zephyr/modules/segger/. -I/opt/nordic/ncs/v2.1.2/nrfxlib/mpsl/include -I/opt/nordic/ncs/v2.1.2/nrfxlib/mpsl/include/protocol -Imodules/openthread/build/etc/cmake -I/opt/nordic/ncs/v2.1.2/modules/lib/openthread/etc/cmake -I/opt/nordic/ncs/v2.1.2/nrfxlib/nrf_802154/driver/include -I/opt/nordic/ncs/v2.1.2/nrfxlib/nrf_802154/sl/include -Imodules/nrfxlib/nrfxlib/nrf_security/src/include/generated -I/opt/nordic/ncs/v2.1.2/nrfxlib/nrf_security/include -I/opt/nordic/ncs/v2.1.2/nrfxlib/nrf_security/include/mbedtls -I/opt/nordic/ncs/v2.1.2/nrfxlib/nrf_security/include/psa -I/opt/nordic/ncs/v2.1.2/mbedtls/include -I/opt/nordic/ncs/v2.1.2/mbedtls/include/mbedtls -I/opt/nordic/ncs/v2.1.2/mbedtls/include/psa -I/opt/nordic/ncs/v2.1.2/mbedtls/library -I/opt/nordic/ncs/v2.1.2/nrfxlib/nrf_security/../crypto/nrf_oberon/include -I/opt/nordic/ncs/v2.1.2/nrfxlib/nrf_security/../crypto/nrf_oberon/include/mbedtls -I/opt/nordic/ncs/v2.1.2/nrfxlib/nrf_security/../crypto/nrf_oberon/include/psa -I/opt/nordic/ncs/v2.1.2/nrfxlib/crypto/nrf_oberon/include/mbedtls -I/opt/nordic/ncs/v2.1.2/nrfxlib/crypto/nrf_oberon/include -isystem /opt/nordic/ncs/v2.1.2/zephyr/subsys/cpp/include -isystem /opt/nordic/ncs/v2.1.2/modules/lib/openthread/include -isystem /opt/nordic/ncs/v2.1.2/modules/lib/openthread/examples/platforms -isystem /opt/nordic/ncs/v2.1.2/nrfxlib/crypto/nrf_cc310_platform/include -Os -imacros /Users/das/sdk-nrf/samples/openthread/coprocessor/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mfp16-format=ieee --sysroot=/opt/nordic/ncs/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros /opt/nordic/ncs/v2.1.2/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=/Users/das/sdk-nrf/samples/openthread/coprocessor=CMAKE_SOURCE_DIR -fmacro-prefix-map=/opt/nordic/ncs/v2.1.2/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/opt/nordic/ncs/v2.1.2=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=nano.specs -std=c99 -MD -MT CMakeFiles/app.dir/src/nrf_802154_radio_wrapper.c.obj -MF CMakeFiles/app.dir/src/nrf_802154_radio_wrapper.c.obj.d -o CMakeFiles/app.dir/src/nrf_802154_radio_wrapper.c.obj -c ../src/nrf_802154_radio_wrapper.c
    In file included from /opt/nordic/ncs/v2.1.2/zephyr/include/zephyr/toolchain/gcc.h:88,
                     from /opt/nordic/ncs/v2.1.2/zephyr/include/zephyr/toolchain.h:50,
                     from /opt/nordic/ncs/v2.1.2/zephyr/include/zephyr/devicetree/zephyr.h:15,
                     from /opt/nordic/ncs/v2.1.2/zephyr/include/zephyr/devicetree.h:3101,
                     from /opt/nordic/ncs/v2.1.2/zephyr/modules/hal_nordic/nrfx/nrfx_config.h:10,
                     from /opt/nordic/ncs/v2.1.2/modules/hal/nordic/nrfx/nrfx.h:37,
                     from /opt/nordic/ncs/v2.1.2/modules/hal/nordic/nrfx/hal/nrf_radio.h:37,
                     from /opt/nordic/ncs/v2.1.2/nrfxlib/nrf_802154/driver/include/nrf_802154_types.h:44,
                     from /opt/nordic/ncs/v2.1.2/nrfxlib/nrf_802154/driver/include/nrf_802154.h:48,
                     from /Users/das/sdk-nrf/samples/openthread/coprocessor/src/nrf_802154_radio_wrapper.c:7:
    /opt/nordic/ncs/v2.1.2/zephyr/include/zephyr/device.h:96:39: error: '__device_dts_ord_DT_CHOSEN_zephyr_ieee802154_ORD' undeclared here (not in a function)
       96 | #define DEVICE_NAME_GET(name) _CONCAT(__device_, name)
          |                                       ^~~~~~~~~
    /opt/nordic/ncs/v2.1.2/zephyr/include/zephyr/toolchain/common.h:132:26: note: in definition of macro '_DO_CONCAT'
      132 | #define _DO_CONCAT(x, y) x ## y
          |                          ^
    /opt/nordic/ncs/v2.1.2/zephyr/include/zephyr/device.h:96:31: note: in expansion of macro '_CONCAT'
       96 | #define DEVICE_NAME_GET(name) _CONCAT(__device_, name)
          |                               ^~~~~~~
    /opt/nordic/ncs/v2.1.2/zephyr/include/zephyr/device.h:276:37: note: in expansion of macro 'DEVICE_NAME_GET'
      276 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_NAME(node_id))
          |                                     ^~~~~~~~~~~~~~~
    /opt/nordic/ncs/v2.1.2/zephyr/include/zephyr/device.h:296:34: note: in expansion of macro 'DEVICE_DT_NAME_GET'
      296 | #define DEVICE_DT_GET(node_id) (&DEVICE_DT_NAME_GET(node_id))
          |                                  ^~~~~~~~~~~~~~~~~~
    /Users/das/sdk-nrf/samples/openthread/coprocessor/src/nrf_802154_radio_wrapper.c:12:2: note: in expansion of macro 'DEVICE_DT_GET'
       12 |  DEVICE_DT_GET(DT_CHOSEN(zephyr_ieee802154));

    I tried Thread: CLI sample for dongle and it built successfully.  

    My Mac version is 12.4(macOS Monterey).

    Regards

    Vipin Das

  • Hi Elfving,

    Do you have any other alternate solutions for me to configure/setup OpenThread Border Router on nRF52840 dongle. I am really blocked because of this error. 

    Finally I wanted to connect OpenThread Docker to my Thread Network(nRF5340 DK) as mentioned here

    Please share your thoughts or any alternate solutions. 

    Regards

    Vipin Das 

  • Hi Elfving,

    From discord discussion, one engineer rlubos told me that I missed one commit. https://github.com/zephyrproject-rtos/zephyr/commit/846bed99c3a5cdb11b8b2ed00259fd1dff7cf6ba

    Regards

    Vipin Das

  • Hi Elfving,

    Finally my issue got fixed after re-installing the NRF SDK to the v2.1.2. Now you can close the ticket. 

    Thanks for your help.

    Regards

    Vipin Das 

Related