Sudden Build Errors in Visual Studio Code

Hello,

Up until today I had been developing fine with visual studio code, installed via Toolchain Manager. Then, I clicked "Pristine Build" for the first time in a few days. All of a sudden the build failed and now nothing requiring MCUboot will build properly. 

The error I'm seeing is this, when the build gets to the stage of building McuBoot:

/opt/nordic/ncs/v1.8.0/zephyr/scripts/kconfig/kconfig.py: /opt/nordic/ncs/v1.8.0/bootloader/mcuboot/boot/zephyr/Kconfig:11: '/modules/mcuboot/boot/zephyr/Kconfig' not found (in 'source "$(ZEPHYR_NRF_MODULE_DIR)/modules/mcuboot/boot/zephyr/Kconfig"'). Check that environment variables are set correctly (e.g. $srctree, which is set to '/opt/nordic/ncs/v1.8.0/zephyr'). Also note that unset environment variables expand to the empty string.

 

I've tried: 

Uninstalling and re-installing nRF Connect SDK v1.8.0 from the Toolchain manager

Uninstalling and reinstalling Visual Studio code, and then all of its required plugins via Toolchain Manager.

Building a default project that utilizes Mcuboot, that build also fails in the same way that mine does.

An additional thing of note is that when I click "Open VS Code" from within toolchain manager, it will never actually open VS Code. If code isn't installed or is missing plugins, then it will suggest I install them, but then it will just sit on the "Checking iv VS Code and dependencies are installed" screen indefinitely, never doing anything after that.

I am on an M1 Mac, and I am using all Intel versions of software, as suggested. 

Again, everything was working fine yesterday. I have no idea what could have caused this. I hope you guys will have some ideas!

Thanks

Parents
  • In an attempt at debugging, I installed the 1.7.1 SDK, that provides me with a ton of "warning: the hex symbol PM_PARTITION_SIZE_MCUBOOT  has a non-hex default FPROTECT_BLOCK_SIZE (undefined)" errors on MCUBoot build. It seems as if something is severely broken in my mcuboot files, but re-installing does nothing...

  • Hi,

    Could you please send us "Generate Support Information"?
    In order to get this report, please open VS Code, press Cmd-Shift-P on a Mac (Ctrl-Shift-P on a Mac) and start typing "Generate Support Information". The report will be opened in the Output pane. Please copy this report and send it back to me.

    In addition, please try building the application with the "west" command line tool and check the status of the west manifest as described in the documentation. Afterwards, please provide information on the results.

    Best regards,
    Dejan

  • Hi ,

    I'd like to get clarity on a few things.

    1) Do the errors Steve is getting make sense to anyone on the Nordic team? Are they the result of something specifically not being installed, and/or properly configured?

    2) It seems like re-installing sometimes fixes the problem, but not always. It has not fixed it on one of my machines, and I am only able to build on a brand new M1 MacBook. My guess is that something is not being properly configured during the install process, or something was misconfigured and is sticking around despite an uninstall/reinstall. I'm hoping the Nordic dev team is able to understand exactly what that is given the repeating error messages about environment variables. It would be preferable to get to the actual root source of the problem as re-installing an entire development suite takes time and I worry about having to do that every single update. Not to mention it seems to sometimes NOT fix the problem and I'd hate to be in production and unable to release a new version of firmware.

    3) There is still the core issue of Toolchain Manager refusing to open the Intel version of VSCode. Is this something the Nordic team is able to reproduce? It is happening on both of my M1 machines, for Steve, as well as the user from this post. If nordic devs are not able to reproduce this problem, perhaps there is something that is sticking around on their machines that is causing everything to work properly, even after a reinstall?

    I'm really hoping to get to the root of the problem and fully understand it so that I know how to fix it if it ever happens in the future, and hoping that a full re-install works is not an optimal solution.

  • Hi Griffin,

    I completely understand your eagerness to find the root cause of the problem and I am willing to help.

    Could you please try the following
    Open Toolchain Manager and open command prompt.
    1. Try building application which contains MCUboot, such as asset tracker v2. Does it succeed? Are there any errors?
    2. Try building the same application using VS Code. Does it succeed? Are there any errors?

    Best regards,
    Dejan

  • Hi Dejans,

    Has anyone at Nordic taken a Mac with M1 and tried to build the ble_dfu_peripheral_lbs sample as I described in my repro sequence from last Friday? I would think doing so would short cut all this back and forth.

    To keep this moving forward, I just attempted the instructions you gave for Griffin.

    I created the asset_tracker_v2 application from sample. (As a freestanding app.) It failed to configure, and after a pristine build, here is the error log.

    =================================================================== begin error log

    > Executing task: nRF Connect: Generate config nrf52840dk_nrf52840 for /Users/Steve/Projects/asset_tracker_v2 <

    Building asset_tracker_v2
    west build --build-dir /Users/Steve/Projects/asset_tracker_v2/build /Users/Steve/Projects/asset_tracker_v2 --pristine --board nrf52840dk_nrf52840 -- -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=On -DNCS_TOOLCHAIN_VERSION:STRING="NONE" -DCONFIG_DEBUG_OPTIMIZATIONS=y -DCONFIG_DEBUG_THREAD_INFO=y -DBOARD_ROOT:STRING="/Users/Steve/Projects/asset_tracker_v2"

    -- west build: generating a build system
    Including boilerplate (Zephyr base): /opt/nordic/ncs/v1.9.1/zephyr/cmake/app/boilerplate.cmake
    -- Application: /Users/Steve/Projects/asset_tracker_v2
    -- Zephyr version: 2.7.99 (/opt/nordic/ncs/v1.9.1/zephyr), build: v2.7.99-ncs1-1
    -- Found Python3: /opt/nordic/ncs/v1.9.1/toolchain/opt/[email protected]/bin/python3.9 (found suitable exact version "3.9.6") found components: Interpreter
    -- Found west (found suitable version "0.12.0", minimum required is "0.7.1")
    -- Board: nrf52840dk_nrf52840
    -- Cache files will be written to: /Users/Steve/Library/Caches/zephyr
    -- Found dtc: /opt/nordic/ncs/v1.9.1/toolchain/bin/dtc (found suitable version "1.6.1", minimum required is "1.4.6")
    -- Found toolchain: gnuarmemb (/opt/nordic/ncs/v1.9.1/toolchain)
    -- Found BOARD.dts: /opt/nordic/ncs/v1.9.1/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts
    -- Generated zephyr.dts: /Users/Steve/Projects/asset_tracker_v2/build/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: /Users/Steve/Projects/asset_tracker_v2/build/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: /Users/Steve/Projects/asset_tracker_v2/build/zephyr/include/generated/device_extern.h
    -- Including generated dts.cmake file: /Users/Steve/Projects/asset_tracker_v2/build/zephyr/dts.cmake

    warning: Experimental symbol NET_SOCKETS_OFFLOAD is enabled.


    warning: NRF_MODEM_LIB (defined at /opt/nordic/ncs/v1.9.1/nrf/lib/nrf_modem_lib/Kconfig:6) has direct dependencies SOC_NRF9160_SICA with value n, but is currently being y-selected by the following symbols:
    - MODEM_INFO (defined at /opt/nordic/ncs/v1.9.1/nrf/lib/modem_info/Kconfig:7), with value y, direct dependencies y (value: y)

    error: Aborting due to Kconfig warnings

    Parsing /Users/Steve/Projects/asset_tracker_v2/Kconfig
    Loaded configuration '/opt/nordic/ncs/v1.9.1/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840_defconfig'
    Merged configuration '/Users/Steve/Projects/asset_tracker_v2/prj.conf'
    Merged configuration '/Users/Steve/Projects/asset_tracker_v2/build/zephyr/misc/generated/extra_kconfig_options.conf'
    CMake Error at /opt/nordic/ncs/v1.9.1/zephyr/cmake/kconfig.cmake:272 (message):
    command failed with return code: 1
    Call Stack (most recent call first):
    /opt/nordic/ncs/v1.9.1/zephyr/cmake/app/boilerplate.cmake:544 (include)
    /opt/nordic/ncs/v1.9.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
    /opt/nordic/ncs/v1.9.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
    /Users/Steve/Projects/asset_tracker_v2/build/CMakeLists.txt:9 (find_package)


    -- Configuring incomplete, errors occurred!
    FATAL ERROR: command exited with status 1: /opt/nordic/ncs/v1.9.1/toolchain/bin/cmake -DWEST_PYTHON=/opt/nordic/ncs/v1.9.1/toolchain/opt/[email protected]/bin/python3.9 -B/Users/Steve/Projects/asset_tracker_v2/build -S/Users/Steve/Projects/asset_tracker_v2 -GNinja -DBOARD=nrf52840dk_nrf52840 -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=On -DNCS_TOOLCHAIN_VERSION:STRING=NONE -DCONFIG_DEBUG_OPTIMIZATIONS=y -DCONFIG_DEBUG_THREAD_INFO=y -DBOARD_ROOT:STRING=/Users/Steve/Projects/asset_tracker_v2
    The terminal process terminated with exit code: 1.

    Terminal will be reused by tasks, press any key to close it.

    > Executing task: nRF Connect: Dynamic Build Task <

    Building asset_tracker_v2
    west build --build-dir /Users/Steve/Projects/asset_tracker_v2/build /Users/Steve/Projects/asset_tracker_v2 --pristine --board nrf52840dk_nrf52840 -- -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=On -DNCS_TOOLCHAIN_VERSION:STRING="NONE" -DBOARD_ROOT:STRING="/Users/Steve/Projects/asset_tracker_v2" -DCONFIG_DEBUG_OPTIMIZATIONS:STRING="y" -DCONFIG_DEBUG_THREAD_INFO:STRING="y" -DCONF_FILE:STRING="/Users/Steve/Projects/asset_tracker_v2/prj.conf"

    -- west build: generating a build system
    Including boilerplate (Zephyr base): /opt/nordic/ncs/v1.9.1/zephyr/cmake/app/boilerplate.cmake
    -- Application: /Users/Steve/Projects/asset_tracker_v2
    -- Zephyr version: 2.7.99 (/opt/nordic/ncs/v1.9.1/zephyr), build: v2.7.99-ncs1-1
    -- Found Python3: /opt/nordic/ncs/v1.9.1/toolchain/opt/[email protected]/bin/python3.9 (found suitable exact version "3.9.6") found components: Interpreter
    -- Found west (found suitable version "0.12.0", minimum required is "0.7.1")
    -- Board: nrf52840dk_nrf52840
    -- Cache files will be written to: /Users/Steve/Library/Caches/zephyr
    -- Found dtc: /opt/nordic/ncs/v1.9.1/toolchain/bin/dtc (found suitable version "1.6.1", minimum required is "1.4.6")
    -- Found toolchain: gnuarmemb (/opt/nordic/ncs/v1.9.1/toolchain)
    -- Found BOARD.dts: /opt/nordic/ncs/v1.9.1/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts
    -- Generated zephyr.dts: /Users/Steve/Projects/asset_tracker_v2/build/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: /Users/Steve/Projects/asset_tracker_v2/build/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: /Users/Steve/Projects/asset_tracker_v2/build/zephyr/include/generated/device_extern.h
    -- Including generated dts.cmake file: /Users/Steve/Projects/asset_tracker_v2/build/zephyr/dts.cmake

    warning: Experimental symbol NET_SOCKETS_OFFLOAD is enabled.


    warning: NRF_MODEM_LIB (defined at /opt/nordic/ncs/v1.9.1/nrf/lib/nrf_modem_lib/Kconfig:6) has direct dependencies SOC_NRF9160_SICA with value n, but is currently being y-selected by the following symbols:
    - MODEM_INFO (defined at /opt/nordic/ncs/v1.9.1/nrf/lib/modem_info/Kconfig:7), with value y, direct dependencies y (value: y)

    error: Aborting due to Kconfig warnings

    Parsing /Users/Steve/Projects/asset_tracker_v2/Kconfig
    Loaded configuration '/opt/nordic/ncs/v1.9.1/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840_defconfig'
    Merged configuration '/Users/Steve/Projects/asset_tracker_v2/prj.conf'
    Merged configuration '/Users/Steve/Projects/asset_tracker_v2/build/zephyr/misc/generated/extra_kconfig_options.conf'
    CMake Error at /opt/nordic/ncs/v1.9.1/zephyr/cmake/kconfig.cmake:272 (message):
    command failed with return code: 1
    Call Stack (most recent call first):
    /opt/nordic/ncs/v1.9.1/zephyr/cmake/app/boilerplate.cmake:544 (include)
    /opt/nordic/ncs/v1.9.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
    /opt/nordic/ncs/v1.9.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
    /Users/Steve/Projects/asset_tracker_v2/build/CMakeLists.txt:9 (find_package)


    -- Configuring incomplete, errors occurred!
    FATAL ERROR: command exited with status 1: /opt/nordic/ncs/v1.9.1/toolchain/bin/cmake -DWEST_PYTHON=/opt/nordic/ncs/v1.9.1/toolchain/opt/[email protected]/bin/python3.9 -B/Users/Steve/Projects/asset_tracker_v2/build -S/Users/Steve/Projects/asset_tracker_v2 -GNinja -DBOARD=nrf52840dk_nrf52840 -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=On -DNCS_TOOLCHAIN_VERSION:STRING=NONE -DBOARD_ROOT:STRING=/Users/Steve/Projects/asset_tracker_v2 -DCONFIG_DEBUG_OPTIMIZATIONS:STRING=y -DCONFIG_DEBUG_THREAD_INFO:STRING=y -DCONF_FILE:STRING=/Users/Steve/Projects/asset_tracker_v2/prj.conf
    The terminal process terminated with exit code: 1.

    Terminal will be reused by tasks, press any key to close it.

    =================================================================== end error log

    When I tried your first instruction to build from the terminal, I got the following.

    west build --build-dir /Users/Steve/Projects/asset_tracker_v2/build /Users/Steve/Projects/asset_tracker_v2 --pristine --board nrf52840dk_nrf52840 -- -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=On -DNCS_TOOLCHAIN_VERSION:STRING="NONE" -DCONFIG_DEBUG_OPTIMIZATIONS=y -DCONFIG_DEBUG_THREAD_INFO=y -DBOARD_ROOT:STRING="/Users/Steve/Projects/asset_tracker_v2"
    usage: west [-h] [-z ZEPHYR_BASE] [-v] [-V] <command> ...
    west: error: argument <command>: invalid choice: 'build' (choose from 'init', 'update', 'list', 'manifest', 'diff', 'status', 'forall', 'help', 'config', 'topdir', 'selfupdate')

    Looking forward to getting this resolved. 

    Best,

    Steve

  • Hi Steve,

    Could you try using nrf9160dk_nrf9160_ns board instead of nrf52840dk_52840 when building asset_tracker_v2?
    Please provide the same log as you did for nrf52840dk.

    When you run west build command, Zephyr_base cannot be found. In order to fix this, run the following:
    1. open terminal in the Toolchain Manager
    2. run "source /opt/nordic/ncs/v1.9.1/zephyr/zephyr-env.sh"
    3. navigate to the project folder
    4. run "rm -r build"
    5. run "west build -b nrf9160dk_nrf9160_ns"

    Best regards,
    Dejan

  • Where exactly *is* ZEPHYR_NRF_MODULE_DIR defined?  I can't find a single spot in the SDK or cmake packages where it is set.  It gets set by including the Zephyr package, but magically somehow?  I can't build on a new machine using an exact copy of code/sdk from a PC that works fine because of the same error shown above (this setting not defined)

Reply Children
Related