WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Issues with Adafruit PiTFT display on picore 15  (Read 804 times)

Offline segfault

  • Newbie
  • *
  • Posts: 27
Issues with Adafruit PiTFT display on picore 15
« on: October 17, 2024, 02:35:03 PM »
Hi.

TL:DR; My display is not working and I think it might be because there is no: libgbm.so.1 on my picore 15?!

I've installed picore 15 and everything works fine on HDMI. Now Im trying to get SPI working.
Machine:
Adafruit PiTFT 3.5" 320 x 480 TFT w/ touch screen for raspberry pi model b+
Raspberry Pi Model B v1.1
I think the display is based on the HX8357D controller.

Code: [Select]
$ uname -m
armv7l
$ uname -r
6.6.47-piCore-v7

So I check the kernel config and see that CONFIG_TINYDRM_HX8357D and FIG_FB_TFT_HX8357D is =m (so it should be included in the kernel): http://tinycorelinux.net/15.x/armhf/releases/RPi/src/kernel/6.6.34-piCore-v7l_.config

So far so good... so to /mnt/mmcblk0p1/config.txt I added:
Code: [Select]
dtparam=spi=on
dtoverlay=pitft35-resistive,rotate=0,speed=16000000,fps=20

When machine starts display is white, then turns black when desktop is loaded.

Code: [Select]
$ dmesg | grep spi
[    4.157773] stmpe-spi spi0.1: stmpe610 detected, chip id: 0x811
[   28.619373] SPI driver fb_hx8357d has no spi_device_id for himax,hx8357d

Code: [Select]
$ ls /mnt/overlays
-rwxr-xr-x 1 root root   3213 Aug 31 20:01 pitft35-resistive.dtbo

Ok... so hx8357d seems to be built into the kernel, the pitft35 overlay is there and SPI driver tried so load, but something doesnt work.

Code: [Select]
$ cat /var/log/Xorg.0.log | grep EE
[    36.497] (EE) Failed to load /usr/local/lib/xorg/modules/drivers/modesetting_drv.so: libgbm.so.1: cannot      open shared object file: No such file or directory
[    36.497] (EE) Failed to load module "modesetting" (loader failed, 0

I look for libgbm.so.1 but can not find it:
Code: [Select]
$ ls /usr/local/lib/libgbm*
ls: cannot access '/usr/local/lib/libgbm*': No such file or directory

    [Edit]: Added code tags.  Rich
« Last Edit: October 17, 2024, 04:30:25 PM by Rich »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14849
Re: Issues with Adafruit PiTFT display on picore 15
« Reply #1 on: October 17, 2024, 02:40:59 PM »
Is libEGL loaded?

Offline segfault

  • Newbie
  • *
  • Posts: 27
Re: Issues with Adafruit PiTFT display on picore 15
« Reply #2 on: October 17, 2024, 02:59:54 PM »
Dont think so. I couldnt find it. So I did
Code: [Select]
tce-load -wi libEGL
tce-load -wi libGLES
sudo reboot

And where I before had nothing, I now get this:
Code: [Select]
tc@box:~$ ls /usr/local/lib/libEGL*
/usr/local/lib/libEGL.so  /usr/local/lib/libEGL.so.1  /usr/local/lib/libEGL.so.1.0.0

But the display is still black.

    [Edit]: Added code tags.  Rich
« Last Edit: October 17, 2024, 04:30:41 PM by Rich »

Offline segfault

  • Newbie
  • *
  • Posts: 27
Re: Issues with Adafruit PiTFT display on picore 15
« Reply #3 on: October 17, 2024, 03:01:19 PM »
Ah... but now I get:
Code: [Select]
tc@box:~$ cat /var/log/Xorg.0.log | grep EE
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[    36.475] (EE) Failed to load /usr/local/lib/xorg/modules/drivers/modesetting_drv.so: libgallium-24.2.5.so: cannot open shared object file: No such file or directory

So seems there have been some progress. :D

EDIT:
Code: [Select]
tc@box:~$ ls /usr/local/lib/libgallium*
ls: cannot access '/usr/local/lib/libgallium*': No such file or directory

    [Edit]: Added code tags.  Rich
« Last Edit: October 17, 2024, 04:30:59 PM by Rich »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14849
Re: Issues with Adafruit PiTFT display on picore 15
« Reply #4 on: October 17, 2024, 03:52:23 PM »
libgallium is in mesa - mesa was updated today, have you checked for updates?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: Issues with Adafruit PiTFT display on picore 15
« Reply #5 on: October 17, 2024, 04:32:13 PM »
Hi segfault
Please use  Code Tags  when posting commands and responses seen in a terminal. To use  Code Tags  click on the  #  icon
above the reply box and paste your text between the  Code Tags  as shown in this example:

Quote
[code][   36.176529] pcm512x 1-004d: Failed to get supply 'AVDD': -517
[   36.176536] pcm512x 1-004d: Failed to get supplies: -517
[   36.191753] pcm512x 1-004d: Failed to get supply 'AVDD': -517[/code]

It will appear like this in your post:
Code: [Select]
[   36.176529] pcm512x 1-004d: Failed to get supply 'AVDD': -517
[   36.176536] pcm512x 1-004d: Failed to get supplies: -517
[   36.191753] pcm512x 1-004d: Failed to get supply 'AVDD': -517

Code Tags  serve as visual markers between what you are trying to say and the information you are posting. They also preserve
spacing so column aligned data displays properly. Code tags also automatically add horizontal and or vertical scrollbars
to accommodate long lines and listings.

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 722
Re: Issues with Adafruit PiTFT display on picore 15
« Reply #6 on: October 17, 2024, 04:59:33 PM »
Make it easy for you and begin with raspberryos, and get it working with your display.
And then transfer all logic and knowledge to diet picore.

Offline segfault

  • Newbie
  • *
  • Posts: 27
Re: Issues with Adafruit PiTFT display on picore 15
« Reply #7 on: October 18, 2024, 03:35:55 PM »
libgallium is in mesa - mesa was updated today, have you checked for updates?

Ok, I tried it and while it did solve the missing .so files desktop failed to boot. Same SDCARD worked fine on my RPB4 though.

Please use  Code Tags  when posting commands and responses seen in a terminal.

Oh sorry.  :-[ Will do!

...begin with raspberryos...

Good idea.  8) I will do this. I downloaded Raspberry OS Lite and the display works fine there. I will create a diff of the OS before and after I run the adafruit install script. This way I guess I will be able to find changes to config files, etc.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: Issues with Adafruit PiTFT display on picore 15
« Reply #8 on: October 18, 2024, 05:29:47 PM »
Hi segfault
Comparing dmesg between a working and non-working setup
can provide valuable information about what the kernel is
doing as it's starting up.

Offline segfault

  • Newbie
  • *
  • Posts: 27
Re: Issues with Adafruit PiTFT display on picore 15
« Reply #9 on: October 19, 2024, 12:08:26 PM »
I installed Raspberry Pi OS and my Adafruit PiTFT display. Display works perfectly. I used dmesg as Rich suggested (thanks! :)) and found at that it uses fb_hx8357d.

I rebooted my picore15. I don't have /dev/fb1 and there is no mention of hx8357d when I run dmesg. Therefore I tried to manually load the driver using sudo modprobe fb_hx8357d but it wasn't available.

I used uname -a to find out machine/os info:
Code: [Select]
tc@box:~$ uname -a
Linux box 6.6.47-piCore-v7 #20 SMP Sat Aug 31 14:54:55 EDT 2024 armv7l GNU/Linux
and proceeded to downloaded drivers from this link http://tinycorelinux.net/15.x/armhf/releases/RPi/src/kernel/modules-6.6.47-piCore-v7l.tar.xz. I create my own .TCZ package, installed it and rebooted the computer. My TCE has a tce.sh script that copies the fb_hx8357d.to I extacted from the download, to /lib/modules/6.6.47-piCore-v7/kernel/drivers/video/fb_hx8357d.ko.

After rebooting my picore, I get this:
Code: [Select]
tc@box:~$ sudo modprobe fb_hx8357d
modprobe: can't load module fb_hx8357d (kernel/drivers/video/fb_hx8357d.ko): invalid module format

Strange... I verified again that my OS matches with the downloaded resources (and it did) and the date 31 Aug, is also the same.

Am I on the right track at all here?  :o
Should I try with some other versions of picore or other download link for fb_hx8357d?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: Issues with Adafruit PiTFT display on picore 15
« Reply #10 on: October 19, 2024, 12:27:41 PM »
Hi segfault
Try:
Code: [Select]
tce-load -wi graphics-KERNEL
It includes:
Code: [Select]
/usr/local/lib/modules/6.6.47-piCore-v7/kernel/drivers/staging/fbtft/fb_hx8357d.ko
« Last Edit: October 19, 2024, 12:29:35 PM by Rich »

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1267
Re: Issues with Adafruit PiTFT display on picore 15
« Reply #11 on: October 19, 2024, 12:40:06 PM »
Why go through all of that.  The extension on the repo graphics-KERNEL.tcz has the driver in it already.

Code: [Select]
graphics-6.6.47-piCore-v7/usr/local/lib/modules/6.6.47-piCore-v7/kernel/drivers/staging/fbtft/fb_hx8357d.ko

Also, modules are not loaded in that fashion anymore.  You need to find the correct overlay and put it in config.txt
Check out the overlay pitft35-resistive

https://github.com/raspberrypi/linux/blob/rpi-6.6.y/arch/arm/boot/dts/overlays/README




Offline segfault

  • Newbie
  • *
  • Posts: 27
Re: Issues with Adafruit PiTFT display on picore 15
« Reply #12 on: October 19, 2024, 02:13:10 PM »
Hooooooooraaaaaay!!!!!!  ;D :tears of joy: ;D ;D
Now it works, I got the console showing in the adafruit display!
Thanks a LOT for the help.

This is what I did:
Code: [Select]
tce-load -wi graphics-KERNEL
mount /dev/mmcblk0p1
echo "dtparam=spi=on
dtparam=i2c1=on
dtparam=i2c_arm=on
dtoverlay=pitft35-resistive,rotate=90,speed=20000000,fps=20,drm" >> /mnt/mmcblk0p1/config.txt
printf " fbcon=map:10" >> /mnt/mmcblk0p1/cmdline.txt
sudo reboot

Cheers everyone!

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 722
Re: Issues with Adafruit PiTFT display on picore 15
« Reply #13 on: October 19, 2024, 03:16:32 PM »
If you need more RAM and faster boot time, now you could do lsmod and list all modules being loaded.
And make a TCZ package of those files.

Think I have some very old threads talking about that...let me search a bit....

Here you are:
https://forum.tinycorelinux.net/index.php/topic,18858.msg129216.html#msg129216
https://forum.tinycorelinux.net/index.php/topic,20195.msg129372.html#msg129372

And you can also read lots of things in the wiki(lets promote that):
https://wiki.tinycorelinux.net/doku.php?id=wiki:creating_extensions
« Last Edit: October 19, 2024, 03:33:28 PM by patrikg »

Offline segfault

  • Newbie
  • *
  • Posts: 27
Re: Issues with Adafruit PiTFT display on picore 15
« Reply #14 on: October 20, 2024, 01:46:53 AM »
If you need more RAM...

Wow, yes this is an excellent idea! I'm going to look into it and thanks for the links!  8)