WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: fbtft TFT driver  (Read 6264 times)

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
fbtft TFT driver
« on: September 23, 2015, 05:13:02 AM »
I'm trying to bring working the 3.5' TFT Touchscreen. It's using the fbtft module with the following setup:

Code: (bash) [Select]
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
fbtft_device debug=3 rotate=90 name=flexfb speed=16000000 gpios=reset:25,dc:24

I have the kernel modules for flexfb, it's in the staging directory. But it gives error message "Unknown parameter".

Has anybody experience with this driver, or any idea what to modify to bring this module working?

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: fbtft TFT driver
« Reply #1 on: September 23, 2015, 06:23:20 AM »
I've found that the LCD is supported by the generic tinylcd35 overlay. Unfortunately there are still some errors when loaded:
Code: (bash) [Select]
[    8.847700] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
[    8.848245] fbtft: Unknown symbol fb_sys_write (err 0)
[    8.848278] fbtft: Unknown symbol sys_imageblit (err 0)
[    8.848316] fbtft: Unknown symbol sys_fillrect (err 0)
[    8.848588] fbtft: Unknown symbol sys_copyarea (err 0)
[    8.848701] fbtft: Unknown symbol fb_sys_read (err 0)
[    8.907968] ads7846: Unknown symbol hwmon_device_unregister (err 0)
[    8.908017] ads7846: Unknown symbol hwmon_device_register_with_groups (err 0)

Any idea what's wrong?

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: fbtft TFT driver
« Reply #2 on: September 23, 2015, 06:27:45 AM »
Jan

which piCore version and which kernel are you using?
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: fbtft TFT driver
« Reply #3 on: September 24, 2015, 03:11:25 AM »
piCore-7.0alpha2, kernel 4.1.6. Tested on Rasbian with the same kernel and it works.
I'd like to test on the latest TC version, but I don't have the kernel source files to make the modules.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: fbtft TFT driver
« Reply #4 on: September 24, 2015, 04:18:01 AM »
Please update to the latest alpha release with 4.1.7 kernel. You can download all kernel modules from

http://tinycorelinux.net/7.x/armv6/releases/RPi/src/kernel/
http://tinycorelinux.net/7.x/armv7/releases/RPi2/src/kernel/
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: fbtft TFT driver
« Reply #5 on: September 25, 2015, 02:46:45 AM »
Hi Béla,

still the same error message:
Code: (bash) [Select]
modprobe: can't load module fbtft (kernel/drivers/staging/fbtft/fbtft.ko): unknown symbol in module, or unknown parameter

The same for the touchscreen controller:
Code: (bash) [Select]
modprobe: can't load module ads7846 (kernel/drivers/input/touchscreen/ads7846.ko): unknown symbol in module, or unknown parameter

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: fbtft TFT driver
« Reply #6 on: September 25, 2015, 03:19:45 AM »
This is the dmesg:
Code: (bash) [Select]
[    4.930700] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
[    4.931069] fbtft: Unknown symbol fb_sys_write (err 0)
[    4.931091] fbtft: Unknown symbol sys_imageblit (err 0)
[    4.931112] fbtft: Unknown symbol sys_fillrect (err 0)
[    4.931223] fbtft: Unknown symbol sys_copyarea (err 0)
[    4.931300] fbtft: Unknown symbol fb_sys_read (err 0)

[   21.831099] ads7846: Unknown symbol hwmon_device_unregister (err 0)
[   21.831135] ads7846: Unknown symbol hwmon_device_register_with_groups (err 0)

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: fbtft TFT driver
« Reply #7 on: September 25, 2015, 03:21:12 AM »
Check module dependencies with modinfo, probably you must load additional modules.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: fbtft TFT driver
« Reply #8 on: September 25, 2015, 04:08:39 AM »
Yes, you're right. It needs the video driver loaded first.
To switch to TFT I need con2fbmap. Please add to the repo.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: fbtft TFT driver
« Reply #9 on: September 25, 2015, 05:31:25 AM »
Yes, you're right. It needs the video driver loaded first.
To switch to TFT I need con2fbmap. Please add to the repo.

Do not find con2fbmap source code.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11221
« Last Edit: September 25, 2015, 07:53:44 AM by Rich »

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: fbtft TFT driver
« Reply #11 on: September 25, 2015, 10:49:52 AM »
Good link. I'm using similar way now, two boot options of cmdline.txt. One with fbcon=map:10 and other without.
But this is not smart way to do so, if I need to switch it very often.
May be that there is some other way how to switch between fb0 and fb1 device output.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11221
Re: fbtft TFT driver
« Reply #12 on: September 25, 2015, 10:53:25 AM »
Hi jgrulich
Actually I posted the link because it listed where to find the source for con2fbmap.

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: fbtft TFT driver
« Reply #13 on: September 25, 2015, 11:26:45 AM »
Hi Rich,

I've tried several tricks in this link and several other, but still no lucky. I've tried to use this link:
Code: (bash) [Select]
https://github.com/notro/fbtft/wiki/Framebuffer-use

and tried to make the mirroring:

Code: (bash) [Select]
sudo apt-get install cmake
git clone https://github.com/tasanakorn/rpi-fbcp
cd rpi-fbcp/
mkdir build
cd build/
cmake ..
make
sudo install fbcp /usr/local/bin/fbcp

Cmake works well, but make gives error that bcm_host.h can't be found and stops working.
I've tried to locate this file in the Rasbian source, but still no lucky.
Please help with compilation to bring the mirroring  working.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11221
Re: fbtft TFT driver
« Reply #14 on: September 25, 2015, 12:22:34 PM »
Hi jgrulich
I'm not running a Raspberry Pi myself, but this doesn't look right:
Code: [Select]
sudo apt-get install cmakePi has a complete tool set for building called  compile-essentials.tcz,  and  cmake.tcz  is in the repository. You might also
need one of the Linux headers extensions installed.