WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: waveshare 3.5 touchscreen how to get working in picore  (Read 25537 times)

Offline madmax6

  • Newbie
  • *
  • Posts: 25
waveshare 3.5 touchscreen how to get working in picore
« on: March 12, 2016, 08:51:10 AM »
jivelite lcd touchscreen
waveshare 3.5 touchscreen
i've been trying ages to get this screen to work with picoreplayer without succes, can anyone help...

this is what i ve tried:

sudo mkdir -p/etc/X11/xorg.conf.d
sudo cp ./waveshare35a-overlay.dtb /overlays/
sudo cp -rf ./etc/X11/xorg.conf.d/99-calibration.conf-35 /etc/X11/xorg.conf.d/99-calibration.conf
sudo cp -rf ./usr/share/X11/xorg.conf.d/99-fbturbo.conf /usr/share/X11/xorg.conf.d/
sudo cp ./cmdline.txt /
sudo cp ./inittab /etc/
sudo cp ./boot/config-35.txt /boot/config.txt
filetool.sh -b

screen stays white.
tried it with raspbian and all is working

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 729
Re: waveshare 3.5 touchscreen how to get working in picore
« Reply #1 on: March 12, 2016, 08:57:52 AM »
What kernel module is loaded in raspbian to support the display.
lsmod
You may need to load that in picore.

Offline madmax6

  • Newbie
  • *
  • Posts: 25
Re: waveshare 3.5 touchscreen how to get working in picore
« Reply #2 on: March 12, 2016, 10:22:31 AM »
i don't know what kernel module is loaded, this is the site of the manufacture:
http://www.waveshare.com/wiki/3.5inch_RPi_LCD_(A)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11789
Re: waveshare 3.5 touchscreen how to get working in picore
« Reply #3 on: March 12, 2016, 10:37:18 AM »
Hi madmax6
Quote
filetool.sh -b
Did you update your  filetool.lst  file first? Were the files you copied restored after you rebooted?

Quote
sudo cp ./inittab /etc/
I don't think you can use a modified  /etc/inittab  using the backup/restore mechanism. I'm pretty sure that by the time
the  inittab  is restored, the original one from the initrd has already been run.

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: waveshare 3.5 touchscreen how to get working in picore
« Reply #4 on: March 12, 2016, 10:56:00 AM »
Look this thread, I've wrote there everything how to bring the screen working:
http://forum.tinycorelinux.net/index.php/topic,18652.0.html

The first what you need are kernel modules, something like tft.tcz. Than you need modify cmdline.txt. You need to modify it manually, don't use that one from Rasbian. The same with the config.txt.
You don't need inittab, forget it.

Offline madmax6

  • Newbie
  • *
  • Posts: 25
Re: waveshare 3.5 touchscreen how to get working in picore
« Reply #5 on: March 12, 2016, 10:58:46 AM »
yes i did, started with:

sudo mkdir -p /etc/X11/xorg.conf.d

sudo echo "etc/X11/xorg.conf.d" >> /opt/.filetool.lst

and so on,
saved my files filetool.sh -b and reboot.

i'm sure all the files are in the right places, i think it has something to do with the config file during boot.
hdmi is loaded and i can see on my hdmi screen but nothing on the 3.5 lcd screen.

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: waveshare 3.5 touchscreen how to get working in picore
« Reply #6 on: March 12, 2016, 01:17:59 PM »
You need the kernel modules first. In Rasbian all the modules are load by default. In TC you need to load the modules which you really need.
Use, or create and than load the tft.tcz like this: http://forum.tinycorelinux.net/index.php/topic,18652.msg119628.html#msg119628
Than it may work, or continue with this: http://forum.tinycorelinux.net/index.php/topic,18652.msg120902.html#msg120902

Offline madmax6

  • Newbie
  • *
  • Posts: 25
Re: waveshare 3.5 touchscreen how to get working in picore
« Reply #7 on: March 13, 2016, 10:05:56 AM »
thnx for the info, but i can not get the screen to work.
i use picoreplayer 2.02 and it usese version 4.13 picore, added modules and added fbcon=map:10 to commandline but screens still white.
i m doing something wrong but can't find it.
can someone please give me a tutorial from scratch how to get touchscreen working?

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: waveshare 3.5 touchscreen how to get working in picore
« Reply #8 on: March 14, 2016, 07:13:05 AM »
OK than, step by step tutorial as follows:
1) If you're using Rpi1, than make the driver modules as described here:
http://forum.tinycorelinux.net/index.php/topic,18652.msg119628.html#msg119628
If you're using Rpi2, than download the tft.tcz from the link at the first line.
Place the tft.tcz into the /home/tc directory
2) Download the attached file and extract it into the /home/tc directory
3) run the Install script
4) backup
5) reboot

To set which display will be used for shell:
fbcon=map:10 is automatic
fbcon=map:0 is HDMI output only
fbcon=map:1 is tft output only

To set which display will be used for x window is set in the fbtft.conf file:
/dev/fb0 is for HDMI output
/dev/fb1 is for tftf output
« Last Edit: March 14, 2016, 07:29:22 AM by jgrulich »

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: waveshare 3.5 touchscreen how to get working in picore
« Reply #9 on: March 14, 2016, 06:25:38 PM »
I've tested in picoreplayer 2.02 and some clarification:
After SSH connection:
0) mount /mnt/mmcblk0p1
Steps 1) to 3)
4) sudo backup
5) sudo reboot

Offline madmax6

  • Newbie
  • *
  • Posts: 25
Re: waveshare 3.5 touchscreen how to get working in picore
« Reply #10 on: March 15, 2016, 03:32:49 AM »
thanks, i will give that a try when i have some time and i will get back to you.

Offline madmax6

  • Newbie
  • *
  • Posts: 25
Re: waveshare 3.5 touchscreen how to get working in picore
« Reply #11 on: March 15, 2016, 04:29:23 PM »
still no screen, did:

mount /mnt/mmcblk0p1
tft.tcz into the /home/tc directory
TFT.tar.gz  /home/tc directory
tar xvf TFT.tar.gx
cd /TFT
cp ./tft.tcz /mnt/mmcblk0p2/tce/optional
echo "tft.tcz" >> /mnt/mmcblk0p2/tce/onboot.lst
cp ./waveshare35a-overlay.dtb /mnt/mmcblk0p1/overlays/
echo "
dtoverlay=waveshare35a:fps=50" >> /mnt/mmcblk0p1/config.txt
echo " fbcon=map:10" >> /mnt/mmcblk0p1/cmdline.txt
mkdir -p /etc/X11
cp -R ./xorg.conf.d /etc/X11
echo etc/X11 >> /opt/.filetool.lst
sudo backup and sudo reboot

im working with rapberry pi model B
tried this but only get folder BIN with no tft.tcz file

2.   Download 4.1.13-piCore_v7+_modules.tar.xz from http://tinycorelinux.net/7.x/armv7/releases/RPi2/src/kernel/ and unpack it into tmp/core
3.   Rename the original tft.tcz to tft-orig.tcz and copy it to tmp/tft
4.   unsquash tft-orig.tft, this will give you a folder in tmp/tft called squashfs-root
5.   Copy all matching .ko entries from tmp/core to the same directory structure in tmp/tft/squashfs-root, deleting the matching .ko.gz entries - I used xfe for this
6.   In tmp/tft/squashfs-root, run 'find . -name *.ko | xargs gzip' to zip the .ko files to .ko.gz
7.   in tmp/tft squash squashfs-root to tft.tcz

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: waveshare 3.5 touchscreen how to get working in picore
« Reply #12 on: March 15, 2016, 06:08:21 PM »
I have the RPi B+ and it works. I've tested once again yesterday.

Try to use this tft.tcz to be sure that it's OK:
https://www.dropbox.com/s/h6bkba7qe32fihc/tft-4.1.13-piCore%2B.tcz?dl=0
Rename it to tft.tcz and place into the /mnt/mmcblk0p2/tce/optional directory.

After reboot first look into the /tmp/loop folder if there is tft.tcz to check it the tcz is extracted.
Than try to load the modules manually:

Code: (bash) [Select]
sudo modprobe flexfb  width=320  height=480  regwidth=16 init=-1,0xb0,0x0,-1,0x11,-2,250,-1,0x3A,0x55,-1,0xC2,0x44,-1,0xC5,0x00,0x00,0x00,0x00,-1,0xE0,0x0F,0x1F,0x1C,0x0C,0x0F,0x08,0x48,0x98,0x37,0x0A,0x13,0x04,0x11,0x0D,0x00,-1,0xE1,0x0F,0x32,0x2E,0x0B,0x0D,0x05,0x47,0x75,0x37,0x06,0x10,0x03,0x24,0x20,0x00,-1,0xE2,0x0F,0x32,0x2E,0x0B,0x0D,0x05,0x47,0x75,0x37,0x06,0x10,0x03,0x24,0x20,0x00,-1,0x36,0x28,-1,0x11,-1,0x29,-3

sudo modprobe fbtft_device name=flexfb rotate=90 speed=16000000 gpios=reset:25,dc:24 txbuflen=32768 fps=50

If everything seems to be ok, no errors and lsmod report the modules loaded and still white screen, than the TFT is probably not Waveshare, or WS compatible, or there is some other HW problem.

Offline madmax6

  • Newbie
  • *
  • Posts: 25
Re: waveshare 3.5 touchscreen how to get working in picore
« Reply #13 on: March 16, 2016, 02:37:08 PM »
Thanks  jgrulich,

that seems to work, now i have got a blackscreen with text.


how do we autostart this?

ihave create a fbtft.sh with your script and put it in mmcblk0p1 but screen is white
« Last Edit: March 16, 2016, 03:04:57 PM by madmax6 »

Offline madmax6

  • Newbie
  • *
  • Posts: 25
Re: waveshare 3.5 touchscreen how to get working in picore
« Reply #14 on: March 16, 2016, 03:11:23 PM »

how can we see jivelite?