Configuring the PiTFT

For this guide, I'm using the PiTFT - Assembled 320x240 2.8" TFT+Touchscreen, but these instructions should work for any hardware supported by the Adafruit PiTFT Helper, including the 2.8" capacitive version, the 2.2" version, and the 3.5" version.

If You Don't Care About Using Kali's Kernel Patches

Detailed instructions for configuring a PiTFT on a Raspbian system can be found here:

...and in fact, these would mostly work for Kali. If you just want a working Kali install with the stock Adafruit kernel, you can mount the boot partition, and then follow the instructions for installing adafruit-pitft-helper plus our kernel. Here's the quick and dirty version.

First, while logged in as root, make sure the boot partition (the first partition on the SD card) is available for writing:

Download: file
mount /dev/mmcblk0p1 /boot

This will let us install a custom kernel and rewrite files like config.txt and cmdline.txt to configure the display. Next, add apt.adafruit.com to your package repository lists, and install adafruit-pitft-helper:

Download: file
curl -SLs https://apt.adafruit.com/add | bash
apt-get install -y adafruit-pitft-helper

Then wait until everything has installed (this will take quite a while), and run the helper script:

Download: file
adafruit-pitft-helper -u /root/ -t 28r

Make sure you change -t 28r to an appropriate value for your hardware, if it differs from the 2.8" resistive screen. adafruit-pitft-helper -h will list the valid values.

If You Want the Kali Kernel Patches

This process is a bit more manual, at the moment, but should work.

First, as above, mount the boot partition:

Download: file
mount /dev/mmcblk0p1 /boot

Next, you'll need some kernel packages.

If you're a glutton for punishment, you can build these using our Raspberry Pi Kernel-o-Matic, which uses Vagrant to spin up a little virtual machine just for cross-compiling Pi kernels. We have a guide for the basics of installation; in particular, here we need to do a custom build using this branch of the Adafruit kernel repository which contains Kali's patches along with our tweaks for the PiTFT. Once you have the Vagrant box running, do vagrant ssh to connect, and then build the kernel like so:

Download: file
sudo adabuild -b rpi-kali-3.18.y

If you'd rather skip this process, you can download a pre-built set of packages here:

or by running

Download: file
wget http://adafruit-download.s3.amazonaws.com/adafruit_pitft_kernel_1.20150420-1.tar.gz

Either way, once you have a file like adafruit_pitft_kernel_1.20150420-1.tar.gz, copy it to /root on your Pi, and extract it like so:

Download: file
tar xf adafruit_pitft_kernel_1.20150420-1.tar.gz

Now, run the installer script:

Download: file
cd adafruit_pitft_kernel_1.20150420-1
./install.sh

This will take a long time. Once finished, it'll prompt to reboot the Pi immediately. It's safe to say yes, or no if you want to check the contents of /boot to make sure that the kernel and related files got replaced properly, which you can do with ls -l /boot:

Once you've done that, restart the machine with reboot.

Finally, download and run the PiTFT helper script. (Grab it directly from GitHub rather than installing from apt.adafruit.com, because the packaged version depends on a different kernel package.)

Download: file
git clone https://github.com/adafruit/Adafruit-PiTFT-Helper.git

Mount the boot partition again:

Download: file
mount /dev/mmcblk0p1 /boot

And run:

Download: file
cd Adafruit-PiTFT-Helper
./adafruit-pitft-helper -u /root/ -t 28r

You'll be prompted to answer a few questions.

Your output will likely look a bit different from this (I recorded the above GIF after I'd already configured the screen once), but should be similar.

Now reboot again, and you should be good to go!

You should also be able to run startx at the prompt and land on the desktop.

This guide was first published on Apr 21, 2015. It was last updated on Apr 21, 2015. This page (Configuring the PiTFT) was last updated on Oct 22, 2019.