Fbtft with Beaglebone Black

fbtft is  'Linux Framebuffer drivers for small TFT LCD display modules.' which supports several small LCDs which are driven by SPI bus.This page describes how to use this device driver.

Hardware Configuration
As an example, we use this LCD which is driven by ST7735R lcd driver. Please connect the LCD with BBB as following table:

BSP Build & Install
This page shows very detailed description of how to build and install BSP for BBB including U-boot, Linux kernel and distributions. Build & install all of them!

You should fully understand how to build and install the things, especially for the Linux kernel to continue.

Device Tree Description
In this example, we don't use device tree overlay. Instead, we append what we need to the device tree source that will be loaded at boot time.

Please edit the bb-kernel/KERNEL/arch/arm/boot/dts/am335x-boneblack.dts like followings:

PINMUX description for SPI0
Append following code to pinmuxing section: You can understand the meaning of this pin muxing by comparing this code with this table :)

SPI Enabling
Append following code to the end of the source code: Because fbtft driver doesn't take advantage of the device tree, there is no need to describe the peripheral under the SPI bus. Just enable the SPI driver.

Full source code
You can see the full source code of the modified dts file at this link.

Build & Install
If you fully understand how to build the dts and copy dtb to the BBB, it is very easy. If not, just type this code:

Enabling fbtft
Fortunately, fbtft is already in the BBB kernel so we don't need to build and install it. Just boot the BBB and type following to enable the fbtft : Parameters for this device driver means:


 * 1) busnum = 1 : We want to use SPI0 bus. (SPI0 is exported to the kernel as SPI 1)
 * 2) name=adafruit18 : We want to use adafruit18 LCD driver in the fbtft source code tree, which is compatible with our LCD.
 * 3) gpios=dc : 60, reset:48 : GPIO 60 means GPIO1_28(32*1 + 28 = 60) and GPIO 48 means GPIO1_16(32 * 1 + 16 = 48). As we configured, we want use these GPIO pins.

Working Correctly?
When booted without loading the fbtft module, LCD just shows white screen, and when the driver is working correctly, LCD should change to the black screen.

Also, new file named /dev/fb1 should be created.

Testing It
Then you should be able to see random-colored dots in the screen.

Some Examples
This page introduces some useful examples to use the fbtft.

This example is my favorite one :)