TFT device tree help

Hi all!

I’m hoping someone can point me in the right direction here. I haven’t been able to find noob-friendly docs on using device tree overlays. Most of the docs for bbb refer to the capemanager which I now know is no longer used.

I’d like to get this TFT display working with the pocketbeagle using fbtft. I wasn’t able to get either of these examples working:

https://gist.github.com/jadonk/1b6a3c17059fe5a1977f3d1e5d12f916

https://gist.github.com/jadonk/fe636e79c691525ab2960bf5dd7956cf

I hooked everything up except the buttons as in the first link.

Loading the fbtft module:

`

sudo rmmod fbtft_device fb_ili9341 fbtft
sudo modprobe fbtft_device name=adafruit28 busnum=2 cs=1 rotate=90 gpios=dc:45,reset:86

`

Produces this in dmesg

`

[ 195.378472] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
[ 195.394949] fbtft_device: module is from the staging directory, the quality is unknown, you have been warned.
[ 195.398240] spidev spi1.0: spidev spi1.0 24000kHz 8 bits mode=0x00
[ 195.398267] spidev spi2.0: spidev spi2.0 24000kHz 8 bits mode=0x00
[ 195.398280] spidev spi2.1: spidev spi2.1 24000kHz 8 bits mode=0x00
[ 195.398504] spidev spi2.1: Deleting spi2.1
[ 195.399531] fbtft_device: GPIOS used by ‘adafruit28’:
[ 195.399546] fbtft_device: ‘reset’ = GPIO86
[ 195.399554] fbtft_device: ‘dc’ = GPIO45
[ 195.399568] spidev spi1.0: spidev spi1.0 24000kHz 8 bits mode=0x00
[ 195.399580] spidev spi2.0: spidev spi2.0 24000kHz 8 bits mode=0x00
[ 195.399591] spi spi2.1: fb_ili9341 spi2.1 32000kHz 8 bits mode=0x00
[ 195.447747] fb_ili9341: module is from the staging directory, the quality is unknown, you have been warned.
[ 195.454803] fb_ili9341 spi2.1: fbtft_request_gpios: gpio_request_one(‘reset’=86) failed with -16
[ 195.463981] fb_ili9341: probe of spi2.1 failed with error -16

`

I guess that makes sense, the gpios are being used by the ‘enable_uboot_cape_universal=1’ in /boot/uEnv.txt. Not sure that statement even makes sense. I’m guessing I need an dts overlay to set the reset and dc pins to be used with the display.

I tried compiling the dts in the first gist (without modification) without success:

`

$ cd ~
$ dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o /lib/firmware/am335x-pocketbeagle-simplegaming.dtbo am335x-pocketbeagle-simplegaming.dts
Error: am335x-pocketbeagle-simplegaming.dts:3.1-9 syntax error
FATAL ERROR: Unable to parse input tree

`

Then I tried the dts in the second gist. There are two and I have no idea which is needed. The README.md provided a command to compile so I’ll go with that.

$ cd ~ $ sudo dtc -W no-unit_address_vs_reg -@ -I dts -O dtb -o /lib/firmware/am335x-spilcd-adafruit28.dtbo am335x-spilcd-adafruit28.dts

That seems to work. Things seem to be correct for my display in that dts file. Next I edit /boot/uEnv.txt and set this:

`

###Custom Cape
dtb_overlay=/lib/firmware/am335x-spilcd-adafruit28.dtbo

`

I’m not sure if that is correct and can’t find any docs on where uboot expects files to be. Seems like it could go on any of these lines:

`

###Overide capes with eeprom
#uboot_overlay_addr0=/lib/firmware/.dtbo
#uboot_overlay_addr1=/lib/firmware/.dtbo
#uboot_overlay_addr2=/lib/firmware/.dtbo
#uboot_overlay_addr3=/lib/firmware/.dtbo