Waveshare 2.8 A (or 3.2 B) TFT LCD with Orange Pi Zero LTS


ej0rge
 Share

1 1

Recommended Posts

I don't want to talk about how long i beat my head against this but i have it working so i thought i would share. 

 

First, in the 5.4.y kernels, the fbtft_device module seems to be missing? So i am using 5.90 oragepizero ubuntu bionic next 4.19.57 as my image, kernel is upgraded to 4.19.62-sunxi via regular apt-get upgrade.

 

I have a genuine waveshare 2.8 A rpi lcd. Waveshare states repeatedly that it is compatible with the 3.2 B rpi lcd except for the screen size and number of buttons, so this should work for the 3.2 B lcd as well. 

 

This blog post was pretty helpful: https://kaspars.net/blog/spi-display-orange-pi-zero

 

But it leaves out the necessity of enabling the spi bus overlays. 

 

So, using armbian-config, go into system -> hardware -> and enable spi-spidev and (I think?) spi-add-cs1 (as recommended by some other posts i have seen). 

 

Then edit (as root) /boot/armbianEnv.txt and add these lines: 

 

param_spidev_spi_bus=1
param_spidev_spi_cs=1

extraargs="fbcon=map:8"
 

edit /etc/modules-load.d/modules.conf and add these lines: 

 

fbtft
fbtft_device

 

create /etc/modprobe.d/fbtft.conf containing this line: 

 

options fbtft_device rotate=90 name=waveshare32b busnum=1 gpios=dc:3,reset:0 speed=32000000

 

Here's the kicker though. According to the wiki page for this lcd, the lcd cable select is connected to pin 24 and the touchscreen cs pin is on pin 26

 

https://www.waveshare.com/wiki/2.8inch_RPi_LCD_(A)

 

But i only had a white screen until i removed the "CS=1" argument from the options line. 

 

I don't' get it. Maybe this means i can't use the touch screen, but I'm not sure i want it for my application. 

 

But if someone can explain what the logic is there, that would be great. 

 

My plan is to ultimately install retropie on it, and remix the "mini commodore pet" retropie enclosure to fit an opi zero instead of a raspberry pi. I've looked at retrorangepi and they don't really target this kind of configuration so that seems like the way to go. 

Link to post
Share on other sites

Donate and support the project!

Looking through the git logs i found this commit: 

https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/commit/drivers/staging/fbtft?h=staging-testing&id=2962db71c7030868b6859d09b2138b55297df95e

 

Quote

Commit c440eee1a7a1 ("Staging: fbtft: Switch to the gpio descriptor interface") removed the gpio code from fbtft_device rendering it useless.

 

fbtft_device is a module that was used on the Raspberry Pi to dynamically add fbtft devices when the Pi didn't have Device Tree support. Just remove the module since it's the responsibility of Device Tree, ACPI or platform code to add devices.

 

Which explains why the 5.4.y kernels don't include fbtft_device, and clarifies that the only way to use one of these devices in the 5.4.y kernel is with a dtoverlay. 

 

The reference for that would seem to be here: 

 

https://github.com/notro/fbtft/wiki/FBTFT-RPI-overlays

 

Naturally, the rpi overlays will have to be, uh, adjusted, to use them on any platform that is not an rpi.  I can't claim to have a deep understanding of how the device trees work, i'm just pretty sure that something that specifies a broadcom platform aint gonna work on an allwinner, rockchip, etc. 

 

If i feel a need for masochism i might look into it again. Maybe get some more usd cards so i can keep my working 4.19.y setup static. 

Link to post
Share on other sites

On 2/27/2020 at 10:02 AM, ej0rge said:

I don't want to talk about how long i beat my head against this but i have it working so i thought i would share. 

 

First, in the 5.4.y kernels, the fbtft_device module seems to be missing? So i am using 5.90 oragepizero ubuntu bionic next 4.19.57 as my image, kernel is upgraded to 4.19.62-sunxi via regular apt-get upgrade.

 

I have a genuine waveshare 2.8 A rpi lcd. Waveshare states repeatedly that it is compatible with the 3.2 B rpi lcd except for the screen size and number of buttons, so this should work for the 3.2 B lcd as well. 

 

This blog post was pretty helpful: https://kaspars.net/blog/spi-display-orange-pi-zero

 

But it leaves out the necessity of enabling the spi bus overlays. 

 

So, using armbian-config, go into system -> hardware -> and enable spi-spidev and (I think?) spi-add-cs1 (as recommended by some other posts i have seen). 

 

Then edit (as root) /boot/armbianEnv.txt and add these lines: 

 

param_spidev_spi_bus=1
param_spidev_spi_cs=1

extraargs="fbcon=map:8"
 

edit /etc/modules-load.d/modules.conf and add these lines: 

 

fbtft
fbtft_device

 

create /etc/modprobe.d/fbtft.conf containing this line: 

 

options fbtft_device rotate=90 name=waveshare32b busnum=1 gpios=dc:3,reset:0 speed=32000000

 

Here's the kicker though. According to the wiki page for this lcd, the lcd cable select is connected to pin 24 and the touchscreen cs pin is on pin 26

 

https://www.waveshare.com/wiki/2.8inch_RPi_LCD_(A)

 

But i only had a white screen until i removed the "CS=1" argument from the options line. 

 

I don't' get it. Maybe this means i can't use the touch screen, but I'm not sure i want it for my application. 

 

But if someone can explain what the logic is there, that would be great. 

 

My plan is to ultimately install retropie on it, and remix the "mini commodore pet" retropie enclosure to fit an opi zero instead of a raspberry pi. I've looked at retrorangepi and they don't really target this kind of configuration so that seems like the way to go. 

 

1. Did you mean this LCD is not going to work on the latest armbian image for this board (Armbian_21.08.1_Orangepizero_focal_current_5.10.60.img)(uname -a: Linux orangepi 5.10.60-sunxi #21.08.1 SMP Wed Aug 25 18:19:32 UTC 2021 armv7l armv7l armv7l GNU/Linux)?

 

2. Is there any LCD that will "just work" with this board, like the Waveshare 2.8" LCD does with raspberry pi?

 

3. Is this the link to the OS image mentioned in your post? 

https://armbian.systemonachip.net/archive/orangepizero/archive/Armbian_5.90_Orangepizero_Ubuntu_bionic_next_4.19.57.7z

 

4. In one of your other posts you mentioned getting the touch screen to work on this LCD, but on an Orangepi PC 2 board (https://forum.armbian.com/topic/13233-any-clues-for-the-creation-of-a-dtoverlay-for-fbtft-on-54y/?do=findComment&comment=96707). Do you think touch can be made to work on orangepi zero as well, either in the latest OS image or the Ubuntu_bionic_next_4.19.57 image?

Link to post
Share on other sites

On 11/2/2021 at 8:28 AM, mahaju said:

 

1. Did you mean this LCD is not going to work on the latest armbian image for this board (Armbian_21.08.1_Orangepizero_focal_current_5.10.60.img)(uname -a: Linux orangepi 5.10.60-sunxi #21.08.1 SMP Wed Aug 25 18:19:32 UTC 2021 armv7l armv7l armv7l GNU/Linux)?

 

2. Is there any LCD that will "just work" with this board, like the Waveshare 2.8" LCD does with raspberry pi?

 

3. Is this the link to the OS image mentioned in your post? 

https://armbian.systemonachip.net/archive/orangepizero/archive/Armbian_5.90_Orangepizero_Ubuntu_bionic_next_4.19.57.7z

 

4. In one of your other posts you mentioned getting the touch screen to work on this LCD, but on an Orangepi PC 2 board (https://forum.armbian.com/topic/13233-any-clues-for-the-creation-of-a-dtoverlay-for-fbtft-on-54y/?do=findComment&comment=96707). Do you think touch can be made to work on orangepi zero as well, either in the latest OS image or the Ubuntu_bionic_next_4.19.57 image?

You would have to check first if you kernel modules has the fbtft modules built (most of the fbtft modules are in the staging).

The configuration is in "Support for small TFT LCD display modules" in staging. Second you have to check if in that modules your
LCD display controller has a driver, but Waveshare  doesn't mention it's display controller. I have a 2.8" spi LCD with ILI9341 controller working on a nanopi neo2, the driver is already in the staging for ILI93141 it just have to be enabled. You may have to build your own kernel if the modules are not built.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

1 1