LinuxCommandLibrary

dtc

Device Tree Compiler

TLDR

Compile DTS to DTB

$ dtc -I dts -O dtb -o [output.dtb] [input.dts]
copy
Decompile DTB to DTS
$ dtc -I dtb -O dts -o [output.dts] [input.dtb]
copy
Check DTS syntax
$ dtc -I dts -O dts [input.dts]
copy
Include search path
$ dtc -I dts -O dtb -i [include_path] -o [output.dtb] [input.dts]
copy
Generate assembly output
$ dtc -I dts -O asm -o [output.S] [input.dts]
copy

SYNOPSIS

dtc [options] inputfile_

DESCRIPTION

dtc (Device Tree Compiler) compiles Device Tree Source (DTS) files to Device Tree Blob (DTB) format and performs the reverse operation of decompiling DTB back to DTS. Device trees are data structures that describe hardware components and their relationships, allowing Linux kernels to support various hardware platforms without hardcoded board-specific code.
The compiler is essential for embedded Linux development, particularly for ARM, RISC-V, and PowerPC platforms. DTS files provide a human-readable description of hardware (CPUs, memory, peripherals, interrupts, buses), while DTB is the binary format loaded by bootloaders and passed to the kernel at runtime.
dtc supports device tree overlays, which allow runtime modification of the base device tree. This is particularly useful for add-on hardware like Raspberry Pi HATs or BeagleBone capes, where the overlay describes additional hardware without modifying the base system device tree.
The tool includes validation and warning systems to catch common errors in device tree syntax and structure. It can also generate assembly output for inclusion in firmware builds.

PARAMETERS

-I format

Input format (dts, dtb, fs).
-O format
Output format (dts, dtb, asm).
-o file
Output file.
-i path
Include search path.
-W warning
Enable warning.
-E error
Enable error.
-@
Generate symbols for overlays.

SEE ALSO

fdtdump(1), fdtget(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community