How to recompile PiTFT 3.5" drivers - with errors

Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Locked
chrisharrington
 
Posts: 8
Joined: Sat Sep 15, 2012 7:41 am

How to recompile PiTFT 3.5" drivers - with errors

Post by chrisharrington »

This is a cross post from the Glowy Things forum - a user pointed out that Raspberry Pi accessories was the more appropriate place to post.

New users of the PiTFT who follow the driver install instructions at https://learn.adafruit.com/adafruit-pit ... ed-install may have noticed that those drivers replace the current Raspbian kernel with an older one, and they may decide to try and recompile the drivers. This currently doesn't work for the latest release kernel.

The cross-post:

--------------------------------------
To compile the drivers from source, follow the steps here up to (and including) "Get the kernel source":

http://elinux.org/Raspberry_Pi_Kernel_Compilation

Once you get the kernel source downloaded, you follow the instructions at the bottom of the page below. However, the Adafruit drivers are a fork of a driver called fbtft, and the instructions are for fbtft, not adafruit:

https://github.com/xobs/adafruit-rpi-fbtft

...so, here are the edited instructions for this step:

In the downloaded kernel source directory:

> cd drivers/video
> git clone https://github.com/xobs/adafruit-rpi-fbtft

Add to drivers/video/Kconfig:

source "drivers/video/adafruit-rpi-fbtft/Kconfig"

Add to drivers/video/Makefile:

obj-y += adafruit-rpi-fbtft/

Then, return to the step "Get the compiler" in the kernel source compile instructions and follow the remaining instructions.

When you get to the step

> make ARCH=arm CROSS_COMPILE=${CCPREFIX} oldconfig

You'll be asked a bunch of things on the command line. You can hit return for all *except* the questions about enabling small TFT support. Enter Y Return, and then you will have to choose the specific driver by entering M or y. If you want the drivers as part of the kernel, it is yes. If you want as a separate module, you have to press M here for "ili9340" only (at least for the 3.5" which I have. no need to compile all the other types).
If you miss it (there's a bunch to click through and it's easy to miss), you can still enable the driver in the next command, but only as kernel included, not as a module.

The next command:

make ARCH=arm CROSS_COMPILE=${CCPREFIX} menuconfig

> allows you to again select which drivers to include but as you already did it on the command line, Drivers > Graphical Drivers > Small TFT etc. should already be selected.

Then follow the remaining steps. If you use kernel 3.18.y, compilation will probably fail.

The errors issued are:

Code: Select all

drivers/video/adafruit-rpi-fbtft/fbtft-sysfs.c:150:2: error: negative width in bit-field ‘<anonymous>’
Which can be fixed with this patch:

https://github.com/notro/fbtft/commit/4 ... 30c77fd782

Another error is:

Code: Select all

drivers/video/adafruit-rpi-fbtft/fbtft_device.c:330:5: error: unknown field ‘irq_base’ specified in initializer
As I said, I don't do C or driver programming, so I don't know how to fix this one.

Locked
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Return to “Adafruit Raspberry Pi® accessories”