Working SPI Display

Sharing the simple guide that I put together based on other user @HejinYo, to make display work.
He made it for ST7789, while i was able to make it work for ST7735s.

link:

demo:

TODO:
Trying to implement framebuffer copy (fbcp) to run proper display on these spi screens.
If someone has already made one, please let me know.

6 Likes

WOW!!! on my radxa i have installed android 9, is there any way to install these drivers? or give these commanders? thank you

Wooo, the video looks very smooth, I see in your dts file that you use :
width = <135>;
height = <240>;

Is it still smooth with such a resolution?

I’m still struggling with my 240x240 SPI display wich blink and is still too slow to display animated picture on 240x240 resolution (Is there a way to increase SPI clock speed?)

I am not sure yet. I don’t think theres a way to update device tree on android to make lcd screen work.

1 Like

That was just a sample dts setup, but you can definitely modify it according to your lcd screen size.

Hi. Thanks for sharing your expirience. I found your repo with guide and did the same. As a result I found /dev/fb1 device after reboot. Now backlight of the device is off. But command
sudo fbi -d /dev/fb1 -T 1 -noverbose -a ./cat.jpg
to send something to fb1 doesn’t work. Only returning:
using "DejaVu Sans Mono-16", pixelsize=16.67 file=/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf

I have connected the following shield:
https://www.waveshare.com/1.44inch-lcd-hat.htm
Wiki: https://www.waveshare.com/wiki/1.44inch_LCD_HAT

Controller model is: st7735s, screen 128x128.
Do I need change some thing inside dts file?

Dmesg output: dmesg | grep fbtft

[    4.504514] fbtft: loading out-of-tree module taints kernel.
[    4.505309] fbtft: module verification failed: signature and/or required key missing - tainting kernel
[    4.581932] fb_st7789v spi1.0: fbtft_property_value: width = 135
[    4.581946] fb_st7789v spi1.0: fbtft_property_value: height = 240
[    4.581951] fb_st7789v spi1.0: fbtft_property_value: buswidth = 8
[    4.581956] fb_st7789v spi1.0: fbtft_property_value: debug = 1
[    4.581960] fb_st7789v spi1.0: fbtft_property_value: rotate = 270
[    4.581965] fb_st7789v spi1.0: fbtft_property_value: fps = 60
[    4.582074] fb_st7789v spi1.0: fbtft_request_one_gpio: 'reset' GPIO
[    4.582095] fb_st7789v spi1.0: fbtft_request_one_gpio: 'dc' GPIO
[    4.582113] fb_st7789v spi1.0: fbtft_request_one_gpio: 'rd' GPIO
[    4.582127] fb_st7789v spi1.0: fbtft_request_one_gpio: 'wr' GPIO
[    4.582140] fb_st7789v spi1.0: fbtft_request_one_gpio: 'cs' GPIO
[    4.582153] fb_st7789v spi1.0: fbtft_request_one_gpio: 'latch' GPIO
[    4.582166] fb_st7789v spi1.0: fbtft_request_one_gpio: 'db' GPIO
[    4.582183] fb_st7789v spi1.0: fbtft_request_one_gpio: 'led' GPIO
[    4.582197] fb_st7789v spi1.0: fbtft_request_one_gpio: 'aux' GPIO
[    4.582211] fb_st7789v spi1.0: fbtft_request_one_gpio: 'db' GPIO
[    4.582224] fb_st7789v spi1.0: fbtft_request_one_gpio: 'led' GPIO
[    4.582238] fb_st7789v spi1.0: fbtft_request_one_gpio: 'aux' GPIO
[    4.582251] fb_st7789v spi1.0: fbtft_request_one_gpio: 'db' GPIO
[    4.582264] fb_st7789v spi1.0: fbtft_request_one_gpio: 'led' GPIO
[    4.582277] fb_st7789v spi1.0: fbtft_request_one_gpio: 'aux' GPIO
[    4.582291] fb_st7789v spi1.0: fbtft_request_one_gpio: 'db' GPIO
[    4.582304] fb_st7789v spi1.0: fbtft_request_one_gpio: 'led' GPIO
[    4.582317] fb_st7789v spi1.0: fbtft_request_one_gpio: 'aux' GPIO
[    4.582330] fb_st7789v spi1.0: fbtft_request_one_gpio: 'db' GPIO
[    4.582344] fb_st7789v spi1.0: fbtft_request_one_gpio: 'led' GPIO
[    4.582357] fb_st7789v spi1.0: fbtft_request_one_gpio: 'aux' GPIO
[    4.582370] fb_st7789v spi1.0: fbtft_request_one_gpio: 'db' GPIO
[    4.582384] fb_st7789v spi1.0: fbtft_request_one_gpio: 'led' GPIO
[    4.582397] fb_st7789v spi1.0: fbtft_request_one_gpio: 'aux' GPIO
[    4.582410] fb_st7789v spi1.0: fbtft_request_one_gpio: 'db' GPIO
[    4.582424] fb_st7789v spi1.0: fbtft_request_one_gpio: 'led' GPIO
[    4.582437] fb_st7789v spi1.0: fbtft_request_one_gpio: 'aux' GPIO
[    4.582451] fb_st7789v spi1.0: fbtft_request_one_gpio: 'db' GPIO
[    4.582464] fb_st7789v spi1.0: fbtft_request_one_gpio: 'led' GPIO
[    4.582477] fb_st7789v spi1.0: fbtft_request_one_gpio: 'aux' GPIO
[    4.582491] fb_st7789v spi1.0: fbtft_request_one_gpio: 'db' GPIO
[    4.582505] fb_st7789v spi1.0: fbtft_request_one_gpio: 'led' GPIO
[    4.582520] fb_st7789v spi1.0: fbtft_request_one_gpio: 'aux' GPIO
[    4.582533] fb_st7789v spi1.0: fbtft_request_one_gpio: 'db' GPIO
[    4.582547] fb_st7789v spi1.0: fbtft_request_one_gpio: 'led' GPIO
[    4.582560] fb_st7789v spi1.0: fbtft_request_one_gpio: 'aux' GPIO
[    4.582574] fb_st7789v spi1.0: fbtft_request_one_gpio: 'db' GPIO
[    4.582587] fb_st7789v spi1.0: fbtft_request_one_gpio: 'led' GPIO
[    4.582601] fb_st7789v spi1.0: fbtft_request_one_gpio: 'aux' GPIO
[    4.582614] fb_st7789v spi1.0: fbtft_request_one_gpio: 'db' GPIO
[    4.582628] fb_st7789v spi1.0: fbtft_request_one_gpio: 'led' GPIO
[    4.582641] fb_st7789v spi1.0: fbtft_request_one_gpio: 'aux' GPIO
[    4.582655] fb_st7789v spi1.0: fbtft_request_one_gpio: 'db' GPIO
[    4.582668] fb_st7789v spi1.0: fbtft_request_one_gpio: 'led' GPIO
[    4.582681] fb_st7789v spi1.0: fbtft_request_one_gpio: 'aux' GPIO
[    4.582694] fb_st7789v spi1.0: fbtft_request_one_gpio: 'db' GPIO
[    4.582708] fb_st7789v spi1.0: fbtft_request_one_gpio: 'led' GPIO
[    4.582722] fb_st7789v spi1.0: fbtft_request_one_gpio: 'aux' GPIO
[    4.582735] fb_st7789v spi1.0: fbtft_request_one_gpio: 'db' GPIO
[    4.582748] fb_st7789v spi1.0: fbtft_request_one_gpio: 'led' GPIO
[    4.582761] fb_st7789v spi1.0: fbtft_request_one_gpio: 'aux' GPIO
[    4.582775] fb_st7789v spi1.0: fbtft_request_one_gpio: 'db' GPIO
[    4.582788] fb_st7789v spi1.0: fbtft_request_one_gpio: 'led' GPIO
[    4.582802] fb_st7789v spi1.0: fbtft_request_one_gpio: 'aux' GPIO

Any idea how to use joystick and buttons on my shild? Is that general gpio? I mean I can use echo "500" > /sys/class/gpio/export

Button key2 is available as gpio:

 echo 422 > /sys/class/gpio/export
#press button (default value is 1)->0
 cat /sys/class/gpio/gpio422/value

Thanks in advance

you can try connecting the backlight led pin of your display directly to 3.3v to see if you can get the backlight on.

Yes. It is not a problem to turn on the backlight. I found the right gpio. Main problem is: You mentioned that you has been successfully connected st7735 display, but there is no driver inside git repo for that type of the display.

Some clarification would help a lot here, Mark. There is a section in the instructions where it is impossible to determine whether some of the lines are statements of things you should see as contrasted to things you should do.

For many of us, this is the first time we’ve ever been exposed to the concept of device tree overlays, let alone how to compile one; your instructions assume knowledge that many of us attempting to get our SPI displays working may not have.

Could you please give some clarification, and/or point us at some “do these steps and it will work” instructions?

Posting the driver source would be immensely helpful, for example.

Yes, but it should be just similar to what was in the repo.

I am also not the best person to teach you about device tree overlays. The guide is just fairly a working demo that was based on the original guide that I found. It was fairly translated to english since it was originally in Chinese.

Also, I stopped poking around this board due to very limited support. And as expected, if you want to make things work you might be required to have some good level of understanding just like some of the people who are still dedicated to work on this board.

1 Like

While that’s probably true, it’s also not especially helpful.

Practical documentation would be immensely useful. Unfortunately what I’ve seen so far is opaque to anyone but systems engineers comfortable with writing device drivers from scratch - a situation which, given that the Radxa is advertised as being SPI capable but is not actually usable as such by the average consumer, is less than ideal.

@mrkprdo Could you share how to connect the lcd to the zero? which pins go where?