2
votes

I'm seeing a curious problem when trying to load device tree overlays on a Beaglebone black. The loader fails to load the .dtbo file because it is looking for a file with a name different to the one it has been told to load. The .dts file was compiled on the same device using the command:

dtc -O dtb -o TEST-DT-00A0.dtbo -b 0 -@ TEST-DT-00A0.dts

The compilation completed without errors but when I attempt to load the binary using:

echo TEST-DT-00A0.dtbo > /sys/devices/bone_capemgr.9/slots

I see the error:

-bash: echo: write error: No such file or directory

Examining the reason for the failure using dmesg reveals that the loader was attempting to load a file with the name (-0 inserted into the file name):

TEST-DT-0-00A0.dtbo

Sure enough, if I rename the .dtbo file to the name expected by the loader it loads correctly and works just fine.

Does anyone have any idea why the extra '-0' was added to the name by the device tree loader? On a second Beaglebone, the loader was expecting the file to be named TEST-DT-00-00A0.dtbo (-00 added to the name).

If it helps, here's the output from uname:

Linux beaglebone 3.8.13-bone79 #1 SMP Tue Oct 13 20:44:55 UTC 2015 armv7l GNU/Linux

Thanks for any help!

2

2 Answers

1
votes

It appears the device tree loader is a little simplistic and assumes the filename has exactly 16 characters in its name. If the device tree fragment does not have a 16 character name then various level of padding or truncation can occur when the fragment is loaded.

The correct thing then would be for the above fragment to be renamed to something like:

TEST-DT-12345678-00A0.dtbo

(16 characters before the -00A0.dtbo)

Then this would load correctly with the device tree loader mangling the name.

Also, be wary of trying to load a file with a path:

echo /lib/firmware/TEST-DT-12345678-00A0.dtbo > /sys/devices/bone_capemgr.*/slots

The characters in the path will count towards the 16 character expected name length resulting in the device tree loader attempting to load the fragment:

TE-00A0.dtbo

If you are experiencing 'No such file or directory' errors when trying to load a fragment, be sure to check dmesg!

0
votes

Please note, that Device Tree Overlays are now obsolete, and Uboot should be used to config at boot or config-pin command.

Check here section: Where did the slots file go? https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays

Example of UART4 config-pin script

#!/bin/sh
config-pin p9.11 uart
config-pin p9.13 uart
stty -F /dev/ttyO4 sane