Device tree functionality is broken

When I try and add a new device tree file (code tested by others on the internet) the following process is not successful:

root@beaglebone:~# dtc -O dtb -o Nicks-Foo-Bar-Setup-00A0.dtbo -b 0 -@ Nicks-Foo-Bar-Setup-00A0.dts
root@beaglebone:~# cp Nicks-Foo-Bar-Setup-00A0.dtbo /lib/firmware/
root@beaglebone:~# echo Nicks-Foo-Bar-Setup > /sys/devices/bone_capemgr.*/slots
-sh: /sys/devices/bone_capemgr.9/slots: cannot overwrite existing file

I thought it might be a noclobber thing, but it is not:

root@beaglebone:~# set +o noclobber
root@beaglebone:~# echo Nicks-Foo-Bar-Setup > /sys/devices/bone_capemgr./slots
-sh: echo: write error: File exists
root@beaglebone:~# set -o noclobber
root@beaglebone:~# echo Nicks-Foo-Bar-Setup > /sys/devices/bone_capemgr.
/slots
-sh: /sys/devices/bone_capemgr.9/slots: cannot overwrite existing file
root@beaglebone:~#

So how do I get to use device trees like all the other cool kids?

Could you post the device tree file? (pastebin it if it's long) While
you're at it, check dmesg since sometimes you get something helpful
from it.

Also, can you load any of the existing device tree files?

root@beaglebone:~# echo Nicks-Foo-Bar-Setup >
/sys/devices/bone_capemgr.*/slots -sh:
/sys/devices/bone_capemgr.9/slots: cannot overwrite existing file
root@beaglebone:~#

That's the very descriptive error you get if you're trying to load an
overlay that conflicts with something already loaded. And probably a
bunch of other error cases too, but having something already using the
resource is the main time I've seen this error.

So how do I get to use device trees like all the other cool kids?

Try starting with a simpler overlay and see if you can get that to
load, and/or review the output of cat
/sys/devices/bone_capemgr.*/slots to see what might be conflicting.

Posting your dts file would help us help you as well.

- --
Charles Steinkuehler
charles@steinkuehler.net

Show the last few lines of dmesg after dtbo loading fails. You can
also monitor the logs live by starting "journalctl -f" in another
terminal session. Shell messages are not very informative when
debugging device tree problems. Kernel writes much more useful
information to the log.

j.

I tried to follow these instructions: http://elinux.org/BeagleBone_Black_Enable_SPIDEV

They don’t seem to work on my board, or I haven’t done some unmentioned setup procedure. I also attempted to follow Derek Molloy’s instructions on GPIO configuration with devicetree: http://www.youtube.com/watch?v=wui_wU1AeQc

Did you see the "BIG RED WARNING" that you cannot use SPI on the
BeagleBone Black without disabling HDMI? That ties in with a couple
earlier posts indicating the error you are seeing is typical if you
have a resource conflict.

Disable HDMI, and I suspect you will be able to load the SPI overlay.

- --
Charles Steinkuehler
charles@steinkuehler.net

That big red warning appears to be just for SPI1, I presume SPI0 would work just fine with HDMI enabled.

That being said, when I export the SPI0 overlay, I end up getting /dev/spidev1.0 instead of /dev/spidev0.0.