User avatar
HermannSW
Posts: 2818
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

How to enable ili9341 display during boot? (and ili9481)

Sun Oct 01, 2017 6:01 pm

I know how to use "sudo modprobe fbtft_device ..." to setup a ili9341 display from the command line on SPI0.

I even found how to do that when connecting display on PI Zero's SPI1 instead of SPI0:
viewtopic.php?f=44&t=22608&p=1216154#p1216154

I changed "reset" pin GPIO23 to GPIO25 for rpi-display via "gpios=..." to get a compact superglued connector for SPI0:
viewtopic.php?f=63&t=157618&p=1214626#p1214626

Later I realized that this changed pin is the default for "adafruit22a" display. And really this started my display on SPI0 with default values:

Code: Select all

$ sudo modprobe fbtft_device name=adafruit22a rotate=90
Then I had to learn that "sudo modprobe fbtft_device ..." does not allow to setup two displays at the same time.
Instead I should setup one display at boot time, and the second with the mentioned command.

I found a youtube video demonstrating that two ili9341 displays can work on Raspberry Pi:
https://www.youtube.com/watch?v=wxJpWRPKe-g
Image


I found this description of steps on how to get ili9341 loaded at bood time:
http://www.raspberrypirobot.com/2-2-tft ... spberrypi/

I only did the addition to "/etc/modules" as described and rebooted -- no effect.
Then I did the "Install notro rpi-firmware update" step from that description and rebooted.
Now the Pi Zero does not boot anymore. Even uncommenting the /etc/modules line on SD card in laptop did not help.
Definitely that firmware update kills a latest and updated Raspbian stretch.
(I connected a HDMI monitor and see nothing, PI Zero activity LED keeps blinking)


So my question is simple, just for one ili9341 display that is connected so that "sudo modprobe fbtft_device name=adafruit22a rotate=90" starts it correctly from the command line, how can I install the adafruit22a module during boot on Raspbian Stretch?

I assume that this should not be difficult, but I was not able to find out how.

Hermann.
Last edited by HermannSW on Tue Nov 05, 2019 9:27 pm, edited 1 time in total.
https://stamm-wilbrandt.de/en/Raspberry_camera.html
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/raspiraw
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264

DirkS
Posts: 10398
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: How to enable ili9341 display during boot?

Sun Oct 01, 2017 7:24 pm

HermannSW wrote:
Sun Oct 01, 2017 6:01 pm
So my question is simple, just for one ili9341 display that is connected so that "sudo modprobe fbtft_device name=adafruit22a rotate=90" starts it correctly from the command line, how can I install the adafruit22a module during boot on Raspbian Stretch?
Maybe using the pitft22 device tree overlay instead of using outdated instructions (and probably installing old kernel / firmware in the process)?
See /boot/overlays/README , https://github.com/raspberrypi/linux/tr ... s/overlays and https://github.com/raspberrypi/linux/bl ... verlay.dts

It uses spi0.0 and GPIO25 by default, but you can modify / compile the overlay from source

User avatar
HermannSW
Posts: 2818
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: How to enable ili9341 display during boot?

Sun Oct 01, 2017 10:03 pm

Thank you so much!

Now I read on device trees, how to compile with "dtc", to store under "/boot/overlays", ... .
Especially I read that the overlays of the form "....-overlay.dts" are not correct anymore, like the one you pointed to.

I found "/boot/overlays/adafruit22.dtbo" and tried with "dtoverlay=adafruit22" in /boot/config.txt, but that did not work.
Then I found "/boot/overlays/rpi-display.dtbo" and tried with "dtoverlay=rpi-display" in /boot/config.txt, and that did work!

Unfortunately that had reset pin on GPIO23 and not on GPIO25 where my connector expects it. And more importantly, it defines a pen input on GPIO25 which my TFT does not have (no touch screen). And the LED on GPIO18 (which I don't need and want to map to GPIO27 where it does not do harm to the 40 Pi Zero pins) avoids enabling SPI1 (when I put "dtoverlay=spi1-3cs" into /boot/config.txt to enable SPI1, display fails with error on GPIO18).

I tried to use "fdtdump" to get a valid "rpi-display.dts" input file, but there is too much stuff in, and I failed to clean that up. Googling for "rpi-display.dts" only shows locations of "rpi-display-overlay.dts" which is old and did not work after compiling with dtc.

Where can I find the original "rpi-display.dts" source file that is used in Raspbian Stretch to create "/boot/overlays/rpi-display.dtbo"?
(as basis for my modifications)
https://stamm-wilbrandt.de/en/Raspberry_camera.html
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/raspiraw
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264

DirkS
Posts: 10398
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: How to enable ili9341 display during boot?

Sun Oct 01, 2017 10:11 pm

HermannSW wrote:
Sun Oct 01, 2017 10:03 pm
Where can I find the original "rpi-display.dts" source file that is used in Raspbian Stretch to create "/boot/overlays/rpi-display.dtbo"?
See the first link in my previous post.
dts files have '-overlay' added to the name:
That part is removed after compilation

User avatar
HermannSW
Posts: 2818
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: How to enable ili9341 display during boot?

Sun Oct 01, 2017 10:53 pm

I used the one you pointed to:
https://github.com/raspberrypi/linux/bl ... verlay.dts

I compiled with:

Code: Select all

pi@raspberrypi:~ $ dtc -I dts -O dtb -o pitft22a.dtbo pitft22-overlay.dts
pitft22a.dtbo: Warning (unit_address_vs_reg): Node /fragment@0 has a unit name, but no reg property
pitft22a.dtbo: Warning (unit_address_vs_reg): Node /fragment@0/__overlay__/spidev@0 has a unit name, but no reg property
pitft22a.dtbo: Warning (unit_address_vs_reg): Node /fragment@0/__overlay__/spidev@1 has a unit name, but no reg property
pitft22a.dtbo: Warning (unit_address_vs_reg): Node /fragment@1 has a unit name, but no reg property
pitft22a.dtbo: Warning (unit_address_vs_reg): Node /fragment@2 has a unit name, but no reg property
pi@raspberrypi:~ $ 
Then I copied pitft22a.dtbo into /boot/overlays and added this to /boot/config.txt:

Code: Select all

dtoverlay=pitft22a
dtparam=rotate=90
And this appears in dmesg:

Code: Select all

[   45.026328] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
[   45.059993] fb_ili9340: module is from the staging directory, the quality is unknown, you have been warned.
[   45.071315] fbtft_of_value: buswidth = 8
[   45.071332] fbtft_of_value: debug = 0
[   45.071341] fbtft_of_value: rotate = 90
[   45.071347] fbtft_of_value: fps = 25
[   45.607371] graphics fb1: fb_ili9340 frame buffer, 320x240, 150 KiB video memory, 4 KiB DMA buffer memory, fps=25, spi0.0 at 32 MHz
But that gives a white screen only, does not work ...

This is dmesg output with "dtoverlay=rpi-display", which allows to work with /dev/fb1:

Code: Select all

[   19.038794] spi0.1 supply vcc not found, using dummy regulator
[   19.049469] ads7846 spi0.1: touchscreen, irq 185
[   19.073315] input: ADS7846 Touchscreen as /devices/platform/soc/20204000.spi/spi_master/spi0/spi0.1/input/input0
[   19.073876] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
[   19.093895] fb_ili9341: module is from the staging directory, the quality is unknown, you have been warned.
[   19.096074] fbtft_of_value: buswidth = 8
[   19.096088] fbtft_of_value: debug = 0
[   19.096095] fbtft_of_value: rotate = 90
[   19.096101] fbtft_of_value: fps = 30
[   19.908015] graphics fb1: fb_ili9341 frame buffer, 320x240, 150 KiB video memory, 16 KiB DMA buffer memory, fps=33, spi0.0 at 32 MHz
https://stamm-wilbrandt.de/en/Raspberry_camera.html
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/raspiraw
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264

User avatar
HermannSW
Posts: 2818
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: How to enable ili9341 display during boot?

Sun Oct 01, 2017 11:08 pm

Thank you, I found the .dts for rpi-display in the folder you pointed to!
https://github.com/raspberrypi/linux/bl ... verlay.dts

Compiling and storing where it needs to go:

Code: Select all

pi@raspberrypi:~ $ sudo dtc -I dts -O dtb -o /boot/overlays/rpi-displa0.dtbo  rpi-display-overlay.dts 
/boot/overlays/rpi-displa0.dtbo: Warning (unit_address_vs_reg): Node /fragment@0 has a unit name, but no reg property
/boot/overlays/rpi-displa0.dtbo: Warning (unit_address_vs_reg): Node /fragment@1 has a unit name, but no reg property
/boot/overlays/rpi-displa0.dtbo: Warning (unit_address_vs_reg): Node /fragment@2 has a unit name, but no reg property
/boot/overlays/rpi-displa0.dtbo: Warning (unit_address_vs_reg): Node /fragment@3 has a unit name, but no reg property
/boot/overlays/rpi-displa0.dtbo: Warning (unit_address_vs_reg): Node /fragment@4 has a unit name, but no reg property
pi@raspberrypi:~ $ 
In /boot/config.txt:

Code: Select all

...
dtoverlay=rpi-displa0
dtparam=rotate=90
...
After reboot the ili9341 display gets black, and "tail --bytes 153600 giraffe.565 > /dev/fb1" on command line shows giraffe.

Now I need to modify that .dts to match my display (remove pen input) and don't use GPIO18 for LED in order to allow for SPI1 to be enabled.
https://stamm-wilbrandt.de/en/Raspberry_camera.html
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/raspiraw
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264

User avatar
HermannSW
Posts: 2818
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: How to enable ili9341 display during boot?

Mon Oct 02, 2017 12:37 am

It was so straight forward/easy to modify the .dts to my display's and not-GPIO18 requirements!
See the diff (remove pen input on GPIO25, move reset from GPIO23 to GPIO25, move LED from GPIO18 to GPIO27) at bottom, as well as link to full file.

This are the relevant /boot/config.txt parts for enabling SPI1 with 3 chip select lines, and rpi-display0 as described before:

Code: Select all

dtparam=spi=on
dtoverlay=spi1-3cs
...
dtoverlay=rpi-displa0
dtparam=rotate=90
...
After boot /dev/fb1 is available for rpi-displa0 display on SPI0 with CE0. This command line creates /dev/fb2 for the 2nd display on SPI1 with CE2:

Code: Select all

pi@raspberrypi:~ $ sudo modprobe fbtft_device name=rpi-display gpios=reset:13,dc:26,led:28 rotate=90 cs=2 busnum=1
pi@raspberrypi:~ $ 
LED line is not needed for that display as well, so here GPIO28 does not affect any of the 40 Pi Zero GPIO pins.
Here you can see first success, 1 Pi Zero, 2 ili9341 displays (on 2 SPI busses) !
Image

Hermann.

https://stamm-wilbrandt.de/en/forum/rpi-displa0.dts

Code: Select all

pi@raspberrypi:~ $ diff rpi-display-overlay.dts rpi-displa0.dts 
2c2
<  * Device Tree overlay for rpi-display by Watterott
---
>  * Device Tree overlay for ili9341 display
37,39c37,39
< 				brcm,pins = <18 23 24 25>;
< 				brcm,function = <1 1 1 0>; /* out out out in */
< 				brcm,pull = <0 0 0 2>; /* - - - up */
---
> 				brcm,pins = <27 25 24>;
> 				brcm,function = <1 1 1>; /* out out out */
> 				brcm,pull = <0 0 0>; /* - - - */
62c62
< 				reset-gpios = <&gpio 23 0>;
---
> 				reset-gpios = <&gpio 25 0>;
64c64
< 				led-gpios = <&gpio 18 1>;
---
> 				led-gpios = <&gpio 27 1>;
67,78d66
< 
< 			rpidisplay_ts: rpi-display-ts@1 {
< 				compatible = "ti,ads7846";
< 				reg = <1>;
< 
< 				spi-max-frequency = <2000000>;
< 				interrupts = <25 2>; /* high-to-low edge triggered */
< 				interrupt-parent = <&gpio>;
< 				pendown-gpio = <&gpio 25 0>;
< 				ti,x-plate-ohms = /bits/ 16 <60>;
< 				ti,pressure-max = /bits/ 16 <255>;
< 			};
86,87d73
< 		xohms =   <&rpidisplay_ts>,"ti,x-plate-ohms;0";
< 		swapxy =  <&rpidisplay_ts>,"ti,swap-xy?";
pi@raspberrypi:~ $ 
https://stamm-wilbrandt.de/en/Raspberry_camera.html
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/raspiraw
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264

User avatar
HermannSW
Posts: 2818
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: How to enable ili9341 display during boot?

Tue Oct 03, 2017 1:08 am

In this posting the complete boot process ending with two framebuffer indicators on the displays is described in detail:
viewtopic.php?f=43&t=193722&p=1217930#p1217930

For some reason a 1 second sleep is needed before the 2nd display on SPI1 can be modprobed, after SPI1 got enabled. This may be the reason why a dt overlay I tried to generate for 2nd display on SPI1 did not work (too early).

Is there something equivalent to "sleep 1" I could place between "dtoverlay=spi1-3cs" and "dtoverlay=rpi-displa1" in /boot/config.txt to delay processing of "dtoverlay=rpi-displa1" until after SPI1 is available?
Or better, a "wait until SPI1 is up"?
(I did change "target = <&spi0>;" to "target = <&spi1>;" in fragment@0 of new "rpi-displa1.dts" without the needed wait effect)

Image
https://stamm-wilbrandt.de/en/Raspberry_camera.html
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/raspiraw
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264

User avatar
HermannSW
Posts: 2818
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: How to enable ili9341 display during boot?

Tue Nov 05, 2019 1:52 pm

In today's email from Aliexpress I saw 9$ free shipping 480x320 3.5" LCD touchscreen:
https://www.aliexpress.com/item/32587995145.html

Then I remembered that I bought such display, and confirmed on aliexpress orderlist (for 12$ two years ago).
I looked newly into notro's fbtft wiki, and that was good.
https://github.com/notro/fbtft/wiki

No overlay needed, I was able to make that display work with a single command:

Code: Select all

sudo modprobe fbtft_device name=ili9481
The startup messages can be seen by following "dmesg" call at the end.
(Calling with "name=list" shows all available drivers in dmesg)

OK, working but not really useful, display was horizontally mirrored.
I learned again that fbtft module can be removed by:

Code: Select all

sudo modprobe -r fbtft_device

Adding rotate=90 did the trick then to get fully working Buster console on LCD:

Code: Select all

sudo modprobe fbtft_device name=ili9481 rotate=90

Next I followed steps in "Make it permanent" section and created these two files:
https://github.com/notro/fbtft/wiki#mak ... ux-systemd

Code: Select all

pi@raspberrypi4B:~ $ cat /etc/modules-load.d/fbtft.conf 
spi-bcm2835
fbtft_device
pi@raspberrypi4B:~ $ cat /etc/modprobe.d/fbtft.conf 
options fbtft_device name=ili9481 rotate=90
pi@raspberrypi4B:~ $ 
After reboot LCD came up directly.

I took a 2MP 25fps video from 2nd Pi v2 camera of the white phase after "sudo reboot 0". Display is all white for 11.8s (determined by single frame stepping youtube video), prompt after reboot shows up after 22s:
https://www.youtube.com/watch?v=EoTD6pLmiQw
Image


Nice to have this cheap LCD with double the resolution of the three ili9341 LCDs I have.

Difference to Waveshare 7" DPMI display I have is, that raspivid preview does not show up on the LCD but on a connected HDMI monitor.

Finally I remembered 6by9's tip that "-dn, --dispnum" allows to set the preview display:
https://www.raspberrypi.org/forums/view ... 4#p1545341
Unfortunately SPI display cannot be addressed:

Code: Select all

0 = DSI/DPI LCD
2 = HDMI0
3 = SDTV
7 = HDMI1
https://stamm-wilbrandt.de/en/Raspberry_camera.html
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/raspiraw
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264

alexryndin
Posts: 2
Joined: Fri Dec 06, 2019 10:53 pm

Re: How to enable ili9341 display during boot?

Fri Dec 06, 2019 11:01 pm

HermannSW wrote:
Tue Nov 05, 2019 1:52 pm
In today's email from Aliexpress I saw 9$ free shipping 480x320 3.5" LCD touchscreen:
HermannSW, Thank you very much, I've managed to get my ili9486 working with your instructions! But a little problem is that as I understand there is no drivers for ili9486 in linux 4.19 yet, so I loaded ili9481 instead. I woluld like to ask if they differ a lot? Because despite my ili9486 works, white color doesn't looks properly and it kind of messed among lines of text -- some of them look much brighter than others

alexryndin
Posts: 2
Joined: Fri Dec 06, 2019 10:53 pm

Re: How to enable ili9341 display during boot?

Fri Dec 06, 2019 11:30 pm

HermannSW wrote:
Tue Nov 05, 2019 1:52 pm
In today's email from Aliexpress I saw 9$ free shipping 480x320 3.5" LCD touchscreen:
HermannSW, Thank you very much, I've managed to get my ili9486 working with your instructions! But a little problem is that as I understand there is no drivers for ili9486 in linux 4.19 yet, so I loaded ili9481 instead. I woluld like to ask if they differ a lot? Because despite my ili9486 works, white color doesn't looks properly and it kind of messed among lines of text -- some of them look much brighter than others

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9349
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: How to enable ili9341 display during boot? (and ili9481)

Sat Dec 07, 2019 9:36 pm

A driver for ili9486 is present in the 4.19 kernel - https://github.com/raspberrypi/linux/bl ... _ili9486.c
You need to add CONFIG_FB_TFT_ILI9486 to your kernel configuration and rebuild the kernel for it to be available.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Nezra
Posts: 1
Joined: Thu Nov 23, 2017 8:59 pm

Re: How to enable ili9341 display during boot? (and ili9481)

Thu Jan 30, 2020 2:57 am

@HermannSW,

love the work sir. question on those screens you are using. have you any advice for shifting the xpt2046 to SPI1? or do you have any device tree overlay suggestions for messing with SPI1 to make it work? there's so much old information out there now its hard to sift through it all.

Ebben
Posts: 21
Joined: Wed Mar 18, 2020 10:44 pm

Re: How to enable ili9341 display during boot? (and ili9481)

Mon Apr 13, 2020 8:50 pm

Hi, can someone help me? I am at the point where I got two white screens, I want to put a game into the pi0w and make the game extend throughout both screens.

User avatar
HermannSW
Posts: 2818
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: How to enable ili9341 display during boot? (and ili9481)

Tue Apr 14, 2020 3:08 pm

Ebben wrote:
Mon Apr 13, 2020 8:50 pm
Hi, can someone help me?
How? You did not even state which display you.
Please add link to display product description.
Then tell how you did connect the display (which pins of display to which GPIO pins).
Finally, which steps did you do to trying to get the display working?
https://stamm-wilbrandt.de/en/Raspberry_camera.html
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/raspiraw
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264

User avatar
HermannSW
Posts: 2818
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: How to enable ili9341 display during boot? (and ili9481)

Tue Apr 14, 2020 3:09 pm

Nezra wrote:
Thu Jan 30, 2020 2:57 am
question on those screens you are using. have you any advice for shifting the xpt2046 to SPI1?
I never worked with touch displays (don't like dirt on display).
I have touch on my wireless keyboard:
viewtopic.php?f=45&t=219214
Without touch even cheap big HDMI displays can be used, like my 26$ 9° HDMI display:
viewtopic.php?p=1623477#p1623477
or do you have any device tree overlay suggestions for messing with SPI1 to make it work?
I only once had to do with SPI1, when I needed to connect two ili9341 SPI displays to a Pi.
Perhaps the information might help you:
viewtopic.php?f=43&t=193722&p=1215208#p1217930
Image
https://stamm-wilbrandt.de/en/Raspberry_camera.html
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/raspiraw
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264

Ebben
Posts: 21
Joined: Wed Mar 18, 2020 10:44 pm

Re: How to enable ili9341 display during boot? (and ili9481)

Wed Apr 15, 2020 6:53 pm

HermannSW wrote:
Tue Apr 14, 2020 3:08 pm
Ebben wrote:
Mon Apr 13, 2020 8:50 pm
Hi, can someone help me?
How? You did not even state which display you.
Please add link to display product description.
Then tell how you did connect the display (which pins of display to which GPIO pins).
Finally, which steps did you do to trying to get the display working?
Yes, sir, I followed you almost step by step. I'm using the same displays as you are. And here is my pin diagram:
RPI0... LCD
3V3... VCC
GROUND... Gnd
GPIO18 ... LED
GPIO23 ... DC/RS
SPI/MOSI... SDI/MOSI
SPI/MISO... SDI/MISO
GPIO25 ... RESET
SCLK ... SCK
CE0_N ... CS

RPI0 ... LCD2
3V3 ... VCC
GROUND... Gnd
GPIO16 ... LED
GPIO26 ... DC/RS
GPIO20 ... SDI/MOSI
GPIO19 ... SDI/MISO
GPIO6 ... RESET
GPIO21 ... SCK
CE1_N ... CS


hope this helps you understand my situation a little better.

User avatar
HermannSW
Posts: 2818
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: How to enable ili9341 display during boot? (and ili9481)

Thu Apr 16, 2020 6:24 pm

Do both displays work when connected alone to SPI0?
https://stamm-wilbrandt.de/en/Raspberry_camera.html
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/raspiraw
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264

Ebben
Posts: 21
Joined: Wed Mar 18, 2020 10:44 pm

Re: How to enable ili9341 display during boot? (and ili9481)

Thu Apr 16, 2020 8:08 pm

HermannSW wrote:
Thu Apr 16, 2020 6:24 pm
Do both displays work when connected alone to SPI0?
Yes! they do work, but they just show a white screen
I basically just need (((((all the code))) needed to make them work

User avatar
HermannSW
Posts: 2818
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: How to enable ili9341 display during boot? (and ili9481)

Fri Apr 17, 2020 8:56 am

Ebben wrote:
Thu Apr 16, 2020 8:08 pm
Yes! they do work, but they just show a white screen
White screen is "do NOT work".
I basically just need (((((all the code))) needed to make them work
Please execute "sudo modprobe fbtft_device name=list" and then "dmesg" and see whether this appears among the listed entries:

Code: Select all

...
[502541.129787] fbtft_device: rpi-display
...
https://stamm-wilbrandt.de/en/Raspberry_camera.html
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/raspiraw
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264

Ebben
Posts: 21
Joined: Wed Mar 18, 2020 10:44 pm

Re: How to enable ili9341 display during boot? (and ili9481)

Fri Apr 17, 2020 4:08 pm

HermannSW wrote:
Fri Apr 17, 2020 8:56 am

Please execute "sudo modprobe fbtft_device name=list" and then "dmesg" and see whether this appears among the listed entries:

Code: Select all

...
[502541.129787] fbtft_device: rpi-display
...
It did not work I got:

Code: Select all

modprobe: ERROR: could not insert 'fbtft_device': Operation canceled
What is wrong? I had one of the screens working just fine (When wired alone) I used framebuffer and it worked. Also, I think that my pi0 w is not connected to the internet.
I am so sorry to bother you, its just that I have never worked with this kind of thing before and I really want/need to learn. Thank you!

User avatar
HermannSW
Posts: 2818
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: How to enable ili9341 display during boot? (and ili9481)

Sat Apr 18, 2020 9:40 am

That is the normal message when the module is already loaded, please execute these two commands, it should show "rpi-display" for you as well. Then we can go with the next steps:

Code: Select all

🍓 sudo modprobe fbtft_device name=list
modprobe: ERROR: could not insert 'fbtft_device': Operation canceled
🍓 dmesg | grep "^\[`dmesg | tail -1 | cut -f1 -d\. | cut -f2 -d\[`\." | grep rpi-display
[591590.671151] fbtft_device: rpi-display
🍓 
https://stamm-wilbrandt.de/en/Raspberry_camera.html
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/raspiraw
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264

Ebben
Posts: 21
Joined: Wed Mar 18, 2020 10:44 pm

Re: How to enable ili9341 display during boot? (and ili9481)

Sat Apr 18, 2020 10:43 am

Code: Select all

[  254.449175] fbtft_device: rpi-display
Yes I think i got it!
Whats next

User avatar
HermannSW
Posts: 2818
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: How to enable ili9341 display during boot? (and ili9481)

Sun Apr 19, 2020 12:31 pm

Hi,
I found the Pi with female headers I used, and the two SPI displays with connectors.
All that was needed to get it working was fixing a broken header pin.
Besides that, just plugging the connectors as described, and reboot the Pi0.
I have several Pi0[W]s, on first boot this Pi0 told be "last login ... 2018" ...
So I have a running and working system, just recorded a remote reboot of the Pi0.
Totally forgot that it takes a minute to reboot, just took a video of the reboot with dual SPI displays.
Next steps for you will follow when I will be back from hiking:
(it is all described here: viewtopic.php?f=43&t=193722&p=1215208#p1217930)
https://www.youtube.com/watch?v=kaQC1UJt94k

Here are 10 seconds of the phase with activity of that video, scaled from 1920x1080@30fps to 640x360@5fps animated .gif for keeping size below 4MB:

Code: Select all

🍓 ffmpeg -i 20200419_135018.mp4 -filter:v scale=640:-1 -r 5 -ss 65 -t 10 Pi0_reboot.anim.gif
ffmpeg version 4.1.4-1+rpt7~deb10u1 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8 (Raspbian 8.3.0-6+rpi1)
...
frame=   50 fps=0.9 q=-0.0 Lsize=    3470kB time=00:00:09.81 bitrate=2897.5kbits/s dup=0 drop=245 speed=0.176x    
video:3469kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.033813%
🍓
Image
https://stamm-wilbrandt.de/en/Raspberry_camera.html
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/raspiraw
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264

Ebben
Posts: 21
Joined: Wed Mar 18, 2020 10:44 pm

Re: How to enable ili9341 display during boot? (and ili9481)

Sun Apr 19, 2020 2:12 pm

Hi, I hope you had a good time hiking!
I don't think that I get it, what am I supposed to do now. I've already seen that thread but I didn' get most of it.
If you could walk me through it I will be very grateful
(I want to get raspberrypi displaying on both screens dividing it on each one)

Thank you so far!!

Return to “Interfacing (DSI, CSI, I2C, etc.)”