Device tree files
A device tree is a hierarchical data structure primarily used to describe hardware.
CLion recognizes .dts/.dtsi files and provides them with сode assistance and code analysis features.
Configure the board (Zephyr)
If you are working with Zephyr, make sure to select the board you are using in the settings:
Go to
.Use one of the options:
Derive Zephyr settings from CMake
Set the Sync with CMake checkbox. Note that the
find_package(Zephyr)
command is required to fetch the board name.Specify the Zephyr installation path and select the board
Clear the Sync with CMake checkbox. Provide the path to Zephyr installation if it was not detected automatically and select the board from the list:
Code with assistance
Find below a few examples of coding assistance features available for the device tree files.
Syntax highlighting and code formatting:
Code folding for nodes:
Quick documentation for the device tree elements:
By default, quick doc is displayed on mouse hover. Refer to Quick documentation for instructions on how to change this, as well as general information about this feature.
Structure view for the device tree files:
To open the Structure view, go to
in the main menu or press Alt+7.Code completion for standard properties,
/commands/
, labels, and code elements:Automatic insertion of missing semicolons, matching braces, and quotation marks while you type.
Quick-fixes and intentions for the device tree code
CLion provides a set of checks for your device tree code.
You can explore and adjust the list of inspections in
:For example, CLion validates the names in your code: