XPT2046 3.5 screen on console?

Hello people, I hope you’re all doing well !

I’m trying to get this small 3.5 LCD inches display to work. I used this some year ago but I really can’t remember how I did it.
I’ve found a couple of threads here but not quite complete so I figured I’d ask before frying something…

I’ve found some instructions to install an “LCD-Show” driver (or something like that) but that appeared to be meant for a full xorg desktop.

I just want to display the output of a python script at the console…

So, do I need to install all of that or can I just use a “lighter” method? (i.e. framebuffer)

I’ve also found this thread which sounds to me like process for this display could be integrated with the DietPi tools, but I can’t find such thing. Maybe I’m missing something.

My display is a generic 480x320 - XTP2046, not quite matching the 320x280 waveshare2 option in dietpi-display.

host specs:

G_DIETPI_VERSION_CORE=9
G_DIETPI_VERSION_SUB=12
G_DIETPI_VERSION_RC=1
G_GITBRANCH=‘master’
G_GITOWNER=‘MichaIng’
bookworm 0
Linux DietPi 6.12.25+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.12.25-1+rpt1 (2025-04-30) aarch64 GNU/Linux
arm64
RPi 4 Model B (aarch64)

Thanks in advance.

ok, I made some progress but I will have to review the process and confirm a few things before I’m sure what the status really is now. It will take me a couple of days.

Just wanted to let you know so I don’t make anyone waste their time for now.

Ok, so I got it working and the process is quite straightforward.

In case this helps someone else, this is what works for me:

At first I got it working with a driver/overlay which, if I understood correctly, was for the 3.5 waveshare display but updated or recompiled for debian 12 bookworm.

That worked fine except that it would cause a kernel panic on most shutdown or reboots.

But then I stumbed with my generic display’s cardbox which has a label (and that is why I had kept it, but of course I didn’t remeber) stating that it uses an ILI9486 driver (it turns out “XPT2046” printed on the back references the tactile controller of the unit, not the display’s controller).

And with that info I did find more accurate data on how to do this and was able to piece it together:

  1. Edit “/boot/config.txt” and make sure to have this entries, some may be already present but commented, som you would have to add or change:
#-------SPI-------------
dtparam=spi=on
disable_fw_kms_setup=1

#-------Custom entries -------------
# This line correctly invokes the built in driver for this display
dtoverlay=piscreen:rotate=0,drm
hdmi_force_hotplug=1
hdmi_group=2
hdmi_mode=1
hdmi_mode=87
# This sets the output resolution and (third entry) refresh frequency
hdmi_cvt=480 320 60 6 0 0 0
hdmi_drive=2

Note:
You can also activate the “hdmi_safe = 1” to force the image to also be sent to your external HDMI, so you have image even if you still couldn’ t get the 3.5 display to work.

  1. Edit “/boot/cmdline.txt” and append this after the text already there.

    The file needs to remain a single line, so do not insert any line breaks in it.

fbcon=map:10 fbcon=rotate:0 fbcon=font:ProFont6x11

And that’s it!

Now, this may not be the way to get the fastest screen performance, I really don’t now, because that wasn’ t really relevant to my use case.

What this allows for me is to have my custom made console dashboard on screen without any additional drivers, without X, and without too much overhead (if any?).

Hopefully this might be useful for someone else too.

Regards.