Just recently bought this cheap ili9341 spi tft lcd from online store and want to test it whether it's working or not.
For a quick and simple check I'm just using the default spi channel 0 from raspberry pi gpio, and here is the connection between them :
On this test I'm using rpi 3A+ because … dunno, it's just laying around on my drawer while the others still wired to some my unfinished project (you may use whatever rpi model from zero to rpi 4 as long as have gpio tho). Ok, so … I fire up a balena etcher to write a raspbian buster lite unto a flashdisk on my laptop and wait several minutes until complete and then fire up on rpi 3A+.
First thing after boot up, I use raspi-config to adjust localization, disable overscan and enable SPI interfacing and follow by a reboot.
After reboot, the spidev is active and I can do a modprobe for fbtft device :
sudo modprobe fbtft_device custom name=fb_ili9341 gpios=reset:25,dc:24,led:18 speed=16000000
The backlight of the LCD should kick in and I can see a faint glow on the screen which of course, is a good sign. Then to shows and sets mapping between consoles and LCD framebuffer I use :
con2fbmap 1 1
… and yaaay, it's working.
I've got what i want, the lcd is working good, but while the night is still young, I also want to test the fbcp which I always use for my other lcd projects on this ili9341 lcd. So, first thing first, I have to make this lcd load module stick on every boot before running the fbcp module.
I edit /etc/modules and add this module to load during boot :
and for the extra parameter setting for this lcd, I create /etc/modprobe.d/fbtft.conf and fill it in with this setting :
options fbtft_device name=fb_ili9341 gpios=reset:25,dc:24,led:18 bgr=1 rotate=90 speed=16000000 custom=1
do note, I use bgr color mode and rotate the screen to landscape to meet my needs. Then I reboot.
After reboot, I can see the lcd backlight is lit which tell me the module is loaded properly and all is good.
Now, for framebuffer copy tool aka fbcp, I do a quick compile as below :
sudo apt-get install cmake git clone https://github.com/tasanakorn/rpi-fbcp cd rpi-fbcp/ mkdir build cd build/ cmake ../ make sudo install fbcp
and then finally run fbcp :
Great, fbcp is working without problem.