nRF Connect - nRF Connect for VS Code
Skip to content

Version 2022.7.111

Welcome to the July 2022 release of nRF Connect for VS Code.

This release, we have been working on improving the following areas:

2022.7.242 additionally fixes the following issues:

  • Edit build configuration: Some CMake variables were dropped when editing build configurations.
  • Copy build command: When pressing "Copy Build Command" on a build configuration, a quick pick to select the build would appear, even when the build should have been inferred from the menu location.
  • Zephyr SDK: The toolchain validation check assumed that the Zephyr SDK would contain tools like Python, but these should be pulled from the general environment. This caused the validation to produce false negatives.
  • Toolchain refresh button: The toolchain refresh button would grow to the height of the toolchain validation widget when it should have just stayed the same height.
  • Toolchain environment: The toolchain environment build process was broken on Windows, causing the nRF Connect toolchain's environment to lack critical path entries.
  • Unintented file creation: The extension would spawn a file called "0" in VS Code's working directory on startup on Linux and Mac.
  • Removed color theme: The bundled color theme would be enabled by default when the extension was installed. This behavior is way more intrusive than intended, so we have disabled the color theme for now.

Memory report viewer

For this release, we have extracted the Kconfig menu tree structure from the nRF Kconfig extension into a generic UI component, which allows us to create a more dynamic representation of the Memory report's output. The Memory report is displayed in a searchable, interactive tree structure with one tab for each of the two reports.

In addition to showing the individual and accumulated memory usage for each symbol in the application image, the Memory report also lets you go to the location of each symbol in the source files through a right-click menu.

Previously, the Memory report command would create and display a static ASCII-based tree representation of the Memory report in the Editor. While the Memory report can be a very powerful tool, this output format was limited and hard to navigate.

New memory report tree structure

Experimental debug adapter

We have created a new, experimental debug adapter for the extension.

nRF Connect for VS Code extension currently uses the Cortex-Debug extension, which is a third-party debugging extension for all Cortex-M based embedded devices. Although this project has become a common VS Code extension for debugging embedded devices, we received an increasing number of reports about crashes and erratic behavior in the debugging experience with Nordic devices.

The distribution mechanism for VS Code extensions limits our ability to sufficiently test new releases of third-party extensions like Cortex-Debug. Due to the extension's large set of supported devices and its frequent releases, we do not think we will be able to support the project to a level where we can guarantee the best debugging experience. As a result, we have decided to gradually replace Cortex-Debug with Microsoft's debug adapter.

Microsoft's debug adapter is the back end for Visual Studio's GDB integration and their C/C++ VS Code extension's debugger. It is a mature project with a large user base, and offers a quick and stable debugger implementation.

As Microsoft's debug adapter does not exclusively target embedded devices, it is missing a few features from Cortex-Debug and struggles to keep up with some of the quirks of SEGGER's J-Link GDB Server. To address these issues and ensure that we are in control of the release cadence and quality, we are now distributing a debug adapter with the extension.

For this release, the new debug adapter is still experimental, and disabled by default. To control which debug adapter is being used, we have added a new nrf-connect.debugging.backend. When launching debugging from the Sidebar, or through the nrf-connect debug configuration, VS Code will use this setting to determine which debug adapter to use.

Current implementation features

For now, the new debug adapter only provides a minimal debugging experience, and we will be working on adding the following features over the next couple of releases:

  • Device reset button
  • Peripheral view
  • Memory view
  • Thread view
  • Exception debugging
  • System status

We will also continue to improve the debugger's stability and performance. We do not recommend switching to the new debug adapter for daily work just yet, but if you want to try it and provide feedback, we would like to hear it.

Shield support

We have added support for Zephyr shields. Shields are hardware modules that you can attach to your board to add specific functionality through a set of devicetree and Kconfig files. Shields are now automatically added to the devicetree evaluation, and the Shield's devicetree overlay files will now show up in the Sidebar.

To add shields to a build, add -DSHIELD=<shield-name> to the Extra CMake arguments field when adding a build configuration.

CMake Presets schema

We have added a JSON schema for the CMake Preset files that were introduced in the June release. This adds error checking and auto-completion in the CMakePresets.json file.

Workspace configuration for applications

When creating a freestanding application in an existing workspace, it is no longer possible to select which Software Development Kit (SDK) to create the application from. The selected SDK is configured per VS Code workspace, and creating applications from different SDK versions will cause conflicts in the build system, as well as potential API mismatches when applications are rebuilt against a new SDK version.

To prevent this, the Create a new application wizard now prevents you from creating freestanding applications from SDKs that do not match your workspace's selected SDK.

IntelliSense configuration

We have disabled the build system problem-matcher for C code, as it duplicates the IntelliSense errors, but does not update the errors as you edit. The problem-matcher can be reinstated by binding custom tasks to the build action, if preferred.

We have also silenced warnings in Zephyr's LOG_XXX macros by enabling the __CDT_PARSER__ define, which instructs IntelliSense to skip log macro parsing altogether.

Build configuration creation

If a prj.conf file was selected in the Generate Build Configuration screen, it was not possible to deselect it. We have now added an option to the drop-down menu that represents "no prj.conf selection", which will cause west to perform its default behavior.

We have also addressed an issue where the Edit Build Configuration form would default to the Compatible boards or Nordic boards selection, which might not contain the board associated with the build configuration being edited. We now default to All boards when editing.

Additional actions in Views

We have moved more actions into context menus in an ongoing effort to reduce some of the clutter in the Views, and to clarify the actions of the icons that were previously there.

These context menus can both be accessed from within a View: click on the ... button to access More actions... on the right of the selected item.

Device handling

Several changes have been made in this release related to device handling, including changes to the Connected Devices View.

Custom task binding

If a custom task is bound to a build action, the extension will now execute this bound task before flashing, instead of the standard build task.

Connected Devices View actions menu

The Connected Devices View contained icons that did not clearly represent their associated actions for a connected device. We have now updated the UI so that only two icons appear to the right of the device: Reset Board and the ... menu icon to access More actions.

Connected Devices View

More actions... includes actions that were previously accessible as icons. Read more about the actions available in the Navigating the UI page.

Warning before erasing

The extension will now warn you before performing any action that will permanently erase the device flash.

Warning message before permanently erasing the device flash

Startup time improvements

The extension's growing feature set has gradually increased the startup time for the application sidebar. For this release, we have addressed some of the biggest bottlenecks in the extension's activation. While there is still some work to do, the nRF Connect extensions' activation time should be reduced by about 30% in this release, compared to the June release.

Creating an application improvements

We have made some tweaks to the Create a new application wizard based on user feedback. The improvements made were:

  • When a new application is created (freestanding or workspace) or an application is imported, the nRF Connect Sidebar Views will now be focused, and the added application becomes the active one.
  • We renamed the Create a new application from sample wizard to Create a new application to make it easier to distinguish from the Add an existing application wizard.
  • The button that launches the sample browser has been renamed from Select... to Browse....
  • We have fixed an issue in the sample browser that caused it to crash when attempting to filter for a specific feature.

Other improvements

These focus mostly on consistency within VS Code, minor performance enhancements, and quality-of-life changes.

Updated UI terms

We have updated how we refer to the UI in this release, to follow VS Code's UX guidelines. Some main changes include using the term Views instead of "Panels", when applicable, and more. See the Navigating the UI page to see how we now refer to specific parts of the UI for our extensions.

Disabling automatic application switching

We have added a new configuration option to disable the automatic application switching based on the open file. The new option is named nrf-connect.activeAppFollowActiveEditor, and can be controlled through the VS Code settings editor. Read more about this setting in the Settings and commands page.

Shortened file search include filter

The Search in These Files feature introduced in the previous release would frequently fail for large applications, as the list of files added to the search's include filter was too long.

Although this underlying issue in VS Code is still unresolved, we were able to reduce how often this was triggered by trimming down the filter's include results significantly. On average, the file search should now be able to handle file lists that are twice as long.

Add prefix to Add Folder As Application in menu

The Add Folder As Application item in the right-click context menu has been updated to include an nRF Connect prefix to make it clearer both what extension is providing the item and what the expected outcome is. It now reads as nRF Connect: Add Folder As Application.

Generate Support Information from the Welcome View

To make it easier to find, we have added the Generate Support Information action to the Welcome View in the nRF Connect Sidebar Views. This creates a log in the Output Panel View that you can copy and forward to the Nordic DevZone to provide more context for an issue.

Generate Support Information

Bug fixes

We have fixed several bugs in this release, and here are the most relevant ones.

Don't write shell env command to history

To recreate the command line environment, the extension launches a terminal session as part of the startup procedure. Previously, this caused the extension to append echo ZEPHYR_BASE=${ZEPHYR_BASE} to the shell history file on startup. We have changed the approach for getting this environment, and the extension will no longer pollute the command line history.

Fix issue when prj*.conf file was reported not present on disk

The extension scans through the build configuration's CMake cache to determine whether all configuration files are still present on the disk, to try to catch build failures for this before they happen. Unfortunately, there was a bug in the cache resolution that caused the extension to look for the wrong entry for .conf files, which we have now fixed.