This repository was archived by the owner on Sep 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 495
Out of tree build
notro edited this page Jul 2, 2014
·
5 revisions
It is possible to build FBTFT out-of-tree if the prerequisites are met:
depends on FB && SPI && GPIOLIB
select FB_SYS_FILLRECT
select FB_SYS_COPYAREA
select FB_SYS_IMAGEBLIT
select FB_SYS_FOPS
select FB_DEFERRED_IO
select FB_BACKLIGHT
FB_BACKLIGHT is optional
Thanks to wrobell and mweal-ed for making this happen.
I'm using BBB as an example.
Debian image used:
- http://beagleboard.org/latest-images
- http://debian.beagleboard.org/images/bone-debian-7.5-2014-05-14-2gb.img.xz
- username: debian
- password: temppwd
Ref: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#Expanding_File_System_Partition_On_A_microSD
$ df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 1.6G 1.5G 3.4M 100% /
$ cd /opt/scripts/tools/
$ git pull
# ignore error message: The command to re-read the partition table failed.
$ sudo ./grow_partition.sh
# this takes a little longer than usual
$ sudo reboot
$ df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 3.6G 1.5G 2.0G 43% /
$ zgrep -E "CONFIG_SPI=|CONFIG_GPIOLIB=|DEFERRED|FB_SYS_|FB_BACKLIGHT" /proc/config.gz
CONFIG_SPI=y
CONFIG_GPIOLIB=y
CONFIG_FB_SYS_FILLRECT=y
CONFIG_FB_SYS_COPYAREA=y
CONFIG_FB_SYS_IMAGEBLIT=y
CONFIG_FB_SYS_FOPS=y
CONFIG_FB_DEFERRED_IO=y
FB_BACKLIGHT is missing, which turns off the builtin FBTFT backlight handling.
Ref: http://dumb-looks-free.blogspot.fr/2014/06/beaglebone-black-bbb-kernal-headers.html
Install kernel source
$ wget https://raw.github.com/gkaindl/beaglebone-ubuntu-scripts/master/bb-get-rcn-kernel-source.sh
$ chmod +x bb-get-rcn-kernel-source.sh
$ sudo ./bb-get-rcn-kernel-source.sh
I had to change EXTRAVERSION to have the modules end up in the right directory when doing make install later.
$ uname -r
3.8.13-bone50
$ cd /usr/src/linux-3.8.13-bone50/
$ sudo nano Makefile
EXTRAVERSION = -bone50
# not sure if this is needed, didn't take the time to find out
$ sudo make prepare
Fetch FBTFT source, build and install drivers
$ cd
$ git clone https://github.com/notro/fbtft
$ cd fbtft
$ make
$ sudo make install
# I don't know why this is needed (it has been run by the previous make command)
$ sudo depmod
# modules should end up here
$ ls -l /lib/modules/3.8.13-bone50/extra/
Load driver
# enable SPI
$ echo BB-SPIDEV0 | sudo tee /sys/devices/bone_capemgr.*/slots
BB-SPIDEV0
$ ls -l /dev/spi*
crw-rw---T 1 root spi 153, 1 Jul 2 15:01 /dev/spidev1.0
crw-rw---T 1 root spi 153, 0 Jul 2 15:01 /dev/spidev1.1
# I didn't test this with a display, only tested to see if the driver would load
$ sudo modprobe fbtft_device name=hy28b busnum=1 #gpios=reset:XX
$ dmesg | tail
<snip>
[74822.230273] graphics fb1: fb_ili9325 frame buffer, 240x320, 150 KiB video memory, 4 KiB DMA buffer memory, fps=51, spi1.0 at 48 MHz