Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: szymtro on July 23, 2015, 12:47:49 PM

Title: fbtft
Post by: szymtro on July 23, 2015, 12:47:49 PM
except this topic:
http://forum.tinycorelinux.net/index.php/topic,18358.msg112022.html#msg112022

There is nothing about running any other display on rpi+tinycore.

So this is my idea for ataching lcd(I am using something similar to itdb02-3.2, it has ssd1289 lcd chip and hardware is set to 16bit parallel).
I'm noob in linux world so excuse me for mistakes.

My hardware is rpi B+ and the lcd is wired this way:
reset:26,dc:2,wr:3,db00:18,db01:23,db02:24,db03:25,db04:12,db05:16,db06:20,db07:21,db08:4,db09:17,db10:27,db11:22,db12:5,db13:6,db14:13,db15:19

Standard kernel(3.12.36 or 3.18.10) that is included in 6.0 or 6.1 version of tc does not iinclude fbtft(actualy fbtft is included in staging directory in 3.18.10 but is not compiled).
So it means that we need to compile kernel and that is not easy for noob's.

So here is the compiled kernel and image for rootfs:
http://www.trocki.pl/szymon/tinycore/fbtft_3.12.36/
http://www.trocki.pl/szymon/tinycore/fbtft_3.18.10/

there are 2 important files: kernel_fbtft.img and rootfs_fbtft.img, both are uncopresed.
Copy them into fat partition of working mmc.
Then change config.txt to include this:
Code: [Select]
initramfs rootfs_fbtft.img followkernel
kernel=kernel_fbtft.img
and create fbtft.sh on that fat partition - this file is responsible for modprobe the propper fbtft_device, for example:
Code: [Select]
/sbin/modprobe fbtft_device name=sainsmart32 fps=16 rotate=90 width=320 height=240 gpios=reset:26,dc:2,wr:3,db00:18,db01:23,db02:24,db03:25,db04:12,db05:16,db06:20,db07:21,db08:4,db09:17,db10:27,db11:22,db12:5,db13:6,db14:13,db15:19after that You can simply reboot rpi or add this:
Code: [Select]
fbcon=map:10to commandline.txt to change conslole to fb1(our lcd)
and then simply reboot pi.
After few seconds display should change from white(default after power on) to black and immediatelly teher should be boot process visible(including booting 6.0...) everything in color.

But thats not all.
Some ouf Us might need X, so after installing TC.tcz please change last line of .profile file in /home/tc directory to this:
Code: [Select]
FRAMEBUFFER=/dev/FB1 startx
And thats all

Title: Re: fbtft
Post by: szymtro on July 27, 2015, 01:54:04 PM
3.18.10 for rpi 2:
http://www.trocki.pl/szymon/tinycore/fbtft_3.18.10_v7/

fbtft.sh for waveshare spotspear 4.0 (a):
Code: [Select]
/sbin/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
/sbin/modprobe fbtft_device debug=3 rotate=90 name=flexfb speed=16000000 gpios=reset:25,dc:24
Title: Re: fbtft
Post by: nowhinjing on October 03, 2015, 05:05:46 AM
Hi,

I am hoping you may be able to help me.

I have prepared an image using your revised kernel, modified as appropriate for my Waveshare Touchpear 3.5 inch screen. I know that these parameters are OK as the same screen is working well under Raspbian using the same parameters.

When I boot using the image I prepared, the lcd screen starts light, and then goes dark as you would expect. However the switch from HDMI to the LCD screen never happens.

Examination of the kernel log using dmseg gives:
Code: [Select]
[    2.367426] bcm2708_spi bcm2708_spi.0: master is unqueued, this is deprecated
[    2.375903] bcm2708_spi bcm2708_spi.0: SPI Controller at 0x3f204000 (irq 80)
[    2.380104] bcm2708_i2c_init_pinmode(1,2)
[    2.380132] bcm2708_i2c_init_pinmode(1,3)
[    2.382968] bcm2708_i2c bcm2708_i2c.1: BSC1 Controller at 0x3f804000 (irq 79) (baudrate 100000)
[    2.418146] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[    2.418182] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    2.421596] smsc95xx v1.0.4
[    2.439236] zram0: detected capacity change from 0 to 235405312
[    2.449146] random: mkswap urandom read with 59 bits of entropy available
[    2.457088] Adding 229884k swap on /dev/zram0.  Priority:-1 extents:1 across:229884k SSFS
[    2.483369] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-bcm2708_usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:f0:2a:aa
[    2.574284] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
[    2.576331] flexfb: module is from the staging directory, the quality is unknown, you have been warned.
[    2.586498] fbtft_device: module is from the staging directory, the quality is unknown, you have been warned.
[    2.587981] fbtft_device:  SPI devices registered:
[    2.588009] fbtft_device:      spidev spi0.0 500kHz 8 bits mode=0x00
[    2.588027] fbtft_device:      spidev spi0.1 500kHz 8 bits mode=0x00
[    2.588039] fbtft_device:  'fb' Platform devices registered:
[    2.588062] fbtft_device:      bcm2708_fb id=-1 pdata? no
[    2.588127] fbtft_device: Deleting spi0.0
[    3.003533] random: nonblocking pool is initialized
[    3.234211] graphics fb1: flexfb frame buffer, 480x320, 300 KiB video memory, 4 KiB DMA buffer memory, fps=20, spi0.0 at 16 MHz
[    3.234259] fbtft_device:  GPIOS used by 'flexfb':
[    3.234273] fbtft_device:    'reset' = GPIO25
[    3.234284] fbtft_device:    'dc' = GPIO24
[    3.234295] fbtft_device:  SPI devices registered:
[    3.234313] fbtft_device:      spidev spi0.1 500kHz 8 bits mode=0x00
[    3.234328] fbtft_device:      flexfb spi0.0 16000kHz 8 bits mode=0x00
[    3.696730] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    3.903751] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    8.710228] i2c /dev entries driver
[    8.740286] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[   10.392140] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
tc@box:/$
which would suggest that the correct modules are being loaded.

However modprobe fbcon gives module not found ...

Any suggestions would be most welcome - it is driving me potty !

The image I am using can be downloaded here www.pughx2.com/assets/px2/files/fbtft-img.img (http://www.pughx2.com/assets/px2/files/fbtft-img.img)

Help !

NWJ
Title: Re: fbtft
Post by: nowhinjing on October 03, 2015, 05:44:35 AM
... sorry, the image download link should be http:wwwpughx2.com/assets/px2/files/fbtft-img.zip

extension zip not img
Title: Re: fbtft
Post by: szymtro on October 05, 2015, 02:55:07 PM
Have You added this:
Code: [Select]
fbcon=map:10in to the commandline.txt?
Title: Re: fbtft
Post by: nowhinjing on October 06, 2015, 01:19:27 AM
Yes, followed your instructions to the letter.

Also tried fbcon=map:1, fbcon=map:0, fbcon=map:01, - all same result.

Thanks for your time.
Title: Re: fbtft
Post by: jgrulich on October 06, 2015, 06:05:14 AM
You need to load the kernel drivers first.

Use these simple script:

Code: (bash) [Select]
echo "dtparam=i2c=on,spi=on
dtoverlay=ads7846,speed=1000000,penirq=17,penirq_pull=2,swapxy=1,xmin=200,xmax=3900,ymin=200,ymax=3900,pmax=255,xohms=60" >> /mnt/mmcblk0p1/config.txt
echo "fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo" >> /mnt/mmcblk0p1/command.txt
echo "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
modprobe fbtft_device debug=3 rotate=90 name=flexfb speed=16000000 gpios=reset:25,dc:24" >> /opt/bootlocal.sh

Backup, reboot and you'll get the shell on the TFT just after the kernel driver is loaded.
Title: Re: fbtft
Post by: nowhinjing on October 06, 2015, 09:08:45 AM
thanks, will try this tomorrow...
Title: Re: fbtft
Post by: jgrulich on October 06, 2015, 09:41:39 AM
Kernel Touch-TFT modules for piCore-7.0alpha6 may be found here:
http://grulich.eu/files/tft.tcz
Title: Re: fbtft
Post by: nowhinjing on October 07, 2015, 06:44:59 AM
I'm confused.

I made the changes as outlined by jgrulich, no difference exactly the same result - screen starts light, goes dark but the console remains on HDMI and does not switch to the LCD screen.

Now this is where it gets interesting. I downloaded PiCore-7.0alpha6, downloaded tft.tcz, put it in tce/optional, made all the mods as suggested and rebooted.

Guess what, exactly the same. dmesg shows that the drivers are being loaded but the console never swaps from HDMI to LCD.

What can I try now ?

Any help would be much appreciated.

Best Regards to all.
Title: Re: fbtft
Post by: jgrulich on October 07, 2015, 08:04:25 AM
When the TFT goes dark during startup, than it means it's initiated correctly. The only issue is to switch the output.
Try to use:
Code: (bash) [Select]
echo "00000000000000000000000000000000001111111111111111111111111112222222222222222222222222233333333333333333333333333344444444444444444444455555555555555555555566666666666666666666777777777777777777788888888888888888899999999999999999999999" > /dev/fb1
It displays color line at the left top of the TFT.
If it reports some error, than feedback.
Title: Re: fbtft
Post by: jgrulich on October 07, 2015, 08:32:51 AM
Share the output of this:
Code: (bash) [Select]
dmesg | grep fb1
Title: Re: fbtft
Post by: szymtro on October 07, 2015, 03:04:37 PM
jgrulich, he already shared:
Code: [Select]
[    3.234211] graphics fb1: flexfb frame buffer, 480x320, 300 KiB video memory, 4 KiB DMA buffer memory, fps=20, spi0.0 at 16 MHz
But this screen uses faked spi - on the board there are logic ic(counters and registers) that emulate spi interface.
It might happen that someting is to fast - but then it shouldn't get to the "turn screen black"
Title: Re: fbtft
Post by: nowhinjing on October 08, 2015, 05:51:45 AM
First of all my sincere thanks to jgrulich and szymtro for taking the time to help me with this, your efforts are really appreciated, guys.

We may be getting somewhere, executing the echo command as suggested by jgrulich does indeed give a 1 px coloured line on the top left of the LCD screen. There is no error message generated.

Next step ?

Best regards to all.
Title: Re: fbtft
Post by: jgrulich on October 08, 2015, 06:05:09 AM
Great, it means that the driver fb1 is working correctly.
Check if the cmdline.txt is like this:
Code: (bash) [Select]
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/ram0 elevator=deadline rootwait quiet nortc loglevel=3 tz=CET-2 noembed fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo
Guess that there is missing space in front of first fbcon.
Title: Re: fbtft
Post by: nowhinjing on October 08, 2015, 06:43:19 AM
@jgrilich

Your diagnosis was completely right.

Inserted the missing space and now it is working as expected.

Thank-you so much for your time and patience with a stupid newbie.

Best regards to all.
Title: Re: fbtft
Post by: Michielo on November 13, 2015, 02:36:32 PM
Hi all,

First of all, let me thank szymtro for compiling and sharing the kernel images for picore.

Now, I am totally new to using and configuring a touchscreen on the rpi, so apologies for my noobish question.

I recently bought a Waveshare 3.5 (a) touchscreen which I would like to use with Picore. So I downloaded and burned the Picore 6.1 image to a SD card and after burning opened the fat partition in windows explorer. I also downloaded the 2 *.img files and the *.sh file as suggested by szymtro. Based on nowhinjing's feedback, I should be able to get this screen working using the guidelines provided in this topic.

However, when I want to copy these 3 files to the FAT partition of my SD card, I get an error that I do not have enough free space on the SD Card (I need around 11 mb, but there is only about 4 mb left).

Any help on solving this would be highly appreciated.

Thanks,

Michielo
Title: Re: fbtft
Post by: Greg Erskine on November 13, 2015, 03:33:13 PM
hi Michielo,

Unless you are comfortable with deleting and creating partitions, it might be better to copy to the second partition.

Use the piCore-x.0-SSH.zip or piCore-6.0-X.zip so you can use ssh/scp to transfer the files from your PC to your RPi. I use winSCP.

If you need to increase of the second partition following the instructions in README on the boot partition or download area.

If you proceed putting the files on the FAT partition remember it is not mounted after booting.

regards
Greg
Title: Re: fbtft
Post by: Michielo on November 14, 2015, 12:16:00 AM
Hi Greg,

Thanks for your response. I fancy a challenge once in a while so I don't mind extending the partition. If I put the files on mmcblk0p2, would I need to change anything in config.txt or cmdline.txt considering both txt files are on partition 1 with the kernel images being on partition 2.

Thx
Title: Re: fbtft
Post by: jgrulich on November 14, 2015, 04:34:47 AM
Hi Michielo,
it's better to use the last TC7 distro which has kernel files already updated for TFT and overlay.
Everything what you than need is attached.
Title: Re: fbtft
Post by: Michielo on November 14, 2015, 07:28:33 AM
Thanks for your response, jgrulich. I assume installation instructions are the same as those on the Waveshare wiki

i.e.:
(1) download and burn latest Picore 7 alpha release to SD
(2) extract your zip file and copy the waveshare35a folder to partition 1 on SD
(3) put SD in Rpi and boot Rpi
(4) mount partition 1 and go to waveshare35a folder on the SD
(5) execute sudo ./LCD35-show

Can I also use the wiki guidelines for screen calibration under Picore?

Thanks,

Michielo
Title: Re: fbtft
Post by: Michielo on November 21, 2015, 05:45:32 AM
Tried a couple of different approaches, but none seem to result in a working screen. I tried
(1) just executing sudo ./LCD35-show while in the folder on partition 1, but that gives me an error on mkdir /etc/X11/xorg.conf.d
(2) doing same as (1) but while in partition 2 which resulted in the same dir error
(3) amending ./LCD35-show so the commands have absolute file/dir references in stead of relative references. For example /mnt/mmcblk0p1/LCD-show/LCD-show35 in stead of ./LCD-show35 and repeated (1) resulting in same dir error and (2) still the same dir error.
(4) manually executed steps in ./LCD35-show while in the appropriate directory on my SD. I managed to copy all the files. Before rebooting I added the appropriate files/directories to /.filetool.lst and saved everything using filetool.sh -b. Rebooted my Rpi, but than it hangs on boot. It runs through part of the boot process and than just hangs. Can't remember exactly at what point during boot or the msg it displays.

Can anyone tell me what I am doing wrong. I know the screen works because I managed to get it working under Raspbian using the image file provided by Waveshare.

Thanks for your help.

Kind regards,

Michielo
Title: Re: fbtft
Post by: szymtro on November 28, 2015, 02:19:35 AM
If you would like to use tc 6.1 You can do it alternatively.
Inserd sd and open Your favorite disk manager. Create fat partition with size lat's say 256MB and set boot flag.
Then eject and reinsert it again. Copy all files from unziped tc6.1 original image. Then copy my files over it and make necessary changes in config.txt and commandline.txt and it should work.

If You will use tc 7 a fbtft is already built in in staging directory.
To be sure run modprobe fbtft and analyse if dmesg shows that fbtft is at least doing something.

If all is allright try:
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 debug=3 rotate=90 name=flexfb speed=16000000 gpios=reset:25,dc:24
Title: Re: fbtft
Post by: nowhinjing on December 24, 2015, 06:56:39 AM
Hi,

can anyone please tell me how to get the fbtft drivers loaded in piCore7rc1 ?

I have tried loading the appropriate dtoverlay, which I though might load the drivers, but modprobe fbtft returns not found and there is no mention of fbtft in dmesg.

HELP !

With thanks in advance ...
Title: Re: fbtft
Post by: jgrulich on December 26, 2015, 08:09:49 AM
Install the kernel modules, look for tft, or similar.
Title: Re: fbtft
Post by: nowhinjing on December 27, 2015, 04:53:40 AM
thank-you for your reply.

I have searched this forum, and Googled for information on how to recompile the kernel to include modules from the staging directory, but can not find anything that my simple mind can follow.

If anyone knows of such, a link would be much appreciated.

with thanks in advance ...
Title: Re: fbtft
Post by: jgrulich on December 27, 2015, 08:45:15 AM
You don't need to do anything of this, simply download the kernel modules here:
http://tinycorelinux.net/7.x/armv6/releases/RPi/src/kernel/
and update the tft.tcz package with this in case if there is some difference, otherwise only rename the kernel folder in the tcz and remake it with the new folder name to load it to the right directory.
Title: Re: fbtft
Post by: nowhinjing on December 28, 2015, 12:16:22 AM
@jgrulich - thanks for your reply, I will give it a go and report back.

Title: Re: fbtft
Post by: nowhinjing on January 02, 2016, 06:10:23 AM
@jgrulich - thanks for the pointers - I think I understand it now, having managed to produce an updated version of your tft.tcz posted above.

A steep learning curve, but worth it in the end.

All the best for the new year to all readers ...
Title: Re: fbtft
Post by: jgrulich on January 02, 2016, 11:31:52 AM
@nowhinjing - please share the link for the updated version of the tft.tcz, or send it to Béla to add it to the repo to be available for others.

Have you used standard setup, or used some extra steps? Please share.

All the best for NY 2016 !!!
Title: Re: fbtft
Post by: nowhinjing on January 03, 2016, 02:40:46 AM
Hi, all,

I am quite happy to share my version on tft.tcz, which you can get from here http://www.pughx2.com/assets/px2/files/tft.tcz (http://www.pughx2.com/assets/px2/files/tft.tcz). It uses modules from the 4.1.13 kernel and should thus work for piCore7rc1 and rc2.

Since I used a 'quick qnd dirty' method to produce it, I will not be sending it to Bella. If I get time I might tidy it up into a state where it can be submitted, assuming that any one else is interested.

This is what I did.

1.   Create a working environment by installing the latest linux version into a virtual environment under windows.
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

et voila ! Job done.
Title: Re: fbtft
Post by: jgrulich on January 04, 2016, 09:37:24 AM
Hi Béla,

Hence the tft displays are used more and more often, I'd like to kindly ask you to make the tft.tcz, or similar name, kernel package for the TFT touch displays as a regular part of the repo which will be updated with each kernel update.
Title: Re: fbtft
Post by: bmarkus on January 04, 2016, 10:17:11 AM
Hi Béla,

Hence the tft displays are used more and more often, I'd like to kindly ask you to make the tft.tcz, or similar name, kernel package for the TFT touch displays as a regular part of the repo which will be updated with each kernel update.

Which kernel modules required?
Title: Re: fbtft
Post by: jgrulich on January 05, 2016, 11:39:13 AM
I've used driver files related to the fbtft and the touch input drivers. Hope my original http://grulich.eu/files/tft.tcz will help.
Title: Re: fbtft
Post by: pc1246 on January 26, 2016, 12:10:56 PM
Hello @ all
I am new here! I finally do not get the point where I get my tft to show something! It is not the same you guys are using, but this is not my problem! All the settings in config and cmdline do not take any effect! And i think it is a problem with the tft not loading in kernel!?
Could someone give me a hint please! I am using 4.1.13 on a B Pi!
Thanks in advance
Christoph
Title: Re: fbtft
Post by: jgrulich on January 27, 2016, 07:24:18 AM
Hi pc1246,

the tft.tcz are only the kernel modules, but they need to be somehow loaded. What overlay are you using?
May be that the attached file may help.
Title: Re: fbtft
Post by: jordache on October 09, 2016, 10:39:47 PM
hello,
i'm sorry to dig up an old topic, but i've come SO close to getting my 3.5 tft touchscreen working in picoreplayer and yet i'm coming up short.  i think my main issue is that i cannot seem to find a working link to a tft.tcz file anywhere.  everything that i've read (i have spent days, so please don't say i haven't read x thread) has suggested that i need to load tft.tcz.  at the moment, i've installed the waveshare drivers on my picoreplayer install and enabled the jivelite settings.  i'm using a pi zero, so the best i've been able to install is picoreplayer 2.06.  the 3 version doesn't seem to work.  if anyone has any insight it would be much appreciated.  so far i have picoreplayer 2.06 working just fine, the 3.5 display i have outputs just a white screen with a black border around it....so i think i'm close but not QUITE there.

i have literally tried every single possible solution available on the web, but nothing has quite worked for my setup....and unfortunately all of the links that have been referenced are now dead.  any help would be very much appreciated.  thank you!
Title: Re: fbtft
Post by: nowhinjing on October 10, 2016, 04:16:12 AM
@jordache

The original version of tft.tcz, can still be got from here http://www.pughx2.com/assets/px2/files/tft.tcz; there is also a modified later version ... tft1.tcz, both use modules from the 4.1.13 kernel and should thus work for piCore7rc1 and rc2.

good luck !
Title: Re: fbtft
Post by: jordache on October 10, 2016, 01:37:34 PM
@nowhinjing

thanks so much!  the link you've provided downloads properly....i'm completely stumped as to why i wasn't able to download before....

anyways, will give it another shot now that i (hopefully) have the right tools.  thank you
Title: Re: fbtft
Post by: jordache on October 10, 2016, 08:42:21 PM
hey @nowhinjing, if you have a moment perhaps you can give me a little bit more of a nudge in the right direction.

i've tried both of the tcz files you mentioned (thanks again!) but i'm still having problems.

i've run the install script included in the TFT archive that @jgrulich had provided (either in this thread or a similar one), which basically seems to copy over the waveshare 35 overlay, add the stuff to config and cmdline, and create the x11 as well as a filetool.lst file (which appears empty??).

so i basically am not any closer than i was before.  one thing i noticed though (trying something from another thread) was that lsmod shows that flexb is not running.  im on a pi0 with picoreplayer 2.06, so it's loading the 4.1.20 picore i believe.  do you have any insight into what is happening?  i'm still trying to wrap my head around how this whole thing works!

thanks
Title: Re: fbtft
Post by: jgrulich on October 11, 2016, 06:40:13 AM
Guess that the issue will be in the wrong kernel modules. Below mentioned link is for 4.1.13 kernel and you mentioned that you need 4.1.20 ones. Than use the 7-steps tutorial, mentioned earlier, to rebuild them for the actual kernel needed.

BTW, the .filetool.lst is not empty, may be that you've not run the setup script with the sudo to be a root.

Regards,

Jan

Title: Re: fbtft
Post by: jordache on October 11, 2016, 01:37:00 PM
hey jan, thanks a lot for the tips.

i have rebuilt the tft.tcz as per your instructions using the 4.1.20 kernel

i have run your setup script as root and verified that all additions have been made, also filelist is updated properly

i've backed up to make sure that everything is saved

when i reboot i still get a white screen.  i can't find tft.tcz in the /tmp/tcloop folder (you mentioned before the /tmp/loop folder which doesn't seem to exist).  also when i try to call the module manually with modprobe it says that flexfb does not exist.

it think i am very close, any other thoughts?

thanks,
jamie
Title: Re: fbtft
Post by: Greg Erskine on October 11, 2016, 02:25:53 PM
Do you need to add tft.tcz to /mnt/mmcblk0p2/tce/onboot.lst ?
Title: Re: fbtft
Post by: jordache on October 11, 2016, 03:07:51 PM
hey greg,
yup, tft.tcz is in onboot.lst

i erased the SD card and tried everything from scratch again.  tft is now loading in the "tcloop" folder, but the LCD screen is still just white.  also when i look at lsmod, flexfb is not showing up and when i try to modprobe it says that it is not found in modules.

what am i missing?

is the fact that i'm starting with the picoreplayer image a problem?  in other words, is it too "stripped-down" a version of tinycore?

thanks,
jamie
Title: Re: fbtft
Post by: Greg Erskine on October 11, 2016, 04:12:26 PM
piCorePlayer uses piCore with a few different extensions. So piCorePlayer is not using a stripped down version of piCore.

I did not do any of the work on getting the "official" screen working on piCorePlayer so I am not much help. :(

We decided to only support the "official" screen because there are so many different screens available and we wanted the screen to also be compatible with jivelite resolutions. We released that the Raspberry Pi Foundation's offering would instantly be the most popular and best supported. I can understand the need for a smaller, cheaper solution but at the moment we don't have any plans.

regards
Greg
Title: Re: fbtft
Post by: nowhinjing on October 12, 2016, 12:45:24 AM
Sorry folks, I am in the process of moving house and can not add much to this discussion for the next couple of weeks.

I still outstanding when I get my act back together, I'll take a look.
Title: Re: fbtft
Post by: jgrulich on October 12, 2016, 12:30:30 PM
Are you using the right version of the modules, means -piCore_v7+ for the arm7 (RPi2 and RPi3) and -piCore+ for the arm6?
If so, look in the /lib and search the TFT related modules from your tft.tcz. They need to be in the regular modules folder and listed in the modules.dep.
Title: Re: fbtft
Post by: jordache on October 12, 2016, 10:56:39 PM
hey nnowhinjing, no worries...thanks for taking any time at all!  good luck with the move, perhaps i'll hit you up again once you're settled :)

jgrulich, yeah i'm definitely using the -piCore+ versions (for pi zero).  i've been doing a LOT of research, seems like i might have to load additional modules.  i'm not really sure.  honestly, i have been reading/studying for hours each day and it's still a lot to learn!  i've tried most of the things that have been posted (including all of your helpful posts) and yet it still doesn't seem to be working.  i'm kind of at a loss, not sure where to go from here.  also, the tft folder is showing up in the list of modules (?) so it seems like that is being loaded.  the problem is that "flexfb" is nowhere to be found still.  where would i find that, and how would i call that as a command line option? ("sudo modprobe flexfb")

@greg, thanks for taking the time to consider this one!  i understand you weren't on the coding or the "official" screen stuff....but you understand everything a LOT more than me, so perhaps you can help if what i need becomes clearer.  basically the problem seems to be that most stuff is loading ok, but i'm still looking for the "flexfb" module.  as far as i know, most of the stuff is the same as the "official" screen, just different driver settings.

@greg, one thing you might be able to answer for me though:  i can install 2.06 on my pi zero no problem using the "newconfig" with my wifi settings.  on first boot, it connects to network, all is good!  however, when i try to install 3.02 on my pi zero using the *same* "newconfig" file, it just won't connect.  my network sees the MAC address, but there is no IP given.  so i can't SSH to it, and i can't connect via web.  do you have any idea why this might be happening?  i'm using the EXACT same steps, just the 3.02 img instead of the 2.06 img.  very stumped

thank you all for your help, this is very encouraging :)
Title: Re: fbtft
Post by: Greg Erskine on October 13, 2016, 02:47:29 AM
@greg, one thing you might be able to answer for me though:  i can install 2.06 on my pi zero no problem using the "newconfig" with my wifi settings.  on first boot, it connects to network, all is good!  however, when i try to install 3.02 on my pi zero using the *same* "newconfig" file, it just won't connect.  my network sees the MAC address, but there is no IP given.  so i can't SSH to it, and i can't connect via web.  do you have any idea why this might be happening?  i'm using the EXACT same steps, just the 3.02 img instead of the 2.06 img.  very stumped

hi jordache,

I have problems with one of my wifi adaptors since pCP3.00. Unfortunately, they upgrade their drivers and sometimes they are worst than the older ones. I had to change wifi adaptors. Maybe the same issue? This is the one I have problems with:

Bus 001 Device 004: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter

I got it going doing the following, but it still didn't work 100%.

Code: [Select]
Changed /etc/sysconfig/wifi-wpadrv from: "wext" to "nl80211,wext"
Added etc/sysconfig/wifi-wpadrv to .filetool.lst
#pcp bu

regards
Greg
Title: Re: fbtft
Post by: jordache on October 13, 2016, 05:39:36 PM
hi greg, ah that's a very smart idea - that's probably what the problem is.  i'll try it later.

in the meantime, i have some insight into what might be happening with the modules not loading properly.  when i "ls -l" in the /tmp/tcloop folder, all of the permissions are:

drwxr-xr-x    3 root     root

EXCEPT for the "tft" folder, which shows up as:

drwxrwx---    3 root     999

could this be the problem?  if so, how do i fix it?  i'm trying to chmod, but it's obviously read-only at this point, so i'm not sure where to start.

(sorry if this is a very simple question - i'm still learning!)

thanks,
jamie
Title: Re: fbtft
Post by: Greg Erskine on October 13, 2016, 06:42:03 PM
I think this is an issue for the extension maintainer to fix.
Title: Re: fbtft
Post by: jordache on October 18, 2016, 02:33:13 AM
wow, so after more days of research and trial-and-error i finally got the screen working!  i rebuilt the tft.tcz module and changed permissions and now i have a full output on the screen!  this is incredible, the most progress i've had in weeks (and i've literally tried EVERYTHING else).  the only remaining problem is that now my screen ends with "starting jivelite...done" but doesn't load a skin.  i'm using the standard picoreplayer 2.06 installation, does anyone have any idea how to finish the final step???

(ps, hopefully in the future tft.tcz can be added to the repo.....would've saved me days of research)
Title: Re: fbtft
Post by: Dirk_H on October 19, 2016, 04:00:27 AM
Hello at the moment I'm also trying to get PiCore running with a 3.5 LCD-TFT.
I hope I got pretty far, as the screen turned black after modprobing flexfb and fbtft_device (of cuase wit parameters).

can you give me some hints how / where to configure the output to go to it? and also where to enter the modprobe commands in order to be run at every startup? I got this working on raspbian, however picore has very different locations...

thanks in advance so much.
Title: Re: fbtft
Post by: jgrulich on October 19, 2016, 05:18:36 AM
The default TFT output is fb1, therefor you've to redirect it, or copy from fb0 to fb1.
For Jivelite, use this:
Code: (bash) [Select]
sudo SDL_VIDEODRIVER=fbcon SDL_FBDEV=/dev/fb1 SDL_MOUSEDEV=/dev/input/touchscreen SDL_MOUSEDRV=TSLIB /home/pi/jivelite/bin/jivelite &
Title: Re: fbtft
Post by: Dirk_H on October 19, 2016, 07:40:40 AM
ok the screen output works for me now with:
Code: [Select]
sudo SDL_VIDEODRIVER=fbcon SDL_FBDEV=/dev/fb1 /opt/jivelite/bin/jivelite &
However I have problems with the touchscreen (ads7846), but as this topic is named fbtft, I'll open a new thread.
Title: Re: fbtft
Post by: jordache on October 19, 2016, 11:21:47 PM
hey jgrulich, thanks for the code suggestion.  i ran it via ssh and it looks like it's running properly, but it still doesn't switch the display.  fbtft.conf is pointing to fb1 though...obviously the screen is working, just not with jivelite.

when picoreplayer finishes loading it says "starting jivelite...done"...is there any command to see where jivelite is sending its output?  i know that the LCD screen is working fine, because it shows all of the bootcode for picoreplayer, but when it's time to run jivelite, the screen is just stuck on the code so the output must be going somewhere else.

i remember nowhinjing mentioning this exact problem on a forum about a year ago, but i don't know if he ever resolved it properly

one final thing to mention, when i run the jivelite installer via the picoreplayer web interface, it does mention that libts.tcz is missing.  i loaded the libts.tcz that i found on ralphy's github and it seems to load fine....although i'm wondering if that is somehow part of the problem?

if anyone has any thoughts, it would be much appreciated - i'm so close!!!
Title: Re: fbtft
Post by: jgrulich on October 20, 2016, 04:21:31 AM
first you need to disable the Jivelite autostart in the piCorePlayer config.cfg to set
Code: (bash) [Select]
JIVELITE="no"

Than reboot and start the Jivelite with the
Code: (bash) [Select]
sudo SDL_VIDEODRIVER=fbcon SDL_FBDEV=/dev/fb1 /opt/jivelite/bin/jivelite &

To have the changes permanent, you need to modify the
Code: (bash) [Select]
/opt/jivelite/bin/jivelite.sh
Title: Re: fbtft
Post by: jordache on October 20, 2016, 06:51:16 PM
thank you jgrulich!  that is exactly what i was trying to find.  so i disabled autostart and tried the command line instead.  now i have more information as to what is happening, and it seems like jivelite is getting stuck because of the resolution (error's suggesting that the wrong resolution is selected).  the screen i'm using is 480x320, which is too small for the joggler skin i believe.  i've read that the WQVGA Small Print (480x272) is what should be used for smaller screens.  is it possible to specify the WQVGA skin from the command line start of jivelite?
Title: Re: fbtft
Post by: jordache on October 26, 2016, 02:55:01 AM
hi everyone,
i made some pretty great progress - i figured out how to recompile the jivelite.tcz to initiate the WQVGA skin as the default instead of joggler.  so now i finally have picoreplayer working on my 3.5 touchscreen!  big thanks to everyone who gave bits of knowledge here and there.

there is, however, one problem that remains:  the Y axis of the touchscreen works properly, but the X axis is inverted.  i've tried rotating the screen, calling the swapxy in every place i could find it, and even tried invertx.  but nothing seems to work.  there is also an issue where the scaling of the movement is off, so as i get close to the edge of the screen, the cursor jumps further and further in that direction.  however, i can't seem to get a calibration setup going.  if anyone has any final tips, even quick hints, about how to get those things corrected, i would be very grateful.

thanks again
Title: Re: fbtft
Post by: madmax6 on January 10, 2017, 03:05:53 AM
hello Jordache,

i've got the same screen, can you post me the jevelite.tcz and how you've managed to get jivelite to work on your screen?

thanks

Max
Title: Re: fbtft
Post by: jordache on January 11, 2017, 11:26:51 AM
hey max,
i think it was you who emailed me a few days ago about this - i sent you an email back but for some reason it would not deliver, i'm not sure why.  anyways, as i said in my post before, the way to get jivelite working on a screen this small is to edit the "DesktopJiveMeta.lua" file in the unsquashed jivelite.tcz to point the default skin to "WQVGAsmallSkin" instead of "Joggler" and then recompile.  This is because the Joggler skin (the normal default) is too big for the 3.5" screen that we're using.  alternatively, you should be able to hook your raspberry pi up via the HDMI cable, select the WQVGA as the default screen, and THEN use the 3.5" screen as normal.  i hope this makes sense - it was a few months ago now that i solved this, so my memory is a little bit hazy.  i tried attaching the jivelite.tcz file here, but the forum max is 192KB, and the TCZ file is 11.4MB.  so if you want it i can email it to you (although your email address doesn't appear to accept emails for some reason - perhaps you can give me an alternate address to use).  i hope that helps, feel free to ask any more questions and i'll try my best to answer them!
Title: Re: fbtft
Post by: Rich on January 11, 2017, 01:35:51 PM
Hi jordache
Quote
i tried attaching the jivelite.tcz file here, but the forum max is 192KB, and the TCZ file is 11.4MB.
Besides the size issue, you are not allowed to post extensions in the forum.
Title: Re: fbtft
Post by: jordache on January 11, 2017, 09:21:15 PM
Besides the size issue, you are not allowed to post extensions in the forum.

seems like an odd rule - aren't these forums about sharing the fruits of our collective labor?  ah well anyways, thanks for the heads up Rich...i'll be sure to avoid posting extensions in the future.
Title: Re: fbtft
Post by: Juanito on January 11, 2017, 09:45:36 PM
Please see the extensions section of the wiki for submission guidelines
Title: Re: fbtft
Post by: Rich on January 11, 2017, 09:54:11 PM
Hi jordache
It's not that extensions are not wanted or appreciated. It's just that extensions should be submitted to the repository. This
way they are centrally located rather than scattered in posts across the forum. The Wiki has instructions for creating and
submitting extensions. Instructions for submission are here:
http://wiki.tinycorelinux.net/wiki:creating_extensions#send_to
Title: Re: fbtft
Post by: nowhinjing on May 08, 2017, 09:24:36 AM
I submitted a tft.tcz some time ago, but it has not appeared in the repository, nor have I heard any thing about it - has it perchance got lost ?

For those interested in getting TFT screens to work with piCorePlayer, see this guide.

Code: [Select]
http://www.pughx2.com/picoreplayer.html
NWJ
Title: Re: fbtft
Post by: Rich on May 08, 2017, 09:33:23 AM
Hi nowhinjing
Depending on when you submitted it, it seems to take between 1 and 2 weeks for extensions to show up in the repository.
After that it may take a day or 2 to propagate to the mirrors.
Title: Re: fbtft
Post by: nowhinjing on May 08, 2017, 11:53:42 PM
.. was submitted on May !st ...

I guess, I should be patient.

NWJ