nRF DeviceTree - nRF Connect for VS Code
Skip to content

Version 2022.7.36

Welcome to the July 2022 release of nRF DeviceTree extension for Visual Studio Code.

In this release, we have worked on the following areas:

Devicetree editing improvements

We have made several quality-of-life improvements in this area, the most prominent of which are detailed below.

Added include completion

Devicetree uses the C preprocessor to assemble its source files. Now, to help you find the right source files to include, we have added autocompletion for the preprocessor's #include directive.

#include completion

Added code action for missing required properties

To help resolve warnings on nodes with missing required properties, we have added a code action for quickly adding all required properties missing from a devicetree node. When applicable, a button with a light bulb icon will appear next to the selected node in the Editor. Click on this icon, and then Add required properties to have the missing required property added for you.

Code action for missing properties

Added warning on children of disabled nodes

When adding devices to a bus, it is easy to miss whether the bus has been disabled in a board file. This kind of mistake is usually accepted by the build system, which will silently neglect linking in the corresponding drivers. To help prevent this issue, the extension will now emit a warning on all child nodes of disabled nodes in the Editor.

Warning for children of disabled nodes

Insert semicolon after closing brace

VS Code is set up to automatically close any opening curly brackets in devicetree source files. While useful on its own, you would still need to go back and add a semicolon after the closing bracket, which defeats the purpose of the autoclosing bracket mechanism. The extension will now automatically insert a semicolon in addition to the closing bracket in all devicetree files.

Add semicolon after brackets

Devicetree View improvements

We have added new actions to the Devicetree View and polished the existing ones.

Enhancements to existing actions

We have done a lot of clean up of the existing actions in the Devicetree View.

Moved nRF DeviceTree actions into submenu

To mirror similar changes in the nRF Connect extension, we have moved some of the actions with unintuitive icons or narrow use cases into a context menu on the various devicetree nodes. Now, you can hover your cursor over the devicetree node and click on the ... button to access options in the submenu.

Move Devicetree View options into context menu

Added icons to GPIO pins

As the Unconnected label on GPIO pins made the connected and unconnected pins hard to distinguish, we have removed this label, and replaced it with icons representing the connected or unconnected state of each pin. Filled-in icons represent a connected pin, and non-filled in icons represent an unconnected pin.

GPIO pin icons

Brought back bus node pins

With the move to pinctrl, the bus nodes' pin descriptions disappeared from the bus nodes. They are now back for both old and new pin configuration schemes.

New actions

We have also created new actions that will speed up your work with the nRF DeviceTree extension.

To access these actions:

  1. Hover over a node. A "..." button appears to the right.
  2. Click on the "..." to access More actions....

  3. Click on the desired option.

Add Alias

It is now possible to easily create devicetree aliases using the Add Alias option from the extended menu on the relevant nodes in the Devicetree View.

Add Alias feature

Enable/disable toggle on interrupt requests

We have added the actions to enable or disable interrupt request (IRQ) nodes.

Enable/disable toggle on IRQs

Copy C Identifier for nodes and properties

We have added a Copy C Identifier submenu command to the devicetree nodes and properties that have C identifiers. This option copies the C macro string to the clipboard, which can be pasted into an application's code.

Copy C Identifier

Edit interrupts

With the added Edit Property Value action, you can now edit the interrupt node that binds to the selected interrupt in order to change its priority.

Edit property value

Performance improvements

The previous release contained a regression that made the nRF DeviceTree extension's autocompletion take several seconds. Parsing and linting was also affected by this regression, causing severe performance issues in both startup time, autocompletion, and syntax validation.

The underlying regression has been addressed, along with some related performance bottlenecks. Startup, parsing, and autocompletion should now take less than 50 ms, even for large devicetrees.

Other improvements

We have also worked on several minor improvements to nRF DeviceTree behavior and UI. Read about the most relevant ones below.

Added file icons

We have added a file icon for devicetree files, to make it easier it identify these.

Devicetree file icons

Reparsing all contexts on SDK changes

The extension now forces a full reparsing of all devicetree files when the SDK location changes. This is to prevent nRF DeviceTree from pointing to old SDK locations in freestanding applications.

Bug fixes

We have squashed several bugs, and here are the most relevant fixes.

Addressed context issue when DeviceTree file is already open on startup

When VS Code was started (or restarted) with a devicetree file already in the active Editor area, the extension would fail to associate the file with the active build, thus disabling some of the editing features.

Now, the autocompletion and the Devicetree View should always be available for files opened on startup.

Fixed deep binding inclusions being ignored

When binding inclusions were more than two layers deep, the logic for determining whether nodes belonged to a specific bus type or generic binding would fail. This would cause the extension to mistakenly label some bus nodes as invalid.

This problem is now addressed and all issues with bus nodes are being identified as they should.