WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Touch support for official Raspberry Pi touchscreen  (Read 4776 times)

Offline Zlika

  • Newbie
  • *
  • Posts: 29
Touch support for official Raspberry Pi touchscreen
« on: January 17, 2017, 10:16:17 AM »
Hi all,

I have an official Raspberry Pi touchscreen. The screen works correctly on piCore 8.1.3 + TC.tcz but the touch function is not.
I browsed the forum for help and find some topics related to touchscreen support but the answers seem to be unclear and/or outdated.
Could someone help me get my touchscreen fully working?

Thanks

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Download a copy and keep it handy: Core book ;)

Offline Zlika

  • Newbie
  • *
  • Posts: 29
Re: Touch support for official Raspberry Pi touchscreen
« Reply #2 on: January 18, 2017, 08:19:59 AM »
Thank you for your hint.

Enabling the touch screen is in fact very simple:
* Copy the rpi_ft5406.ko driver from http://tinycorelinux.net/8.x/armv7/releases/RPi/src/kernel/4.4.39-piCore_v7%2B_modules.tar.xz (armv7 works for both RPi 2 and 3) on the µSD card
* Boot piCore and cd to the folder containing the ko file
* Type "sudo insmod ./ft5406.ko"
* Shazaam! The touchscreen is working!

Now I have to figure out what is the clean way to install a driver file in piCore: any advice on that?

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Touch support for official Raspberry Pi touchscreen
« Reply #3 on: January 18, 2017, 09:48:43 AM »
You could either create an extension
http://wiki.tinycorelinux.net/wiki:creating_extensions
(for an example on directory structure, check other extensions containing the kernel name in the file name. e.g. alsa-modules-4.4.39-picore_v7+.tcz)

Or remaster the initrd
http://wiki.tinycorelinux.net/wiki:remastering
Download a copy and keep it handy: Core book ;)

Offline Zlika

  • Newbie
  • *
  • Posts: 29
Re: Touch support for official Raspberry Pi touchscreen
« Reply #4 on: January 20, 2017, 09:30:28 AM »
I created an extension and proposed it for inclusion in the piCore repository.

I also tried to remaster the initrd but without success.
The following procedure does not even work:
* copy 8.1.3v7.gz on my HDD and extract it
* execute the following commands to re-pack it:
Code: [Select]
sudo find | sudo cpio -o -H newc | gzip -2 > ../8.1.3v7.gz
advdef -z4 ../8.1.3v7.gz
* copy back the regenerated 8.1.3v7.gz file to the microSD card

There is then an error during the boot.
Is there a documentation on remastering piCore? I only found documentation on remastering TinyCore, and piCore is a little bit different on this point.

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Touch support for official Raspberry Pi touchscreen
« Reply #5 on: January 20, 2017, 11:33:40 AM »
Try without  advdef . Works here.
Download a copy and keep it handy: Core book ;)

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 709
Re: Touch support for official Raspberry Pi touchscreen
« Reply #6 on: January 20, 2017, 01:06:12 PM »
I learn to do it this way, and think it's little "simpler", "clean way to install" :)
Just when the tce-load command remove the w if you get this error message.
tce-load -wil squashfs-tools.tcz
squashfs-tools is already downloaded.


Code: (bash) [Select]
cd
wget http://tinycorelinux.net/8.x/armv6/releases/RPi/src/kernel/4.4.39-piCore%2B_modules.tar.xz -O - | tar -xvJf -
mkdir -p /tmp/package/usr/local/lib/modules/4.4.39-piCore\+/kernel/drivers/input/touchscreen/
cp /home/tc/modules/4.4.39-piCore\+/kernel/drivers/input/touchscreen/rpi-ft5406.ko $_
tce-load -wil squashfs-tools.tcz
mksquashfs package /etc/sysconfig/tcedir/optional/rpi_touchscreen.tcz
echo rpi_touchscreen.tcz >> /etc/sysconfig/tcedir/onboot.lst
sync
sudo reboot
« Last Edit: January 20, 2017, 01:13:30 PM by patrikg »