-
Notifications
You must be signed in to change notification settings - Fork 2
Device Tree
A devicetree is a data structure that is used to describe and configure hardware. It is extensively used in Zephyr projects.
In order to use the provided DEVICE TREE view, it is necessary to have a Zephyr project and the Devicetree Compiler (DTC) installed. For more information, refer to Zephyr and Dependecies Installation.
After compiling the Zephyr Project and refreshing the DEVICE TREE view, it will be populated with a tree-like view of the hardware hierarchy of the project. You can inspect the nodes and their associated values.
Clicking on a node will redirect the user to the source definition of that node. If the node is the merge result of multiple definitions, the one that sets the final value will be opened.
The node name and value can be copied to the clipboard by opening the context menu (right click on a node), and choosing the Copy Name command.
Node values can be referenced programmatically in source code, using specific macros. These can be generated for most of the nodes by opening the context menu and choosing the Copy C Identifier command.
This will copy the associated macro to the clipboard. For more information, refer to Devicetree bindings.
There are multiple ways to override nodes and properties found in the device tree. The most convenient one is to create an overlay file with the required changes. The DEVICE TREE view keeps track of the overlay files used during compilation under the Overlay files category.
If there are no overlay files created for the current project, one can easily be added by clicking the prompt under overlay files.
After creating the overlay file, the view will be refreshed and display the currently available overlay files. Clicking on an overlay file will open a new tab in order to edit it.
If there are multiple overlay files, the one used during the build process will have a check next to it.
After modifying an overlay file, it is necessary to rebuild the project and refresh the view for it to update.
Additional overlay files can be specified by using CMake variables.
In order to set CMake variables, you need to navigate to the CMakePresets.json
file, located source directory folder of the project (same folder as CMakeLists.txt
). CMake variables are specified under the cacheVariables
property of the used build configuration.
In the case of overlays, they can be specified under 2 variables: DTC_OVERLAY_FILE
and EXTRA_DTC_OVERLAY_FILE
. Each entry can contain more than one file, by separating the paths using either a semicolon or a space.
After setting the variables, it is necessary to rebuild the Zephyr project and refresh the DEVICE TREE view for the changes to take effect.
The overlay files specified under CMake variables will take precedence over the project ones defined. Each entry will also specify where it has been declared, either DTC_OVERLAY_FILE
or EXTRA_DTC_OVERLAY_FILE
.
For more information on how to use overlay files, refer to Devicetree HOWTOs.
Use this GitHub Issues section to report ambiguities or problems encountered in this documentation. For MCUXpresso for Visual Studio Code extension issues, feedback or search for solutions and ideas please follow Community page.
Table of contents
Dependency Installation
General
Software Repositories
Project Management
Flash and Debug
Reference Guides
- Getting Started with MIMXRT1060-EVK
- Training Zephyr Getting Started
- TrustZone Examples on LPC55S6x and MCUXpresso SDK
- Multicore Examples on LPC55S6x and MCUXpresso SDK 2.x
- Multicore Examples on LPC55S6x and MCUXpresso SDK 24.12
- SDRAM Examples on RT1060 and MCUXpresso SDK
- Getting Started with MCX using Application Code Hub
- AN14120: Debugging Cortex-M on i.MX 8M, i.MX 8ULP, and i.MX 93
Troubleshooting
Useful links