# Device tree files

A [device tree](https://elinux.org/Device_Tree_Usage) 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.

Procedure: Configure the board (Zephyr)

If you are working with [Zephyr](https://www.zephyrproject.org), make sure to select the board you are using in the settings:

1. Go to `Settings | Languages & Frameworks | Devicetree`.

2. Use one of the options:

* Derive Zephyr settings from CMake The Sync with CMake option is enabled by default. 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: ![Selecting the board](https://resources.jetbrains.com/help/img/idea/2026.2/cl_dts_board_settings.png)

> **Tip:**
> Learn more about [device trees in
> Zephyr](https://docs.zephyrproject.org/latest/build/dts/index.html).

Procedure: Code with assistance

Find below a few examples of coding assistance features available for the device tree files.

* Syntax highlighting and code formatting:

![Syntax highlighting and code formatting for device tree](https://resources.jetbrains.com/help/img/idea/2026.2/cl_dts_syntaxhighlight.png)

> **Tip:**
> You can configure the color scheme in `Settings | Editor | Color Scheme | Devicetree` and code style in `Settings | Editor | Code Style | Devicetree`.

* Code folding for nodes:

![Code folding gutter icon](https://resources.jetbrains.com/help/img/idea/2026.2/cl_dts_folding_unfold.png)

![A folded block](https://resources.jetbrains.com/help/img/idea/2026.2/cl_dts_folding_fold.png)

> **Tip:**
> Press `Ctrl+Shift+NumPad -` (Windows), `⌘ ⇧ NumPad -` (macOS), `⌘ ⇧ NumPad -` (IntelliJ IDEA Classic (macOS)), `⌥ ⇧ Minus` (macOS System Shortcuts), `Ctrl+Shift+NumPad -` (XWin), `Ctrl+Shift+NumPad -` (GNOME), `Ctrl+Shift+NumPad -` (KDE), `Ctrl+Shift+NumPad -` (Emacs), `Ctrl+K, Ctrl+1` (Sublime Text), `⌘ K, ⌘ 1` (Sublime Text (macOS)), `⌘ ⇧ NumPad -` (Xcode), `Ctrl+M, A` (Visual Studio), `⌃ M, A` (Visual Studio (macOS)), `Ctrl+M, A` (ReSharper), `⌃ M, A` (ReSharper (macOS)), `Ctrl+Shift+NumPad -` (QtCreator), `⌘ ⇧ NumPad -` (QtCreator (macOS)), `Ctrl+Shift+NumPad -` (NetBeans), `Ctrl+Shift+NumPad /` (Eclipse), `⌘ ⇧ NumPad /` (Eclipse (macOS)) to collapse and `Ctrl+Shift+NumPad +` (Windows), `⌘ ⇧ NumPad +` (macOS), `⌘ ⇧ NumPad +` (IntelliJ IDEA Classic (macOS)), `⌥ ⇧ Plus` (macOS System Shortcuts), `Ctrl+Shift+NumPad +` (XWin), `Ctrl+Shift+NumPad +` (GNOME), `Ctrl+Shift+NumPad +` (KDE), `Ctrl+Shift+NumPad +` (Emacs), `Ctrl+K, Ctrl+J` (Sublime Text), `⌘ K, ⌘ J` (Sublime Text (macOS)), `⌘ ⇧ NumPad +` (Xcode), `Ctrl+M, X` (Visual Studio), `⌃ M, X` (Visual Studio (macOS)), `Ctrl+M, X` (ReSharper), `⌃ M, X` (ReSharper (macOS)), `Ctrl+Shift+NumPad +` (QtCreator), `⌘ ⇧ NumPad +` (QtCreator (macOS)), `Ctrl+Shift+NumPad +` (NetBeans), `Ctrl+NumPad *` (Eclipse), `⌘ NumPad *` (Eclipse (macOS)) to expand all code fragments.
>
>
>
> Refer to [Code folding](working-with-source-code.html#code_folding) for more information.

* Quick documentation for the device tree elements:

![Quick documentation for device tree elements](https://resources.jetbrains.com/help/img/idea/2026.2/cl_dts_quickdoc.png)

> **Tip:**
> When showing documentation, CLion loads additional information from [Zephyr bindings](https://docs.zephyrproject.org/latest/build/dts/bindings-syntax.html#property-entry-syntax).

By default, quick doc is displayed on mouse hover. Refer to [Quick documentation](viewing-inline-documentation.html) for instructions on how to change this, as well as general information about this feature.

* Structure view for the device tree files:

![Structure view for device tree](https://resources.jetbrains.com/help/img/idea/2026.2/cl_dts_structureview.png)

To open the Structure view, go to `View | Tool Windows | Structure` in the main menu or press `Alt+7` (Windows), `⌘ 7` (macOS), `⌘ 7` (IntelliJ IDEA Classic (macOS)), `⌘ 7` (macOS System Shortcuts), `Alt+7` (XWin), `Alt+7` (GNOME), `Alt+7` (KDE), `Alt+7` (Emacs), `Alt+7` (Sublime Text), `⌘ 7` (Sublime Text (macOS)), `⌘ 3` (Xcode), `Ctrl+Alt+F` (Visual Studio), `⌃ ⌥ F` (Visual Studio (macOS)), `Ctrl+F11` (ReSharper), `⌃ F11` (ReSharper (macOS)), `Alt+7` (QtCreator), `⌘ 7` (QtCreator (macOS)), `Ctrl+7` (NetBeans), `Alt+7` (Eclipse), `⌘ 7` (Eclipse (macOS)).

* Code completion for standard properties, `/commands/`, labels, and code elements:

![Code compeltion for dts commands](https://resources.jetbrains.com/help/img/idea/2026.2/cl_dts_completion.png)

![Code completion for dts elements](https://resources.jetbrains.com/help/img/idea/2026.2/cl_dts_completion_watchdog.png)

* A line marker to indicate overwritten properties. You can also use it to navigate to the original property:

![Highlighting overwritten properties](https://resources.jetbrains.com/help/img/idea/2026.2/cl_dts_overriddenprop.png)

![Navigating to the overridden property](https://resources.jetbrains.com/help/img/idea/2026.2/cl_dts_overriddenprop_hover.png)

* Automatic insertion of missing semicolons, matching braces, and quotation marks while you type.

Procedure: 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 `Settings | Editor | Inspections`:

![Devicetree inspections](https://resources.jetbrains.com/help/img/idea/2026.2/cl_dts_inspections.png)

For example, CLion validates the names in your code:

![Names validation](https://resources.jetbrains.com/help/img/idea/2026.2/cl_dts_badcharacter.png)

## See also

### Procedures

[Multi-threaded RTOS debug](rtos-debug.html)

