Struggling to connect SPI display

Hi team,

I am using following mentioned spi display with axon. Please help to figure out the mapping of its pin with axon gpios.

I tried the debugging but not able to resolve it.

Display link: https://robu.in/product/smartelex-1-69-inch-tft-lcd-display/?gad_source=1&gad_campaignid=18585959909&gbraid=0AAAAADvLFWdUSGZ5gcYlUpEbuQLgz3yev&gclid=CjwKCAjw-dfOBhAjEiwAq0RwIz6X-RR4zdeZ9EggCYHJ7l05uouwjs--8cT0Yxm3sL8ttcF5WUckPhoCkWMQAvD_BwE

Here. you can find documentation of using GPIO as SPI.

@Avi_Shihora I followed the same doc. Backlight is on but nothing rendering on display. Tried to change configs but still not working.

Since, it is rkchip. Do we know what lib to use for spi display? @Avi_Shihora

What are the configs and dtbo/dtb you have added/modified in kernel !?

I found that you may require driver SR7789V.

The SmartElex 1.69-inch TFT LCD module (240x280 resolution) uses the ST7789V3 (or ST7789V2) driver IC and supports a 4-wire SPI interface.

Driver & Library Support

  • Driver IC: ST7789V / ST7789V3.

So, You have to add support of TFT LCD Driver ST7789V CONFIG_FB_TFT=y and CONFIG_FB_TFT_ST7789V=y in kernel.

For that you required to build kernel and apply in axon.

Kernel will require support for every display to run, to add support you can clone the repo, GitHub - vicharak-in/vicharak-linux-kernel: Linux Kernel Source for Vicharak's Vaaman ( RK3399 based ) and Axon ( RK3588 based ) Boards · GitHub follow the guide provided by @Avi_Shihora

Definitely, we can do that. But what about patching and updates of kernel?
We have to manually fetch and configure it all the time.

I would suggest to make these changes in kernel master/6.1 repo so that others can also leverage it.

@djkabutar

I have given updated in Kernel.
you can apply it by running below command.

sudo apt update
sudo apt upgrade

Then restart the system.

sudo reboot

We have added the required device tree overlays for the ST7789V display in our kernel to resolve your issue.

Steps to Update and Enable the Display overlays

  1. Update your system packages : sudo apt update
  2. Upgrade to the latest kernel and packages : sudo apt upgrade
  3. Open the configuration tool : sudo vicharak-config
  4. Navigate through the following menu :
    • Overlays
    • Manage Overlays
    • Enable : Enable SPI1 display ST7789V support on 30 Pin GPIO Header Axon V0.3

Hardware Connection (Before Reboot)
Please ensure the display is connected to the Axon board as follows :

Signal Header Pin SoC Pin Voltage
MISO Pin 17 SPI1_MISO 3.3V
MOSI Pin 18 SPI1_MOSI 3.3V
CS Pin 19 SPI1_CS0 3.3V
SCLK Pin 20 SPI1_CLK 3.3V
DC Pin 9 GPIO2_C0 3.3V
RESET Pin 14 3.3V

Finalize Setup
After completing the above steps, reboot your system : sudo reboot

Verification

Once the system boots:

  • Check kernel logs : dmesg --follow
  • You should see a new framebuffer device (fb1) created.
  • This device will be available at : /dev/fb1

Next Steps
You can now develop your own C (or other language) program to send data to /dev/fb1 and control the display as per your requirements.

1 Like

I am able to see it in overlays list but after reboot … while running ls /dev/fb* giving fb0 but not fb1.
Is it expected ?

If fb1 is not created, it indicates an error during driver probing. Please share the complete dmesg log file. You can generate it using the following command:

sudo dmesg > dmesg.txt

Also, make sure that your display is connected to the Axon board while rebooting the system. During the reboot process, the driver probe function runs in the background, so the display must be connected at that time.

Additionally, please send a photo of your setup showing the display connected to the Axon board

Important:
Make sure no other overlays are enabled that use SPI1. The SPI1 interface can only be used by one peripheral at a time. If you are using SPI1 for the display, do not enable any other overlays that also use SPI1.

dmesg.txt.txt (81.4 KB)

@vatsal Attached the log file here.

Sorry for the mistake earlier. The framebuffer is actually being created correctly. In your case, fb0 is created for the display (not fb1).

From the dmesg logs, I can confirm that fb0 is successfully initialized for your ST7789V display:

[ 19.014982] graphics fb0: fb_st7789v frame buffer, 240x280, 131 KiB video memory, 4 KiB buffer memory, fps=31, spi1.0 at 30 MHz

You can now proceed to develop your own C program to send data to /dev/fb0 and control the display as per your requirements.

@Pradhuman, Have you tried from your side !?