Version 2022.6.22¶
Welcome to the June 2022 release of nRF Connect for VS Code.
This release, we have been working on improving the following areas:
- Generate build configuration
- Workspace configuration
- Create application workflow
- Task execution
- Searching in the project
- Build configurations
- Other improvements
- Bug fixes
2022.6.142 additionally addresses the following issues:¶
- Task bindings: Include full workspace path in bindings configuration insertion to avoid ambiguous bindings.
- Tool checker: Remove version check on
gn
, which now uses the SHA for versioning. - Debugging: Help Cortex Debug find
objcopy
andnm
within the nRF Connect SDK 2.0 toolchain. - CMake Presets: Add
NCS_TOOLCHAIN_VERSION=None
to presets to ensure the preset behaves the same on the command line and in VS Code. - Sidebar: Re-introduce right-click menu on build configuration entries.
- Toolchain: Detect raw Zephyr SDK installations without additional environment changes.
Generate build configuration¶
Classifying applications and project configuration files¶
We improved how an application source folder is classified. Now, any folder that has a CMakeLists.txt
file that defines a project or looks for the Zephyr package are classified as an application source. The logic for determining what constitutes a valid nRF Connect application has been relaxed slightly to ensure that the extension is not preventing valid applications from being added to the sidebar. Previously, the extension used to require either a prj.conf
file or a sample.yaml
file to be present in the application directory, which is no longer the case for nRF Connect SDK applications.
Added a multi-select component¶
We have updated the multi-select UI component to better support long filenames and argument lists. The new component is currently used in the Kconfig fragment selector and the extra CMake arguments fields, which is no longer a single text box.
Editing build configurations¶
You can now edit an existing build configuration. Click on the menu icon called More Actions... on the build folder in the Applications panel, and then click on Edit Build Configuration. This opens a new tab with a form for editing the build configuration parameters. Once you are finished, press Build Configuration to regenerate the build configuration and overwrite the contents of the build folder.
The Extra CMake Arguments field is populated by inspecting the CMakeCache
file. It is only possible to populate CMake variables declared with the -D
command line option and not other command line flags, as there is no record of them being stored in the build.
Saving and sharing build configurations¶
When collaborating with others, being able to share and reproduce build configurations across different machines becomes increasingly important as the project grows in complexity. Although this could be achieved by sharing the west build invocation, it is an error-prone and painful workflow, and the VS Code extension hasn't supported this properly until now.
We have now added the ability to save and load build configurations as CMake Presets. CMake Presets are build configuration templates, that can be passed to CMake to produce a build that has the exact same parameters without having to store the CMake command line arguments. CMake Presets are stored in a CMakePresets.json
file in the application directory. Presets can be checked into source control to make sure that all developers working on the same application can build with exactly the same parameters without having to manually copy the parameters.
You can save existing build configurations as presets with the new Save Configuration As Preset action in the Applications panel. Click the menu icon in the top level build configuration called More Actions..., and click on Save Configuration as Preset to use this action, as shown below.
nRF Connect: Save Configuration as Preset
is also available through the Command Palette. This opens a quick-pick selection of a build configuration, then saves it to the CMakePresets.json
file.
When presets are available for an application, a preset selection box will appear at the top of the Add Build Configuration window. When a preset is selected, it fills in the rest of the fields. You can make changes to the fields before building, or press Ctrl-Enter to build right away. You can also populate build configurations from a preset.
The newly created file can be used to generate new builds by using:
west build -d ${targetDir} -- --preset ${presetName} -DNCS_TOOLCHAIN_VERSION=NONE
Workspace configuration¶
Inferring a single workspace SDK¶
When opening a directory that contains an installation of the nRF Connect SDK, or that is part of an SDK installation, the extension will now force all applications in the workspace to build with this installation of the SDK. Previously, there was no way of preventing you from selecting other SDKs in the workspace settings. Depending on the application's location, the build system could have ended up overriding this decision anyway, causing confusion and build errors. You now receive an error messaging and prevention methods that inform you when an SDK is inferred from a workspace, and you cannot select another.
We also added checks to prevent:
- multiple inferred SDKs
- creating a workspace application if there is one SDK already inferred
-
selecting different SDKs other than the one inferred in:
-
Welcome Page > Quick Setup
-
Create a new application from sample
-
Improve when invalid nRF Connect SDK message is shown¶
We previously showed a warning message whenever an invalid topdir
was browsed. However, the select component automatically selects the last valid topdir
, so this did not make sense in the context of what was shown on the screen. We now show a temporary notification to make it less confusing.
Create application workflow¶
Prevent creating an application under an invalid path¶
We now prevent creating an application under a path that could contain invalid characters, especially spaces, since they break the build system.
Reloading opened samples in the sample browser¶
Clicking on a sample that is already opened in the Sample Browser will now take you back to the original sample documentation page if you followed any links in the README
file.
Task execution¶
Bind custom tasks to actions¶
You can now bind custom tasks defined in the workspace's tasks.json
file to the Build and Flash actions. The configured tasks are executed in place of the standard Build and Flash tasks, allowing you to fully customize these task executions. The task bindings are stored in the workspace settings, and can be checked into source control alongside the tasks.json
file to share the same setup across different environments.
Searching in the project¶
Search for the selected text from the editor in Nordic help resources¶
You can now search official documentation and help-sites for text you have highlight in the editor. Right-click the context menu provides and click on Search in Nordic's Resources to see search either in Nordic DevZone or the nRF Connect SDK documentation. If you run Search in Nordic DevZone or Search in nRF Connect SDK Documentation through the Command Palette without a text selection, an input box will appear for you to enter your search query.
Searching only in files that are part of a build configuration¶
In the Details panel, you can now click on the magnifying glass icon to the right of a folder name to search for files only located in the Source files, Input files and any sub folders underneath them. If you have a text selection in an editor then that will be prepopulated in the search field.
Build configurations¶
Show build images in separate groups for each core¶
When working with multi-core applications, the child image hierarchy would not always be grouped by CPU core, making it harder to figure out which builds went to which core. We have changed the Applications panel view for multi-core applications to organize builds by CPU cores instead of following their folder structure.
Build all configurations in an application¶
We have added a Build All Configurations button for single applications in the Applications panel, that lets you build all configurations within the selected application.
Enhanced build configuration tooltips and actions¶
We enhanced the tooltip shown for build configuration folders in the Applications panel. This tooltip makes the related paths clickable, which renders CMake variables as code blocks. You can see this tooltip by hovering your mouse over the name of the build folder.
We have also added the Copy Build Command action, which you can use by clicking on the build folder's menu icon More actions..., then clicking Copy Build Command.
Other improvements¶
Feedback page¶
Tell us what you think about our extension. We have now implemented a feedback form in the Welcome panel, accessible by clicking on Give feedback.
You can select which topic the feedback is related to, how you would rate it, and any other thoughts you have related to the extension (including the other extensions: nRF Kconfig, nRF Terminal, and nRF DeviceTree).
Note that this is not a support channel, as it is not possible for us to reply to the feedback. but a chance for you to tell us how we are doing and if there are any improvements or new features you would like to see in the future.
Zephyr SDK support¶
The extension now supports developing applications for the Zephyr SDK. This includes being able to do the following specifically for Zephyr SDKs:
- Toolchain selection and tools check
- Updated environment
- A size reporting tool
- On Linux, tools check passes
- Debugging (with no-py debugger)
Allow toolchain selection on Linux¶
We now expose toolchain selection on Linux in a manner that matches Windows and MacOS. Starting with nRF Connect SDK v2.0, it is possible to install toolchains on Linux through the the Toolchain Manager. You can now launch the Toolchain Manager from the extension's Welcome Page when you click on Quick Setup.
Improved styling in webviews¶
We have made some small improvements to the webview UIs, tightening up some of the margins and padding to give more room between the different UI elements.
Load Devicetree contexts when changing build configuration¶
We have improved the UI so that build configurations now load their devicetree contexts when they become active. This helps you keep better track of the devicetree contexts that are being used with your build configurations.
Show notification on new releases¶
You will now receive a notification when there is a new release of the extension, if you are using an older version of the extension.
Bug fixes¶
-
We have fixed an issue with adding multiple applications, which would lead to a "Directory not found" error when adding another application to your workspace.
-
We have fixed how
west update
is cancelled to avoid a leftover process running in the background. Thewest update
process now stops running when the task is canceled in the UI. Previously, it would continue running in the background.