How to recreate dts file from a running embedded target

As we have seen in “How to cross compile static dtc for ARM” we are able to get the DTC cross compiled statically which we will push to the embedded target which exposes the device tree from proc file system.

Using this statically compiled dtc, we will reverse engineer to create human readable DTS file which will give us many more insights into the running embedded target.

This post describes how you can push the DTC to Android device, but you can push/copy this to any device and recreate the DTS.

$ adb push dtc /sdcard/

On Android Device

$ su
$ cd /
$ mount -o,remount,rw /system
$ mv /sdcard/dtc /system/bin
$ chmod 777 /system/bin/dtc
$ dtc -I fs /proc/device-tree -O dts

The above command will read the /proc/device-tree and recreate the human readable DTS source.

Follow Lynxbee

Leave a Reply / Ask Question