element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
BeagleBoard
  • Products
  • Dev Tools
  • Single-Board Computers
  • BeagleBoard
  • More
  • Cancel
BeagleBoard
Blog Build fbtft drivers for Linux 4.4 on BeagleBone Black
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join BeagleBoard to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: fustini
  • Date Created: 24 Nov 2015 9:41 PM Date Created
  • Views 3511 views
  • Likes 2 likes
  • Comments 4 comments
  • fbtft
  • beaglebone_black
  • open_source
  • oshw
  • embedded
  • bbb
  • kernel
  • open_hardware
  • linux
Related
Recommended

Build fbtft drivers for Linux 4.4 on BeagleBone Black

fustini
fustini
24 Nov 2015

image

In previous blog posts, I've showed how to use small LCD displays as a Linux framebuffer on the BeagleBone Black thanks to the fbtft drivers:

  • BeagleBone Black LCDs with Prebuilt FBTFT drivers
  • BeagleBone Black: build fbtft drivers for latest Linux 3.8 kernel
  • Build fbtft drivers for TI Linux 4.1 kernel

 

In this post, I will show how to use fbtft drivers on BBB with the latest version of the Linux kernel.  In this case, that is Linux 4.4.


Full transcript in this GitHub Gist.

 

 

Step 1: Build kernel


Clone Robert C. Nelson's bb-kernel repo and checkout the am33x-v4.4 branch.  When I did last week, the latest kernel version was 4.4-rc1-bone0:

laptop$ git clone https://github.com/RobertCNelson/bb-kernel

 

laptop$ cd bb-kernel/

 

laptop$ git checkout am33x-v4.4

 

laptop$ ./build_kernel.sh

 

The build kernel script will at some point open the kernel config menu system.  Enable Device Drivers->Staging->fbtft:

image

image

image

image



Step 2: Install kernel


Flash latest Debian 8.2 (Jessie) console image for the BBB:

laptop$ wget https://rcn-ee.com/rootfs/bb.org/testing/2015-11-15/console/bone-debian-8.2-console-armhf-2015-11-15-2gb.img.xz

 

laptop$ xz -d bone-debian-8.2-console-armhf-2015-11-15-2gb.img.xz

 

laptop$ sudo dd if=/home/afustini/Downloads/bbb-images/bone-debian-8.2-console-armhf-2015-11-15-2gb.img.xz of=/dev/sdc

 

laptop$ sudo eject /dev/sdc

 

Remove and re-insert so that fs gets mounted.  Run this from bb-kernel directory:

laptop$ ./tools/install_kernel.sh

 

Eject card and boot the BeagleBone with it.  Once booted, grow the filesystem to make use of free space on the card:

bone$ sudo /opt/scripts/tools/grow_partition.sh

 

bone$ sudo reboot

 

Finish installation of the new kernel on the BeagleBone.  The install script fails to do this.  In this case, my new kernel is 4.4.0-rc1-bone0:

bone$ sudo cp -pr /dtbs /boot/dtbs/4.4.0-rc1-bone0

 

bone$ sudo cp /zImage /boot/vmlinuz-4.4.0-rc1-bone0

 

Edit /boot/uEnv.txt on Beaglebone so that the new kernel is booted:

bone$ sudo vi /boot/uEnv.txt

uname_r=4.4.0-rc1-bone0

dtb=am335x-boneblack-overlay.dtb

 

bone$ sudo reboot

 

Verify the the BeagleBone booted the new kernel:

bone$ uname -a

Linux beaglebone 4.4.0-rc1-bone0 #4 Thu Nov 19 20:26:04 CST 2015 armv7l GNU/Linux

 

 

Step 3: Configure SPI

 

Build the latest Device Tree Overlays:

bone$ sudo apt-get update

 

bone$ sudo apt-get install git

 

bone$ git clone https://github.com/beagleboard/bb.org-overlays

 

bone$ cd bb.org-overlays

 

bone$ ./dtc-overlay.sh

 

bone$ ./install.sh


Load the Device Tree Overlay for BB-SPIDEV1 "virtual cape" as my LCD is wired up to spi1 pins:

bone$ cat /sys/devices/platform/bone_capemgr/slots

0: PF----  -1

1: PF----  -1

2: PF----  -1

3: PF----  -1


bone$ sudo /bin/sh -c 'echo BB-SPIDEV1 > /sys/devices/platform/bone_capemgr/slots'


bone$ cat /sys/devices/platform/bone_capemgr/slots

0: PF----  -1

1: PF----  -1

2: PF----  -1

3: PF----  -1

4: P-O-L-  0 Override Board Name,00A0,Override Manuf,BB-SPIDEV1

 

 

Step 4: Load fbtft drivers

 

Load fbtft_device module for adafruit18 (Adafruit 1.8" TFT LCD) which will use the fb_st7735r driver:

bone$ sudo modprobe fbtft_device busnum=1 name=adafruit18 debug=7 verbose=3 gpios=dc:48,reset:60


Display image on the LCD display:

bone$ sudo apt-get install fbi

bone$ wget 'http://beagleboard.org/static/uploads/BorisTux_w_Logo.png'

bone$ sudo fbi -d /dev/fb0 -T 1 -a BorisTux_w_Logo.png

  • Sign in to reply

Top Comments

  • Problemchild
    Problemchild over 10 years ago in reply to fustini +1
    You probably do as there is often a spare I2C or in this case SPI available on board ... you just dont know about it. Also the Linux SPI descipline can create an SPI device from some unrelated GPIO. Would…
  • fustini
    fustini over 10 years ago in reply to Problemchild

    Interesting... it would be fun to use I2C or SPI on a x86 computer to interface with external peripherals

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Problemchild
    Problemchild over 10 years ago in reply to fustini

    You probably do as there is often a spare I2C or in this case SPI available on board  ... you just dont know about it.

    Also the Linux SPI descipline can create an SPI device from some unrelated GPIO.

     

    Would be interesting and rather cool as an info screen but I do think it would be a bit of a PITA finding the info out...good project though!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • fustini
    fustini over 10 years ago in reply to Problemchild

    Linux device drivers like this are typically architecture independent.  These fbtft drivers (in drivers/staging/ dir of the Linux kernel src) can be built on x86, too.  However, I don't have any way to connect a SPI device like this Adafruit TFT LCD to my x86 laptop.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Problemchild
    Problemchild over 10 years ago

    Is that part of the Kernel config menu structure specific to ARM builds or available to all Kernel builds Drew?

    I.e can you find this and build for say x86 since a lot of those have SPI/I2C hanging around on the Motherboard.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube