Not able to build Thread:CLI sample project for nRF5340 DK

Hi Team Nordic,

For setting up a thread network using nRF5340 DK's, I wanted to build and flash Thread: CLI sample from nrf repository. I use nRF Connect for VS Code with NCS version v2.1.2 and Zephyr Version 3.1.99. But when I tried to build the sample Thread: CLI it throws FATAL ERROR. shown below. 

Loading Zephyr default modules (Zephyr base).
-- Application: /Users/das/ncs/nrf/samples/openthread/cli
-- Found Python3: /usr/local/opt/[email protected]/bin/python3.9 (found suitable exact version "3.9.15") found components: Interpreter 
-- Cache files will be written to: /Users/das/Library/Caches/zephyr
-- Zephyr version: 3.1.99 (/Users/das/ncs/zephyr)
-- Found west (found suitable version "0.13.1", minimum required is "0.7.1")
-- Board: nrf5340dk_nrf5340_cpuapp
-- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
-- Found host-tools: zephyr 0.15.1 (/Users/das/ncs/toolchains/zephyr-sdk-0.15.1)
-- Found dtc: /usr/local/bin/dtc (found suitable version "1.6.1", minimum required is "1.4.6")
-- Found toolchain: zephyr 0.15.1 (/Users/das/ncs/toolchains/zephyr-sdk-0.15.1)
-- Found BOARD.dts: /Users/das/ncs/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts
-- Generated zephyr.dts: /Users/das/ncs/nrf/samples/openthread/cli/build/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /Users/das/ncs/nrf/samples/openthread/cli/build/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: /Users/das/ncs/nrf/samples/openthread/cli/build/zephyr/include/generated/device_extern.h
-- Including generated dts.cmake file: /Users/das/ncs/nrf/samples/openthread/cli/build/zephyr/dts.cmake
Parsing /Users/das/ncs/nrf/samples/openthread/cli/Kconfig
Loaded configuration '/Users/das/ncs/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp_defconfig'
Merged configuration '/Users/das/ncs/nrf/samples/openthread/cli/prj.conf'
Merged configuration '/Users/das/ncs/nrf/samples/openthread/cli/boards/nrf5340dk_nrf5340_cpuapp.conf'
Configuration saved to '/Users/das/ncs/nrf/samples/openthread/cli/build/zephyr/.config'
Kconfig header saved to '/Users/das/ncs/nrf/samples/openthread/cli/build/zephyr/include/generated/autoconf.h'
-- The C compiler identification is GNU 12.1.0
-- The CXX compiler identification is GNU 12.1.0
-- The ASM compiler identification is GNU
-- Found assembler: /Users/das/ncs/toolchains/zephyr-sdk-0.15.1/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc

=== child image 802154_rpmsg - CPUNET begin ===
loading initial cache file /Users/das/ncs/nrf/samples/openthread/cli/build/802154_rpmsg/child_image_preload.cmake
Loading Zephyr default modules (Zephyr base).
-- Application: /Users/das/ncs/zephyr/samples/boards/nrf/ieee802154/802154_rpmsg
-- Found Python3: /usr/local/bin/python3.10 (found suitable exact version "3.10.8") found components: Interpreter 
-- Cache files will be written to: /Users/das/Library/Caches/zephyr
-- Zephyr version: 3.1.99 (/Users/das/ncs/zephyr)
-- Board: nrf5340dk_nrf5340_cpunet
-- Found host-tools: zephyr 0.15.1 (/Users/das/ncs/toolchains/zephyr-sdk-0.15.1)
-- Found dtc: /usr/local/bin/dtc (found suitable version "1.6.1", minimum required is "1.4.6")
-- Found toolchain: zephyr 0.15.1 (/Users/das/ncs/toolchains/zephyr-sdk-0.15.1)
-- Found BOARD.dts: /Users/das/ncs/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpunet.dts
-- Generated zephyr.dts: /Users/das/ncs/nrf/samples/openthread/cli/build/802154_rpmsg/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /Users/das/ncs/nrf/samples/openthread/cli/build/802154_rpmsg/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: /Users/das/ncs/nrf/samples/openthread/cli/build/802154_rpmsg/zephyr/include/generated/device_extern.h
-- Including generated dts.cmake file: /Users/das/ncs/nrf/samples/openthread/cli/build/802154_rpmsg/zephyr/dts.cmake

warning: NRF_802154_ENCRYPTION (defined at modules/hal_nordic/Kconfig:50) was assigned the value 'y'
but got the value 'n'. Check these unsatisfied dependencies: NRF_802154_RADIO_DRIVER (=n), 0 (=n).
See http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_NRF_802154_ENCRYPTION and/or look up
NRF_802154_ENCRYPTION 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: NRF_802154_SER_RADIO (defined at modules/hal_nordic/Kconfig:161) was assigned the value 'y'
but got the value 'n'. Check these unsatisfied dependencies: 0 (=n). See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_NRF_802154_SER_RADIO and/or look up
NRF_802154_SER_RADIO 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.


/Users/das/ncs/nrf/subsys/partition_manager/partition_manager_enabled.conf:7: warning: attempt to assign the value 'y' to the undefined symbol PARTITION_MANAGER_ENABLED

warning: HAS_NORDIC_DRIVERS (defined at modules/hal_nordic/Kconfig:11) has direct dependencies 0 with value n, but is currently being y-selected by the following symbols:
 - SOC_SERIES_NRF53X (defined at soc/arm/nordic_nrf/nrf53/Kconfig.series:6), with value y, direct dependencies <choice> (value: y), and select condition <choice> (value: y)

warning: HAS_NRFX (defined at modules/hal_nordic/nrfx/Kconfig:4) has direct dependencies 0 with value n, but is currently being y-selected by the following symbols:
 - SOC_SERIES_NRF53X (defined at soc/arm/nordic_nrf/nrf53/Kconfig.series:6), with value y, direct dependencies <choice> (value: y), and select condition <choice> (value: y)

warning: NRFX_CLOCK (defined at modules/hal_nordic/nrfx/Kconfig:14) has direct dependencies HAS_NRFX && 0 with value n, but is currently being y-selected by the following symbols:
 - CLOCK_CONTROL_NRF (defined at drivers/clock_control/Kconfig.nrf:13), with value y, direct dependencies DT_HAS_NORDIC_NRF_CLOCK_ENABLED && CLOCK_CONTROL (value: y), and select condition !CLOCK_CONTROL_NRF_FORCE_ALT && DT_HAS_NORDIC_NRF_CLOCK_ENABLED && CLOCK_CONTROL (value: y)

warning: NRFX_CLOCK_LFXO_TWO_STAGE_ENABLED (defined at modules/hal_nordic/nrfx/Kconfig:18) has direct dependencies NRFX_CLOCK && HAS_NRFX && 0 with value n, but is currently being y-selected by the following symbols:
 - CLOCK_CONTROL_NRF_K32SRC_XTAL (defined at drivers/clock_control/Kconfig.nrf:36), with value y, direct dependencies <choice CLOCK_CONTROL_NRF_SOURCE> (value: y), and select condition !SOC_SERIES_BSIM_NRFXX && !CLOCK_CONTROL_NRF_FORCE_ALT && <choice CLOCK_CONTROL_NRF_SOURCE> (value: y)

warning: NRFX_GPIOTE (defined at modules/hal_nordic/nrfx/Kconfig:63) has direct dependencies HAS_NRFX && 0 with value n, but is currently being y-selected by the following symbols:
 - GPIO_NRFX (defined at drivers/gpio/KconfigParsing /Users/das/ncs/zephyr/Kconfig
Loaded configuration '/Users/das/ncs/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpunet_defconfig'
Merged configuration '/Users/das/ncs/zephyr/samples/boards/nrf/ieee802154/802154_rpmsg/prj.conf'
Merged configuration '/Users/das/ncs/nrf/subsys/partition_manager/partition_manager_enabled.conf'
Merged configuration '/Users/das/ncs/nrf/samples/openthread/cli/child_image/802154_rpmsg.conf'
.nrfx:4), with value y, direct dependencies DT_HAS_NORDIC_NRF_GPIO_ENABLED && GPIO (value: y), and select condition DT_HAS_NORDIC_NRF_GPIO_ENABLED && GPIO (value: y)

error: Aborting due to Kconfig warnings

CMake Error at /Users/das/ncs/zephyr/cmake/modules/kconfig.cmake:293 (message):
  command failed with return code: 1
Call Stack (most recent call first):
  /Users/das/ncs/zephyr/cmake/modules/zephyr_default.cmake:121 (include)
  /Users/das/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
  /Users/das/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
  CMakeLists.txt:5 (find_package)


-- Configuring incomplete, errors occurred!
CMake Error at /Users/das/ncs/nrf/cmake/multi_image.cmake:409 (message):
  CMake generation for 802154_rpmsg failed, aborting.  Command: 1
Call Stack (most recent call first):
  /Users/das/ncs/nrf/cmake/multi_image.cmake:150 (add_child_image_from_source)
  /Users/das/ncs/nrf/samples/CMakeLists.txt:151 (add_child_image)


-- Configuring incomplete, errors occurred!
See also "/Users/das/ncs/nrf/samples/openthread/cli/build/CMakeFiles/CMakeOutput.log".
See also "/Users/das/ncs/nrf/samples/openthread/cli/build/CMakeFiles/CMakeError.log".
FATAL ERROR: command exited with status 1: /usr/local/bin/cmake -DWEST_PYTHON=/usr/local/opt/[email protected]/bin/python3.9 -B/Users/das/ncs/nrf/samples/openthread/cli/build -GNinja -DBOARD=nrf5340dk_nrf5340_cpuapp -DOVERLAY_FILE=overlay-usb.conf -S/Users/das/ncs/nrf/samples/openthread/cli

I followed the following pages for build the sample. 

https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.2/nrf/samples/openthread/cli/README.html

https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.2/nrf/ug_multi_image.html#

Can someone tell me, whether I miss some configuration to build the example. I don't have any clue why it suddenly starts failing. The only thing I did was upgraded the NCS from v2.0.0 to v2.1.2. 

Note: The sample builds for nrf52840dk_nrf52840 & nrf52840dongle_nrf52840 

Thanks in advance

Vipin Das

  • Hi Vidar,

    I don't remember exactly but I believe I usually build the sample without making any changes. In this case also I followed the same. But let me try to install the NCS via NRF Toolchain manager and try to build the same sample with v2.1.0. 

    Will update the status in shortly. 

    Thanks 

    Vipin Das

  • Hi Vipin,

    Yes, I think that's a good idea. Alternatively, you can try to run 'west forall -c "git reset --hard" to revert all changes in your current SDK but use this command with caution so you don't inadvertently remove changes you want to keep.

    Regards,

    Vidar

  • Hi Vidar, 

    Thanks for your suggestions and now I am finally able to build the sample for nRF5340 DK. The only change I did was downgraded the NCS to v2.1.0 from v2.1.2. Also pointed out the toolchain from NCS. 

    Loading Zephyr default modules (Zephyr base (cached)).
    -- Application: /Users/das/ncs/nrf/samples/openthread/cli
    -- Using NCS Toolchain 2.1.0 for building. (/opt/nordic/ncs/toolchains/v2.1.0/cmake)
    -- Cache files will be written to: /Users/das/Library/Caches/zephyr
    -- Zephyr version: 3.1.99 (/Users/das/ncs/zephyr)
    -- Found west (found suitable version "0.14.0", minimum required is "0.7.1")
    -- Board: nrf5340dk_nrf5340_cpuapp
    -- Found host-tools: zephyr 0.14.1 (/Users/das/ncs/toolchains/zephyr-sdk-0.14.1)
    -- 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 (/Users/das/ncs/toolchains/zephyr-sdk-0.14.1)
    -- Found BOARD.dts: /Users/das/ncs/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts
    -- Found devicetree overlay: usb.overlay
    -- Generated zephyr.dts: /Users/das/ncs/nrf/samples/openthread/cli/build/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: /Users/das/ncs/nrf/samples/openthread/cli/build/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: /Users/das/ncs/nrf/samples/openthread/cli/build/zephyr/include/generated/device_extern.h
    -- Including generated dts.cmake file: /Users/das/ncs/nrf/samples/openthread/cli/build/zephyr/dts.cmake
    Parsing /Users/das/ncs/nrf/samples/openthread/cli/Kconfig
    Loaded configuration '/Users/das/ncs/nrf/samples/openthread/cli/build/zephyr/.config'
    No change to configuration in '/Users/das/ncs/nrf/samples/openthread/cli/build/zephyr/.config'
    No change to Kconfig header in '/Users/das/ncs/nrf/samples/openthread/cli/build/zephyr/include/generated/autoconf.h'
    
    === child image 802154_rpmsg - CPUNET begin ===
    loading initial cache file /Users/das/ncs/nrf/samples/openthread/cli/build/802154_rpmsg/child_image_preload.cmake
    Loading Zephyr default modules (Zephyr base (cached)).
    -- Application: /Users/das/ncs/zephyr/samples/boards/nrf/ieee802154/802154_rpmsg
    -- Using NCS Toolchain 2.1.0 for building. (/opt/nordic/ncs/toolchains/v2.1.0/cmake)
    -- Cache files will be written to: /Users/das/Library/Caches/zephyr
    -- Zephyr version: 3.1.99 (/Users/das/ncs/zephyr)
    -- Found west (found suitable version "0.14.0", minimum required is "0.7.1")
    -- Board: nrf5340dk_nrf5340_cpunet
    -- Found host-tools: zephyr 0.14.1 (/Users/das/ncs/toolchains/zephyr-sdk-0.14.1)
    -- 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 (/Users/das/ncs/toolchains/zephyr-sdk-0.14.1)
    -- Found BOARD.dts: /Users/das/ncs/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpunet.dts
    -- Generated zephyr.dts: /Users/das/ncs/nrf/samples/openthread/cli/build/802154_rpmsg/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: /Users/das/ncs/nrf/samples/openthread/cli/build/802154_rpmsg/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: /Users/das/ncs/nrf/samples/openthread/cli/build/802154_rpmsg/zephyr/include/generated/device_extern.h
    -- Including generated dts.cmake file: /Users/das/ncs/nrf/samples/openthread/cli/build/802154_rpmsg/zephyr/dts.cmake
    Parsing /Users/das/ncs/zephyr/Kconfig
    Loaded configuration '/Users/das/ncs/nrf/samples/openthread/cli/build/802154_rpmsg/zephyr/.config'
    No change to configuration in '/Users/das/ncs/nrf/samples/openthread/cli/build/802154_rpmsg/zephyr/.config'
    No change to Kconfig header in '/Users/das/ncs/nrf/samples/openthread/cli/build/802154_rpmsg/zephyr/include/generated/autoconf.h'
    -- libmetal version: 1.2.0 (/Users/das/ncs/zephyr/samples/boards/nrf/ieee802154/802154_rpmsg)
    -- Build type:  
    -- Host:    Darwin/x86_64
    -- Target:  Generic/arm
    -- Machine: arm
    -- open-amp version: 1.2.0 (/Users/das/ncs/modules/lib/open-amp/open-amp)
    -- Host:    Darwin/x86_64
    -- Target:  Generic/arm
    -- Machine: arm
    -- C_FLAGS :  -Wall -Wextra
    CMake Warning at /Users/das/ncs/zephyr/CMakeLists.txt:831 (message):
      No SOURCES given to Zephyr library: drivers__console
    
      Excluding target from build.
    
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /Users/das/ncs/nrf/samples/openthread/cli/build/802154_rpmsg
    === child image 802154_rpmsg - CPUNET end ===
    
    -- OpenThread Source Directory: /Users/das/ncs/modules/lib/openthread
    -- Package Name: OPENTHREAD
    -- Setting default package version: thread-reference-20200818-ncs1-rc3-764-g0d19f9112
    -- Package Version: thread-reference-20200818-ncs1-rc3-764-g0d19f9112
    -- libmetal version: 1.2.0 (/Users/das/ncs/nrf/samples/openthread/cli)
    -- Build type:  
    -- Host:    Darwin/x86_64
    -- Target:  Generic/arm
    -- Machine: arm
    -- open-amp version: 1.2.0 (/Users/das/ncs/modules/lib/open-amp/open-amp)
    -- Host:    Darwin/x86_64
    -- Target:  Generic/arm
    -- Machine: arm
    -- C_FLAGS :  -Wall -Wextra
    CMake Warning at /Users/das/ncs/zephyr/CMakeLists.txt:1839 (message):
      __ASSERT() statements are globally ENABLED
    
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /Users/das/ncs/nrf/samples/openthread/cli/build

    I could see 2 build for this sample one for nrf5340dk_nrf5340_cpunet and nrf5340dk_nrf5340_cpuapp

    Could you please tell me the right steps to flash the images to my target. Means should I flash it separately or just flash using nRF Connect. 

    Regards

    Vipin Das

  • Hi Vipin,

    If you use the VS extension, you can use the 'flash' button. This will load the FW images that are included in your build for you.

      

    Or you can use west flash/west flash --erase if you are working from the command line.

    Doing this with nrfjprog or the Programmer app is a bit more work, but it is also an option. The FW image for the network core will be located in /build/802154_rpmsg/zephyr. 

    For an overview of the different types of .hex and .bin files generated by the build, see https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/app_build_system.html#output-build-files 

    Regards,

    Vidar

  • Hi Vidar,

    Thank you so much for your support. I highly admire and appreciate the support. 

    I tried VS extension for this sample. But I might use the nrfjprog later after I integrate the Thread CLI sample into our SDK. 

    You can close the ticket. 

    Thanks 

    Vipin Das 

Related