Hey, I think I have had the same setup using the adafruit pi tft spi 240x240 1.3" st7789 display. Mine says that it should be able to work, are you using the same exact display? I am using Ubuntu 20.04. THIS IS THE INSTRUCTION SET TO GET THE RASPI TO WORK WITH THE DISPLAY:
Your work is VERY appreciated along with everyone else working on this as it really helps open up portable use implementations of these SBCâs. Please help me with either a simple âyepâ or NOPE to get started if you read this.
hi @houssemmiled, I was able to make the st7735r lcd work on the radxa zero 3w simply by adding an overlay for it (adapted from rk3568-spi3-m0-cs0-waveshare35.dts) (fbft and drivers for st7735r and st7789v are already in the kernel).
You need to select the corresponding driver according to your screen display ic and touch ic.
As for overlay dts, you can refer to this overlay script.
After that, I uploaded it to Rock-3c and then ran: $ sudo ./build.sh -t st7735r -c
However, it fails at the end when moving the created files:
make[1]: Leaving directory '/usr/src/linux-headers-5.10.160-38-rk356x'
Done building.
Installing dto files and kernel driver
cp: cannot create regular file '/boot/dtbs/5.10.160-38-rk356x/amlogic/overlay':
No such file or directory
FATAL ERROR: Couldn't open "/boot/dtbs/5.10.160-38-rk356x/amlogic/overlay/meson-g12a-spi-st7735r.dts" file or directory.
It fails at this installer step:
then
echo âInstalling dto files and kernel driverâ
echo â$PASSWORDâ | sudo -S cp {fb_$TARGETDRIVER.ko,fbtft.ko} /usr/lib/modules/$KERNELVERSION/kernel/drivers/staging/fbtft/
echo â$PASSWORDâ | sudo -S cp âŚ/meson-g12a-spi-$TARGETDRIVER.dts $DTOPATH
echo â$PASSWORDâ | sudo -S dtc -@ -I dts -O dtb -o $DTOPATH/meson-g12a-spi-$TARGETDRIVER.dtbo $DTOPATH/meson-g12a-spi-$TARGETDRIVER.dts
fi
I also tried copying the .dts files to directory /boot/dtbo/ $ sudo cp *.dts /boot/dtbo/
And running rsetup 's main interface.
But I have received this message: âcanât compile filesâ
I read another post about Rock3C it says that I cant use the same PIN for CS0:
âit appears on the Rock 3C, at least with my version, enabling SPI locks the user from changing the pin state, so the display didnât know when it was receiving commands or data (always thought it was data), meaning that it wasnât initializing correctly.â Post About SPI in Rock3C
I have a ST7789 also.
But bombusT didnât tell where to put the pins. What if we try to use ST7789? Could you please check over BombusT post and see if you can find wich pins did he use?
It seems that he only activated the original SPI overlay and did the rest in python coding.
He used:
import numbers
import time
import numpy as np
import spidev
import gpiod
And the example was:
# Example usage:
if _ name _ == â_ main _â:
# Specify the SPI port, CS, DC, and other parameters
port = 3
cs = 0
dc = 10 # Set this to whatever pin you want to connect (you cannot use pin 21 on the Rock 3C)
backlight = 19 # This is the same pin location as on the R pi, but do whatever you want.
rst = None
rotation=180
width = 320
height = 240
spi_speed_hz=60 * 1000 * 1000