Device tree compiler

How to use the device tree compiler to extract the device tree source from the device tree blog

Device tree compiler installation

It is possible to install the device tree compiler on your Linux PC or you Acme Systems board by typing:

sudo apt-get update
sudo apt-get install device-tree-compiler

Extract the device tree sources from a dtb file

Usually the dtb file used during the boot is saved on the microSD inside the directory /boot. In this example we will extract a dts file starting from the dtb file available on a RoadRunner board.

sudo dtc -I dtb -O dts -o acme-roadrunner.dts /boot/acme-roadrunner.dtb

Make your changes on the acme-roadrunner.dts file using an ASCII editor, copy your old copy of dtb file and generate the new dtb file by typing

cp /boot/acme-roadrunner.dtb /boot/acme-roadrunner-old.dtb
sudo dtc -I dts -O dtb -o /boot/acme-roadrunner.dtb acme-roadrunner.dts 

Then reboot to test yor new device tree

Sergio Tanzilli
System designer, software developer and company co-founder
tanzilli@acmesystems.it
Webpages: https://www.acmesystems.it and http://www.tanzolab.it
Github repository: https://github.com/tanzilli and https://github.com/acmesystems