Devicetree View¶
The Devicetree View is one of the default Sidebar Views. It lists the devicetree context for your selected build configuration, a summary of the configuration included in the board and overlay files.
Each context corresponds to a single compiled devicetree file that goes into a build. See the Devicetree and Kconfig support guide page for more information.
The View always takes the name of the board you created the configuration for.
Devicetree context¶
The devicetree context with its different areas provides an overview of what the common resources are and which components use them. Each context area is linked with a specific node or property in the devicetree. Clicking one of these will go to the primary definition of the linked node or property.
Context¶
This field mentions the context file, which is the devicetree file with the highest priority for the build configuration, usually an .overlay
file. The contents of the context file will always take precedence over contents of other devicetree file within the given build configuration.
For information about how to add a context file, see How to create devicetree files.
Board¶
This is a list of information related to your connected board. It includes the name, architecture, supported features, and supported toolchains.
GPIO¶
This is a list of all known GPIO controllers, which are determined by the gpio-controller
property. Each GPIO controller presents a list of the allocated pins and their owners, taken from gpios
properties, -pins
properties, and pinctrl
properties.
The pin icon to the left of each GPIO pin indicates whether a pin is connected. A filled-in icon indicates a connected pin, and an empty icon indicates an unconnected pin.
Flash¶
This is a list of all flash controllers, or nodes, based on the soc-nv-flash
type binding. If the flash controllers contain a fixed-partitions
node, each partition is listed with their size and address. Any unallocated space in the flash area is also listed.
Interrupts¶
This is a list of all interrupt controllers determined by the interrupt-controller
property. It lists the allocated interrupts on the controller and their users, as well as any other available information, such as their priority and index.
Buses¶
This is a list of all known buses on the device determined by the bus
entry in the node's type binding. It lists important properties of the bus, such as clock speed and flow control, as well each node on the bus and their address if the bus has an address space. If the bus is an SPI bus, the chip select configuration of each node is also listed if it is known.
ADCs¶
This is a list of all ADC controllers on the device, or nodes, based on the adc-controller
type binding. Each ADC controller contains a list of all allocated channels based on references made to the ADC instances using the io-channels
property.
Devicetree View interaction options¶
The View offers several actions.
Access to the Devicetree Visual Editor¶
Click the context devicetree file name to open it in the Editor. You can then access the Devicetree Visual Editor using the Show Visual Editor button, highlighted in the following image.
Tip
You can use the workbench.editorAssociations
parameter in the Visual Studio Code Settings to set the Devicetree Visual Editor to show by default instead of the Text Editor when you open .dts
or .overlay
files. You can do this for example in the following way:
"workbench.editorAssociations": {
"*.overlay": "devicetree.editor",
"*.dts": "devicetree.editor"
},
Compiled output preview¶
Click the Show Compiled Devicetree Output button to view the compiled devicetree output file. A new screen opens with the compiled output in one file. Click on any context item in the View and the compiled output will jump to that section in the code.
Definition source file info¶
Selecting a line from the compiled devicetree output file lets you see the source of that definition at the end of that line.
Option to Copy C Identifier of Node¶
You can copy references to a node or property from a devicetree file and paste them into your C code directly from the Devicetree View. The Copy C Identifier of Node option is available in the More actions... menu. See How to copy C identifiers for more information.