ILI9486 is the chip powering most 3.5" SPI displays targeted for Raspberry Pi and features a 480x320 resolution. The touch controller is based on XPT2046 chip.
Some common names for compatible displays are:
- MHS3528
- MPI3501
- Waveshare 3.5’ RPi LCD A
- Velleman VMP400 (Rebrand MPI3501)
The upstream Linux driver was fixed by one our consultancy BayLibre on 2022-11-28 and that software work should appear in Linux 6.3. You will need to use our kernel with at least version 6.0.10-00437 or higher.
To get it working:
sudo apt update
sudo apt dist-upgrade
sudo ldto enable spi0-cs1
sudo ldto enable spi0-cs1-ili9486-xpt2046
If the ldto command cannot be found, install the libretech-wiring-tool. Our new images already include this so you can skip if you are using a recent image.
To apply permanently on every boot.
sudo ldto merge spi0-cs1
sudo ldto merge spi0-cs1-ili9486-xpt2046
To remove:
sudo ldto reset
sudo reboot
If you do not reboot after reset, you will not get the correct results if you merge again.
ili9486-xpt2046 is the generic overlay. We have pre-tuned the touchscreen for
mhs3528 and mpi3501 displays. To use the pre-tuned overlays, replace ili9486-xpt2046 from the instructions above with the name of the display.
If you are using X11 or Raspbian Desktop, you need to create the file /usr/share/X11/xorg.conf.d/10-ili9486.conf
if it does not exist already with the following contents:
Section "OutputClass"
Identifier "ILI9486"
MatchDriver "ili9486"
Driver "modesetting"
Option "PrimaryGPU" "true"
EndSection
Also disable HDMI as the primary output by editing /usr/share/X11/xorg.conf.d/10-rockchip.conf
and commenting out or removing the the PrimaryGPU option.
Section "OutputClass"
Identifier "Rockchip"
MatchDriver "rockchip"
Driver "modesetting"
#Option "PrimaryGPU" "true"
EndSection
1 Like
Can confirm that these instructions work! Thank you so much!
I noticed performance issues with my Renegade as well as my Le Potato using the following display:
http://www.lcdwiki.com/MHS-3.5inch_RPi_Display
On my Raspberry Pi 3B (1GB RAM) with the same display the GUI works smoothly and opening Chromium and browsing is not an issue. On the Renegade and Le Potato however it is practically unusable due to VERY high lag. On the Le Potato I cannot even open Chromium.
Looks like there might be a display driver issue. Any idea what I can do?
I already did:
-sudo apt update
-sudo apt dist-upgrade
-sudo apt install libretech-gpio libretech-dtoverlay
-reinstalled chromium
We are using the Linux kernel driver for ili9486. The code for LCD show does a bunch of hacks and create buffers and buffer diffs in userspace and copies it to the LCD for better performance.
1 Like
THIRD EDIT: Geez this has been a day. Found out the input calibrator straight lied to me. Ended up using values I found to get it working. If anyone can tell me, what’s the smoothest way to display video? Either opening a file or using an app? I’m going to use this as my octoprint server, and in the meantime have it possibly play random gifs or something.
SECOND EDIT: My only problem now is calibrating the touch screen. I’ve followed through with calibration, created the calibration file and updated it, but now my touches go all the way to the top left no matter what. Even messing with the values doesn’t work.
EDIT: Scratch that, found how to update the repo here
Using the Ubuntu image provided by you guys, I’m able to get my lcd display working. But you mention in this post that there are tuned overlay for the mp3501. When replacing the commands as said, it says it doesn’t exist. After digging in the files (specifically the /opt/ folder) I find where the overlays exist, but mpi3501 isn’t there like it is in the github repository.
What’s the method for updating this? I tried updating packages but it says it’s all up to date.
SPI displays are not ideal for video because the bandwidth is incredibly limited. You will get a maximum of 10fps is your video change the whole frame. 40MHz / 16 bit per pixel / 480 hres / 320 vres = 16 FPS before overhead.