Problem building OpenThread Coprocessor app in Matter demo using VS Code

Like several other folks, I have been attempting to replicate the results in the Matter webinar here, but updating to the v2.1.0 SDK and using the Nordic dev kits I have on hand.  Have successfully built the Matter Lock app on an nRF5340 DK.using VS Code and tested it (at least using the app's CLI interface)

Moving on to the OpenThread Coprocessor app, I'm using an nRF52840 Dongle.  But I run into multiple problems with the CLI build instructions using the west command.  Have been here before, using west from the command line on my Mac installation often runs into "issues".  So decided to try it using VS Code and the nRF Extension.  But this creates questions:

  • Should I be able to specify the overlays specified in the west command line by adding -DOVERLAY="overlay-rcp.conf ../cli/overlay-thread_1_2.conf overlay-usb.conf" to the Extra CMake arguments field in the Build Configuration window? Tried it; didn't work. Build log attached below.
  • I'm not sure these three overlays specified the west command line are still correct.  Are they, or have the required overlays changed with SDK v 2.1.0?
  • Is there an updated version of the Matter demo (dated Nov 2021)?  Errata or other corrections?
  • A more general question about Matter: What's the Nordic strategy for configuration management of the Matter code in the NCS SDKs?  Specifically, the connectedhomeip repo is open source and updated dynamically (git commits at least daily).  How do NCS SDK versions synchronize with this?

Thanks for any help.  Looking forward to fluid Matter development,

Mike

 *  Executing task: nRF Connect: Generate config nrf52840dongle_nrf52840 for /Users/mike/Nordic/SDK2.1_Apps/coprocessor 

Building coprocessor
west build --build-dir /Users/mike/Nordic/SDK2.1_Apps/coprocessor/build /Users/mike/Nordic/SDK2.1_Apps/coprocessor --pristine --board nrf52840dongle_nrf52840 -- -DNCS_TOOLCHAIN_VERSION:STRING="NONE" -DBOARD_ROOT:STRING="/Users/mike/Nordic/SDK2.1_Apps/lock;/Users/mike/Nordic/SDK2.1_Apps/coprocessor"

-- west build: generating a build system
Loading Zephyr default modules (Zephyr base).
-- Application: /Users/mike/Nordic/SDK2.1_Apps/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/mike/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
-- Generated zephyr.dts: /Users/mike/Nordic/SDK2.1_Apps/coprocessor/build/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /Users/mike/Nordic/SDK2.1_Apps/coprocessor/build/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: /Users/mike/Nordic/SDK2.1_Apps/coprocessor/build/zephyr/include/generated/device_extern.h
-- Including generated dts.cmake file: /Users/mike/Nordic/SDK2.1_Apps/coprocessor/build/zephyr/dts.cmake

warning: UART_INTERRUPT_DRIVEN (defined at boards/shields/sparkfun_sara_r4/Kconfig.defconfig:24, boards/shields/wnc_m14a2a/Kconfig.defconfig:17, soc/arm/quicklogic_eos_s3/Kconfig.defconfig:17, drivers/serial/Kconfig:72) has direct dependencies (NETWORKING && SHIELD_SPARKFUN_SARA_R4) || (NETWORKING && SHIELD_WNC_M14A2A) || (SERIAL && SOC_EOS_S3) || (SERIAL_SUPPORT_INTERRUPT && SERIAL) with value n, but is currently being y-selected by the following symbols:
 - OPENTHREAD_COPROCESSOR (defined at subsys/net/l2/openthread/Kconfig:212), with value y, direct dependencies NET_L2_OPENTHREAD && NETWORKING (value: y), and select condition NET_L2_OPENTHREAD && NETWORKING (value: y)

error: Aborting due to Kconfig warnings

Parsing /Users/mike/Nordic/SDK2.1_Apps/coprocessor/Kconfig
Loaded configuration '/opt/nordic/ncs/v2.1.0/zephyr/boards/arm/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840_defconfig'
Merged configuration '/Users/mike/Nordic/SDK2.1_Apps/coprocessor/prj.conf'
CMake Error at /opt/nordic/ncs/v2.1.0/zephyr/cmake/modules/kconfig.cmake:293 (message):
  command failed with return code: 1
Call Stack (most recent call first):
  /opt/nordic/ncs/v2.1.0/zephyr/cmake/modules/zephyr_default.cmake:121 (include)
  /opt/nordic/ncs/v2.1.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
  /opt/nordic/ncs/v2.1.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
  CMakeLists.txt:11 (find_package)


-- Configuring incomplete, errors occurred!
FATAL ERROR: command exited with status 1: /opt/nordic/ncs/toolchains/v2.1.0/bin/cmake -DWEST_PYTHON=/opt/nordic/ncs/toolchains/v2.1.0/bin/python3 -B/Users/mike/Nordic/SDK2.1_Apps/coprocessor/build -GNinja -DBOARD=nrf52840dongle_nrf52840 -DNCS_TOOLCHAIN_VERSION:STRING=NONE '-DBOARD_ROOT:STRING=/Users/mike/Nordic/SDK2.1_Apps/lock;/Users/mike/Nordic/SDK2.1_Apps/coprocessor' -S/Users/mike/Nordic/SDK2.1_Apps/coprocessor

 *  The terminal process terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

 *  Executing task: nRF Connect: Generate config nrf52840dongle_nrf52840 for /Users/mike/Nordic/SDK2.1_Apps/coprocessor 

Building coprocessor
west build --build-dir /Users/mike/Nordic/SDK2.1_Apps/coprocessor/build /Users/mike/Nordic/SDK2.1_Apps/coprocessor --pristine --board nrf52840dongle_nrf52840 -- -DNCS_TOOLCHAIN_VERSION:STRING="NONE" -DBOARD_ROOT:STRING="/Users/mike/Nordic/SDK2.1_Apps/lock;/Users/mike/Nordic/SDK2.1_Apps/coprocessor" -DOVERLAY="overlay-rcp.conf    ../cli/overlay-thread_1_2.conf overlay-usb.conf"

-- west build: generating a build system
Loading Zephyr default modules (Zephyr base).
-- Application: /Users/mike/Nordic/SDK2.1_Apps/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/mike/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
-- Generated zephyr.dts: /Users/mike/Nordic/SDK2.1_Apps/coprocessor/build/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /Users/mike/Nordic/SDK2.1_Apps/coprocessor/build/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: /Users/mike/Nordic/SDK2.1_Apps/coprocessor/build/zephyr/include/generated/device_extern.h
-- Including generated dts.cmake file: /Users/mike/Nordic/SDK2.1_Apps/coprocessor/build/zephyr/dts.cmake

warning: UART_INTERRUPT_DRIVEN (defined at boards/shields/sparkfun_sara_r4/Kconfig.defconfig:24, boards/shields/wnc_m14a2a/Kconfig.defconfig:17, soc/arm/quicklogic_eos_s3/Kconfig.defconfig:17, drivers/serial/Kconfig:72) has direct dependencies (NETWORKING && SHIELD_SPARKFUN_SARA_R4) || (NETWORKING && SHIELD_WNC_M14A2A) || (SERIAL && SOC_EOS_S3) || (SERIAL_SUPPORT_INTERRUPT && SERIAL) with value n, but is currently being y-selected by the following symbols:
 - OPENTHREAD_COPROCESSOR (defined at subsys/net/l2/openthread/Kconfig:212), with value y, direct dependencies NET_L2_OPENTHREAD && NETWORKING (value: y), and select condition NET_L2_OPENTHREAD && NETWORKING (value: y)

error: Aborting due to Kconfig warnings

Parsing /Users/mike/Nordic/SDK2.1_Apps/coprocessor/Kconfig
Loaded configuration '/opt/nordic/ncs/v2.1.0/zephyr/boards/arm/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840_defconfig'
Merged configuration '/Users/mike/Nordic/SDK2.1_Apps/coprocessor/prj.conf'
CMake Error at /opt/nordic/ncs/v2.1.0/zephyr/cmake/modules/kconfig.cmake:293 (message):
  command failed with return code: 1
Call Stack (most recent call first):
  /opt/nordic/ncs/v2.1.0/zephyr/cmake/modules/zephyr_default.cmake:121 (include)
  /opt/nordic/ncs/v2.1.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
  /opt/nordic/ncs/v2.1.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
  CMakeLists.txt:11 (find_package)


-- Configuring incomplete, errors occurred!
FATAL ERROR: command exited with status 1: /opt/nordic/ncs/toolchains/v2.1.0/bin/cmake -DWEST_PYTHON=/opt/nordic/ncs/toolchains/v2.1.0/bin/python3 -B/Users/mike/Nordic/SDK2.1_Apps/coprocessor/build -GNinja -DBOARD=nrf52840dongle_nrf52840 -DNCS_TOOLCHAIN_VERSION:STRING=NONE '-DBOARD_ROOT:STRING=/Users/mike/Nordic/SDK2.1_Apps/lock;/Users/mike/Nordic/SDK2.1_Apps/coprocessor' '-DOVERLAY=overlay-rcp.conf    ../cli/overlay-thread_1_2.conf overlay-usb.conf' -S/Users/mike/Nordic/SDK2.1_Apps/coprocessor

 *  The terminal process terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

  • Hi,

    Should I be able to specify the overlays specified in the west command line by adding -DOVERLAY="overlay-rcp.conf ../cli/overlay-thread_1_2.conf overlay-usb.conf" to the Extra CMake arguments field in the Build Configuration window? Tried it; didn't work. Build log attached below.

    You can select "Add fragment" under Kconfig fragments if you want to add multiple Kconfig overlay files. You can specify DTS overlay files as described in the note under "Setting up build configuration" in nRF Connect VS Code documentation.

    I'm not sure these three overlays specified the west command line are still correct.  Are they, or have the required overlays changed with SDK v 2.1.0?

    Thread 1.3 is used by default in nRF Connect SDK v2.1.0, so you should not specify Thread 1.2. Thread 1.3 is required by Matter.

    You should follow the Thread Coprocessor Sample documentation when building.

    Is there an updated version of the Matter demo (dated Nov 2021)?  Errata or other corrections?

    Are you referring to the Webinar? I do not think we have any updated versions of this available, but the Matter documentation have been improved a lot in the later nRF Connect SDK documentations. I would recommend you to read through this.

    A more general question about Matter: What's the Nordic strategy for configuration management of the Matter code in the NCS SDKs?  Specifically, the connectedhomeip repo is open source and updated dynamically (git commits at least daily).  How do NCS SDK versions synchronize with this?

    We have our own Downstream repo of connectedhomeip for use in NCS. The Matter version used in each tagged release of nRF Connect SDK is determined before each release. You can read more about this in Matter integration in the nRF Connect SDK.

    Best regards,
    Jørgen

  • Jørgen,

    Many thanks for the quick and very informative rep[y. Looks like just the information I need.  Glad to hear of the progress in Matter support and its documentation.

    Mike

  • Jørgen,

    Tried to follow some of your suggestions, but they led to more general reading and investigation than I'm ready to pursue at the moment.  Was looking for some very specific suggestions, just to get the sample app to build, after which I can pursue more background reading and variations on the example.

    As a quick test, I went back to west and the CLI approach.  After some experimentation, actually got fairly far into the build process.  See below for a log of a complete terminal session.  Looks like it's failing with possibly a lack of some environment variable or build argument not being set properly to communicate the target device string to a macro definition in device.h (see line 391 in the log)  Would you please let me know if I'm on the right track with the "west build ..." command and what I need to do to fix the build error.  Here's the build command I used (with verbose mode on):

    west -v build -b nrf52840dongle_nrf52840 -- -DOVERLAY_CONFIG="/Users/mike/zephyrproject/zephyr/samples/net/openthread/coprocessor/overlay-rcp.conf overlay-usb.conf" 
    


    Many thanks for helping out an old-timer with Nordic chips (back to the nRF51 series), but relative newbie with the NCS and VS Code environment.

    Mike

    Last login: Thu Sep 29 19:22:13 on ttys001
    export PATH=/opt/nordic/ncs/toolchains/v2.1.0/bin:/opt/nordic/ncs/toolchains/v2.1.0/usr/bin:/opt/nordic/ncs/toolchains/v2.1.0/usr/local/bin:/opt/nordic/ncs/toolchains/v2.1.0/opt/bin:/opt/nordic/ncs/toolchains...
     Code

  • Hmm... looks like my attempt to share a 400+ line console log wasn't successful.  Heere's another try.

    Mike

    west build log.txt

  • It looks like the build fails because it tries to use the USB transport, but the devicetree does not define the correct USB output target for ot-uart. This is defined in usb.overlay and should be applied to the build command like this:

    west build -b nrf52840dongle_nrf52840 -- -DOVERLAY_CONFIG=overlay-usb.conf -DDTC_OVERLAY_FILE=usb.overlay

    You should not have to include the path to the overlay-rcp.conf file that you have used in your log. The RCP architecture is now configured in the prj.conf file and is enabled by default.

Related