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

  • Hello,

    Much like abvio, replicating your diagnostic actions just results in "No Matching commands". However, if I look at VSCode's settings under the workspace tab I can find what I think your'e looking for:

    Topdir is set to "${nrf-connect.sdk:1.9.0}"

  • Hi,

    The actual command I wanted you to try was CMD+SHIFT+P. It was a mistake on my side.
    Your output Griffin is the one I was expecting to see.

    Best regards,
    Dejan

  • Hi Dejans,

    Now that Griffin and I have provided the information you asked for, what can we do to resolve this issue and build our projects? 

    My project has been dead in the water now for two weeks, and getting DFU to compile and work is critical path. 

    Best,

    Steve

  • Hi Steve,

    Toolchain Manager checks if VS Code is installed. M1 would require the Intel version of the VS Code.

    As you have installed all that you need using Toolchain Manager, it means that the environment should be set correctly and this should be enough for nRF Connect SDK and toolchain to be recognized by the VS Code extension.

    Based on the following comment

    GriffinMeyer said:
    I've seen other posts that suggest a full re-install of ALL nordic tools AND (Intel)VSCode will make it so that VS code can properly build projects with MCU Boot, but Connect for desktop is still unable to actually open Intel VSCode on its own.

    I would suggest that you reinstall the Intel version of VS Code  and nRF Command Line Tools, and then open VS Code in a regular way (not through Toolchain Manager). In VS Code nRF Connect extension, you should be able to see nRF Connect SDK and Toolchain.

    Best regards,
    Dejan

  • Hi Dejan,

    Unfortunately, a complete reinstallation of Intel versions of VS Code, nRF Connect, nRF Command Line Tools, and the nRF v1.9.1 SDK still leads to the very same errors that Griffin and I have been describing.

    Here is the repro sequence:

    1. Get an M1 Mac.

    2. Follow these instructions to delete VS Code:
    jimkang.medium.com/complete-uninstall-remove-vscode-mac-5e48bef3bdec

    3. Delete nRF Connect for Desktop.

    4. rm -rf ~/Library/Application\ Support/nrfconnect

    5. Install Intel version of VS Code.

    6. Install nRF Connect for Desktop.

    7. Install Intel version of nRF Command Line Tools.

    8. Install Intel version of Jlink.

    9. Follow these directions to create the ble_dfu_peripheral_lbs sample app.
    devzone.nordicsemi.com/.../ncs-dfu

    10. Get errors listed below.

    It would be very helpful if someone at Nordic attempted to use these steps to verify if there's a bug or not. I can imagine that many developers trying to incorporate MCUBOOT are experiencing the same thing as Griffin and me.

    Best,

    Steve


    /opt/nordic/ncs/v1.9.1/zephyr/scripts/kconfig/kconfig.py: /opt/nordic/ncs/v1.9.1/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.9.1/zephyr'). Also note that unset environment variables expand to the empty string.
    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/ble_dfu_peripheral_lbs/build/CMakeLists.txt:44 (find_package)

    P.S. If I try setting the ZEPHYR_NRF_MODULE_DIR environment variable in my zsh, it gets different errors starting with:

    -- Including generated dts.cmake file: /Users/Steve/Projects/ble_dfu_peripheral_lbs/build/mcuboot/zephyr/dts.cmake

    warning: the hex symbol PM_PARTITION_SIZE_MCUBOOT (defined at /opt/nordic/ncs/v1.9.1/nrf/modules/mcuboot/boot/zephyr/Kconfig:21, /opt/nordic/ncs/v1.9.1/nrf/modules/mcuboot/boot/zephyr/Kconfig:26, /opt/nordic/ncs/v1.9.1/nrf/modules/mcuboot/boot/zephyr/Kconfig:32) has a non-hex default FPROTECT_BLOCK_SIZE (undefined)

Reply
  • Hi Dejan,

    Unfortunately, a complete reinstallation of Intel versions of VS Code, nRF Connect, nRF Command Line Tools, and the nRF v1.9.1 SDK still leads to the very same errors that Griffin and I have been describing.

    Here is the repro sequence:

    1. Get an M1 Mac.

    2. Follow these instructions to delete VS Code:
    jimkang.medium.com/complete-uninstall-remove-vscode-mac-5e48bef3bdec

    3. Delete nRF Connect for Desktop.

    4. rm -rf ~/Library/Application\ Support/nrfconnect

    5. Install Intel version of VS Code.

    6. Install nRF Connect for Desktop.

    7. Install Intel version of nRF Command Line Tools.

    8. Install Intel version of Jlink.

    9. Follow these directions to create the ble_dfu_peripheral_lbs sample app.
    devzone.nordicsemi.com/.../ncs-dfu

    10. Get errors listed below.

    It would be very helpful if someone at Nordic attempted to use these steps to verify if there's a bug or not. I can imagine that many developers trying to incorporate MCUBOOT are experiencing the same thing as Griffin and me.

    Best,

    Steve


    /opt/nordic/ncs/v1.9.1/zephyr/scripts/kconfig/kconfig.py: /opt/nordic/ncs/v1.9.1/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.9.1/zephyr'). Also note that unset environment variables expand to the empty string.
    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/ble_dfu_peripheral_lbs/build/CMakeLists.txt:44 (find_package)

    P.S. If I try setting the ZEPHYR_NRF_MODULE_DIR environment variable in my zsh, it gets different errors starting with:

    -- Including generated dts.cmake file: /Users/Steve/Projects/ble_dfu_peripheral_lbs/build/mcuboot/zephyr/dts.cmake

    warning: the hex symbol PM_PARTITION_SIZE_MCUBOOT (defined at /opt/nordic/ncs/v1.9.1/nrf/modules/mcuboot/boot/zephyr/Kconfig:21, /opt/nordic/ncs/v1.9.1/nrf/modules/mcuboot/boot/zephyr/Kconfig:26, /opt/nordic/ncs/v1.9.1/nrf/modules/mcuboot/boot/zephyr/Kconfig:32) has a non-hex default FPROTECT_BLOCK_SIZE (undefined)

Children
Related