Build errors - Thingy:53 - • Building and programming using Visual Studio Code

Hello 

I'm trying to follow the steps in this section  Building and programming using Visual Studio Code 

The section is included in a section Developing with Thingy:53 guide which is part of the nRF Connect SDK.documentation

  • The Build failed on step 9
  • What is the problem? Looks like is having trouble building the configuration file because of to many Kconfig warnings?
  • Do I have the correct directory for the sample?

A detailed description of the steps and the build error log follows:

  • Step 1
    • Since I already have VS CODE, nRF Connect For VS Code Extensions, and nRF Connect SDK installed from a previous board
      • I Opened a new VS Code Workspace
      • By creating a blank folder and Opening VS code from that folder
    • Step 2,3,4,5
      • In step 4 I navigated to my sdk 2.0.2 version under my /ncs roor directory
      • C:\ncs\v2.0.2\nrf\samples\bluetooth\peripheral_lbs
      • ...
      • Opening VS Code from a folder as in step 1, did not work as described in step 5, “A new application is automatically added in the Applications View”
      • Open an empty VS Code and perform steps 2 through 5 and you will have a “A new application is automatically added in the Applications View” as shown below
    • Step 7,8,9
      • Build failed on step 9
      • Here is the output of the LOG

Executing task: nRF Connect: Generate config nrf5340dk_nrf5340_cpuapp for c:\ncs\v2.0.2\nrf\samples\bluetooth\peripheral_lbs

Building peripheral_lbs

west build --build-dir c:\ncs\v2.0.2\nrf\samples\bluetooth\peripheral_lbs\build c:\ncs\v2.0.2\nrf\samples\bluetooth\peripheral_lbs --pristine --board nrf5340dk_nrf5340_cpuapp -- -DNCS_TOOLCHAIN_VERSION:STRING="NONE" -DBOARD_ROOT:STRING="c:/ncs/v2.0.2/nrf/samples/bluetooth/peripheral_lbs"

-- west build: generating a build system

Loading Zephyr default modules (Zephyr base).

-- Application: C:/ncs/v2.0.2/nrf/samples/bluetooth/peripheral_lbs

-- Found Python3: C:/ncs/toolchains/v2.0.2/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter

-- Cache files will be written to: C:/ncs/v2.0.2/zephyr/.cache

-- Zephyr version: 3.0.99 (C:/ncs/v2.0.2/zephyr)

-- Found west (found suitable version "0.13.1", minimum required is "0.7.1")

-- Board: nrf5340dk_nrf5340_cpuapp

-- Found host-tools: zephyr 0.14.1 (C:/ncs/toolchains/v2.0.2/opt/zephyr-sdk)

-- Found dtc: C:/ncs/toolchains/v2.0.2/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")

-- Found toolchain: zephyr 0.14.1 (C:/ncs/toolchains/v2.0.2/opt/zephyr-sdk)

-- Found BOARD.dts: C:/ncs/v2.0.2/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts

-- Generated zephyr.dts: C:/ncs/v2.0.2/nrf/samples/bluetooth/peripheral_lbs/build/zephyr/zephyr.dts

-- Generated devicetree_unfixed.h: C:/ncs/v2.0.2/nrf/samples/bluetooth/peripheral_lbs/build/zephyr/include/generated/devicetree_unfixed.h

-- Generated device_extern.h: C:/ncs/v2.0.2/nrf/samples/bluetooth/peripheral_lbs/build/zephyr/include/generated/device_extern.h

-- Including generated dts.cmake file: C:/ncs/v2.0.2/nrf/samples/bluetooth/peripheral_lbs/build/zephyr/dts.cmake

warning: the hex symbol NRF_MODEM_LIB_SHMEM_CTRL_SIZE (defined at C:\ncs\v2.0.2\nrf\lib\nrf_modem_lib\Kconfig.modemlib:130) has a non-hex default NRF_MODEM_SHMEM_CTRL_SIZE (undefined)

 

warning: the default selection OPENTHREAD_LIBRARY (undefined) of <choice OPENTHREAD_IMPLEMENTATION> (defined at C:\ncs\v2.0.2\nrf\subsys\net\openthread\Kconfig.defconfig:19, c:\ncs\v2.0.2\nrf\samples\bluetooth\peripheral_lbs\build\subsys\net\l2\openthread\Kconfig:35) is not contained in the choice

 

warning: the default selection OPENTHREAD_LIBRARY (undefined) of <choice OPENTHREAD_IMPLEMENTATION> (defined at C:\ncs\v2.0.2\nrf\subsys\net\openthread\Kconfig.defconfig:19, c:\ncs\v2.0.2\nrf\samples\bluetooth\peripheral_lbs\build\subsys\net\l2\openthread\Kconfig:35) is not contained in the choice

 

warning: HAS_NORDIC_DRIVERS (defined at c:\ncs\v2.0.2\nrf\samples\bluetooth\peripheral_lbs\build\modules\hal_nordic\Kconfig:11) has direct dependencies 0 with value n, but is currently being y-selected by the following symbols:

Parsing C:/ncs/v2.0.2/nrf/samples/bluetooth/peripheral_lbs/Kconfig

Loaded configuration 'C:/ncs/v2.0.2/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp_defconfig'

Merged configuration 'C:/ncs/v2.0.2/nrf/samples/bluetooth/peripheral_lbs/prj.conf'

 - SOC_SERIES_NRF53X (defined at c:\ncs\v2.0.2\nrf\samples\bluetooth\peripheral_lbs\build\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 c:\ncs\v2.0.2\nrf\samples\bluetooth\peripheral_lbs\build\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 c:\ncs\v2.0.2\nrf\samples\bluetooth\peripheral_lbs\build\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 c:\ncs\v2.0.2\nrf\samples\bluetooth\peripheral_lbs\build\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 c:\ncs\v2.0.2\nrf\samples\bluetooth\peripheral_lbs\build\drivers\clock_control\Kconfig.nrf:13), with value y, direct dependencies SOC_COMPATIBLE_NRF && CLOCK_CONTROL (value: y), and select condition !CLOCK_CONTROL_NRF_FORCE_ALT && SOC_COMPATIBLE_NRF && CLOCK_CONTROL (value: y)

 

warning: NRFX_CLOCK_LFXO_TWO_STAGE_ENABLED (defined at c:\ncs\v2.0.2\nrf\samples\bluetooth\peripheral_lbs\build\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 c:\ncs\v2.0.2\nrf\samples\bluetooth\peripheral_lbs\build\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_DPPI (defined at c:\ncs\v2.0.2\nrf\samples\bluetooth\peripheral_lbs\build\modules\hal_nordic\nrfx\Kconfig:26) has direct dependencies HAS_NRFX && 0 with value n, but is currently being y-selected by the following symbols:

 - UART_ENHANCED_POLL_OUT (defined at c:\ncs\v2.0.2\nrf\samples\bluetooth\peripheral_lbs\build\drivers\serial\Kconfig.nrfx:391), with value y, direct dependencies (UART_0_ENHANCED_POLL_OUT || UART_1_ENHANCED_POLL_OUT || UART_2_ENHANCED_POLL_OUT || UART_3_ENHANCED_POLL_OUT) && UART_NRFX && SERIAL (value: y), and select condition HAS_HW_NRF_DPPIC && (UART_0_ENHANCED_POLL_OUT || UART_1_ENHANCED_POLL_OUT || UART_2_ENHANCED_POLL_OUT || UART_3_ENHANCED_POLL_OUT) && UART_NRFX && SERIAL (value: y)

 

warning: NRFX_GPIOTE (defined at c:\ncs\v2.0.2\nrf\samples\bluetooth\peripheral_lbs\build\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 c:\ncs\v2.0.2\nrf\samples\bluetooth\peripheral_lbs\build\drivers\gpio\Kconfig.nrfx:4), with value y, direct dependencies SOC_FAMILY_NRF && GPIO (value: y), and select condition SOC_FAMILY_NRF && GPIO (value: y)

 

warning: NRFX_IPC (defined at c:\ncs\v2.0.2\nrf\samples\bluetooth\peripheral_lbs\build\modules\hal_nordic\nrfx\Kconfig:79) has direct dependencies HAS_NRFX && 0 with value n, but is currently being y-selected by the following symbols:

 - MBOX_NRFX_IPC (defined at C:\ncs\v2.0.2\zephyr\boards\arm\nrf5340dk_nrf5340\Kconfig.defconfig:86, c:\ncs\v2.0.2\nrf\samples\bluetooth\peripheral_lbs\build\drivers\mbox\Kconfig:18), with value y, direct dependencies y (value: y), and select condition HAS_HW_NRF_IPC && MBOX (value: y)

 

warning: NRFX_NVMC (defined at c:\ncs\v2.0.2\nrf\samples\bluetooth\peripheral_lbs\build\modules\hal_nordic\nrfx\Kconfig:93) has direct dependencies (n || n || y || n) && HAS_NRFX && 0 with value n, but is currently being y-selected by the following symbols:

 - SOC_FLASH_NRF (defined at c:\ncs\v2.0.2\nrf\samples\bluetooth\peripheral_lbs\build\drivers\flash\Kconfig.nrf:10), with value y, direct dependencies SOC_FAMILY_NRF && !FLASH_NRF_FORCE_ALT && FLASH (value: y), and select condition SOC_FAMILY_NRF && !FLASH_NRF_FORCE_ALT && FLASH (value: y)

error: Aborting due to Kconfig warnings

CMake Error at C:\ncs\v2.0.2\zephyr\cmake\modules\kconfig.cmake:290 (message):

  command failed with return code: 1

Call Stack (most recent call first):

  C:\ncs\v2.0.2\zephyr\cmake\modules\zephyr_default.cmake:121 (include)

  C:\ncs\v2.0.2\zephyr\share\zephyr-package\cmake\ZephyrConfig.cmake:51 (include)

  C:\ncs\v2.0.2\zephyr\share\zephyr-package\cmake\ZephyrConfig.cmake:76 (include_boilerplate)

  c:\ncs\v2.0.2\nrf\samples\bluetooth\peripheral_lbs\build\CMakeLists.txt:12 (find_package)

 

 

-- Configuring incomplete, errors occurred!

FATAL ERROR: command exited with status 1: 'c:\ncs\toolchains\v2.0.2\opt\bin\cmake.EXE' '-DWEST_PYTHON=c:\ncs\toolchains\v2.0.2\opt\bin\python.exe' '-Bc:\ncs\v2.0.2\nrf\samples\bluetooth\peripheral_lbs\build' '-Sc:\ncs\v2.0.2\nrf\samples\bluetooth\peripheral_lbs' -GNinja -DBOARD=nrf5340dk_nrf5340_cpuapp -DNCS_TOOLCHAIN_VERSION:STRING=NONE -DBOARD_ROOT:STRING=c:/ncs/v2.0.2/nrf/samples/bluetooth/peripheral_lbs

Let me know if you will be needing any additional information.

I have used this firmware development setup before with the Nordic nRF9160 DK with no major problems. Hopefully I can get some feedback as to what I'm doing wrong.

In addition the Device is not showing up in the device section and I have the Thingy:53 in MCUnoot mode? I don't think these are related but I thought I would mention it.

Kind Regards

Steve K

  • Hi Steve,

    Since I already have VS CODE, nRF Connect For VS Code Extensions, and nRF Connect SDK installed from a previous board
    • I Opened a new VS Code Workspace
    • By creating a blank folder and Opening VS code from that folder

    Based on the errors you get it looks like there is an issue with the toolchain. Please try to open VS Code from the toolchain manager by clicking on the "Open VS Code" button. There are ways of avoiding this step, but for now I recommend this to be sure that the environment is configured correctly.

    Then continue to follow the steps exactly as outlined (again, there are many ways of doing things, but I recommend following the instructions first to get a working configuration, then you can explore other methods).

    Once you have VS Code started and configured properly, and have the project, ensure the build configuration is set to build for thingy53_nrf5340_cpuapp. (Looking at the log I see you are building for nrf5340dk_nrf5340_cpuapp, which is not correct. That would not cause build problems though, but it will not work with the Thingy:53).

    In addition the Device is not showing up in the device section and I have the Thingy:53 in MCUnoot mode? I don't think these are related but I thought I would mention it.

    This is a separate matter, as you noted. The Thingy:53 does not have an onboard debugger, so you either need to connect an external debugger as explained in step 10 and in more detail here: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_thingy53_gs.html#updating-through-external-debug-probe .

  • Thanks for the reply. I'm working thru this now. I seemed to have gotten a build with no errors. but I'm not sure if I understand why? 

    Based on the errors you get it looks like there is an issue with the toolchain. Please try to open VS Code from the toolchain manager by clicking on the "Open VS Code" button. There are ways of avoiding this step, but for now I recommend this to be sure that the environment is configured correctly.

    I opened VS code as recommended. ,

    But once in VS code I did not have the "nRF Connect for VS code" icon in the my left toolbar?

    SO I went into Extensions and noticed that "nRF Connect for VS Code" needed to be "RELOADED". And all my other tools needed Preloading too.

    I also noticed that "nRF Connect Visual Studio Code Extension Pack" was ok? Not sure if this is the problem?

    I'm not able to "RELOAD TO ACTIVATE ".

    When I press the button I am return to a blank VS CODE extensities page and I receive a small dialog box in the bottom right as described.

    Not sure why?

    Is it because I have the two VS CODE tools installed:  "nRF Connect for VS Code" and  "nRF Connect Visual Studio Code Extension Pack" ?

    I have never had much luck opening VS Code from Toolchan Manager and I have don development with the nRF9160.. I was never able to get my environment. set up this way? 

    I can reproduce this every time I try the above steps on my machine?

    reading your next comment

    Once you have VS Code started and configured properly, and have the project, ensure the build configuration is set to build for thingy53_nrf5340_cpuapp. (Looking at the log I see you are building for nrf5340dk_nrf5340_cpuapp, which is not correct. That would not cause build problems though, but it will not work with the Thingy:53).

    I decided to continue and I tried to start fresh by getting into VS Code and the "nRF Connect Icon showed up now?

    I then loaded the same application  from the 2.0.0 ncs directory:

    • C:\ncs\v2.0.0\nrf\samples\bluetooth\peripheral_lbs

    I then Build the Configuration  NOW using your suggested "thingy53_nrf53040_cpuapp" and I get a good build.

    This must have been it. But I'm still confused at why "loading VsCode from Toolchain Manager is not Working?

    I'm still not out of the water yet looking forward to your outlook on this...

    Thanks for your quick response and assistance.

    Steve K

  • Hi again Einar,

    For my other problem 

    In addition the Device is not showing up in the device section and I have the Thingy:53 in MCUnoot mode? I don't think these are related but I thought I would mention it.

    This is a separate matter, as you noted. The Thingy:53 does not have an onboard debugger, so you either need to connect an external debugger as explained in step 10 and in more detail here: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_thingy53_gs.html#updating-through-external-debug-probe .

    I would like to use  the USB connection as described in https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_thingy53_gs.html#updating-through-usb

    Is there a way to do this in VS code?

    When I try to press the "refresh button in the device tab"

    The connection is not being done even though is shows up in Programmer?

    Has anyone used MCUBoot5 in VS code?

    Regards

    I guess my question is it possible to flash over USB Using VS Code and the nRF connection?  or Is there another way  to flash a VsCode BUILD?

    Regards

    Steve K

  • Hi Steve,

    SteveKay said:

    SO I went into Extensions and noticed that "nRF Connect for VS Code" needed to be "RELOADED". And all my other tools needed Preloading too.

    I also noticed that "nRF Connect Visual Studio Code Extension Pack" was ok? Not sure if this is the problem?

    This means that they have been updated but must be reloaded in order to use the latest. This in itself does not indicate a problem (and updates are pushed quite frequency), but you typically want to use the latest. If this was the first time you started VS Code after installing the extension (which happens when you launch it from the nRF Connect Toolchain app if they were not already installed), a reload is strictly needed, as that must be done in order to use the newly installed extension.

    SteveKay said:

    Not sure why?

    Is it because I have the two VS CODE tools installed:  "nRF Connect for VS Code" and  "nRF Connect Visual Studio Code Extension Pack" ?

    I don't know why you get the 404 or from where, unfortunately. Why do you need two VS Code installations?

    SteveKay said:
    I have never had much luck opening VS Code from Toolchan Manager and I have don development with the nRF9160.. I was never able to get my environment. set up this way? 

    By opening form the toolchain manager the environment from the toolchain manager is set up automatically. What did you miss by opening it like this?

    SteveKay said:
    I then Build the Configuration  NOW using your suggested "thingy53_nrf53040_cpuapp" and I get a good build.

    That is good.

    SteveKay said:
    This must have been it. But I'm still confused at why "loading VsCode from Toolchain Manager is not Working?

    I am not sure. I am also confused about you having two VS Code installations in parallelly. In any case, if you have problems opening from the toolchain manager, and/or want to open "manually" you can configure which toolchain is used etc. by Opening the nRF Connect welcome page and clicking "Quick setup"

    Then select here:

    Note that VS Code is a generic tool and we cannot know exactly which configuration all our customers will be using, so if you still have issues I would try going back to a clean VS Code installation (and only one!), delete preferences etc, and then open it from the toolchain manager so that you get the required plugins. That way it should work out of the box.

  • Hi Steve,

    SteveKay said:
    The connection is not being done even though is shows up in Programmer?

    You will only see J-Link debuggers here.

    SteveKay said:
    Has anyone used MCUBoot5 in VS code?

    There is currently no support for DFU (over USB, BLE or other transports) via nRF Connect for VS Code, so even if you use VS Code for building you will need to program using another tool.

Related