# Adafruit 1.3" 240x240 Kernel Module Install

**URL:** <https://forums.balena.io/t/adafruit-1-3-240x240-kernel-module-install/250177>\
**Category:** Product support\
**Tags:** kernelmodules, kernel-module, raspberrypizero\
**Created:** [February 5, 2021, 7:50pm UTC](https://forums.balena.io/t/adafruit-1-3-240x240-kernel-module-install/250177 "2021-02-05T19:50:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![arronmabrey](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/arronmabrey/32/5385_2.png) [@arronmabrey](https://forums.balena.io/u/arronmabrey)\
**Post date:** [February 5, 2021, 7:50pm UTC](https://forums.balena.io/t/adafruit-1-3-240x240-kernel-module-install/250177/1 "2021-02-05T19:50:31Z")

</div>

I’m working on a project and I’m looking to get an Adafruit 240x240 display installed on a Raspberry Pi Zero W. I’m using the kernel method so I can have direct access to the frame buffer using OpenGL.

[https://learn.adafruit.com/adafruit-mini-pitft-135x240-color-tft-add-on-for-raspberry-pi/1-3-240x240-kernel-module-install](https://learn.adafruit.com/adafruit-mini-pitft-135x240-color-tft-add-on-for-raspberry-pi/1-3-240x240-kernel-module-install)

From what I’m gathered, this display requires a kernel module/extension. Here is the Adafruit installer scripts

[https://github.com/adafruit/Raspberry-Pi-Installer-Scripts/blob/master/converted\_shell\_scripts/adafruit-pitft.sh](https://github.com/adafruit/Raspberry-Pi-Installer-Scripts/blob/master/converted_shell_scripts/adafruit-pitft.sh)

It expects access to /boot to do it’s work.

Reading Balena docs makes it seem like I need to compile and install the overlays and kernel extension into the reason-boot partition on the SD card prior to the first boot. Is this correct?

If that line of thinking is even correct, I’m not sure how to connect those dots.

One thought was, run the installer against a vanilla RaspberryPI image and then copy the compiled files off and putting them into the Balena/reason boot partition before the first boot, but I have no idea of the outcome.

Can anyone please shed some light? 🙂

Thanks,

— Arron

---

<div class="post-metadata">

**Author:** ![anujdeshpande](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/anujdeshpande/32/3155_2.png) [@anujdeshpande](https://forums.balena.io/u/anujdeshpande)\
**Post date:** [February 10, 2021, 8:55am UTC](https://forums.balena.io/t/adafruit-1-3-240x240-kernel-module-install/250177/4 "2021-02-10T08:55:35Z")

</div>

Hi

I think there are 2 problems here -

- making those drivers available in the os
- enabling them in boot config

1. For the first problem, I think you’ll have to build the balenaOS image yourself and make sure you include whatever extra stuff you need. We use yocto to build our balenaOS images, and you can find instructions for the same [here](https://www.balena.io/os/docs/custom-build/)
2. For the second case, once you have added whatever you need, you can make changes to the config.txt for the dt overlays or dt params. This can be done through the balena dashboard, or by manually editing the files. The first method is simpler. Check the docs for that [here](https://www.balena.io/docs/learn/manage/configuration/#variable-list)

---

<div class="post-metadata">

**Author:** ![arronmabrey](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/arronmabrey/32/5385_2.png) [@arronmabrey](https://forums.balena.io/u/arronmabrey)\
**Post date:** [February 15, 2021, 10:09pm UTC](https://forums.balena.io/t/adafruit-1-3-240x240-kernel-module-install/250177/6 "2021-02-15T22:09:37Z")

</div>

Thanks for the reply. I believe you are right. I spent some time working with the kernel-build project but didn’t get it working. For anyone else, I ended up using this userland driver for the display

> **[juj/fbcp-ili9341](https://github.com/juj/fbcp-ili9341)**
>
> A blazing fast display driver for SPI-based LCD displays for Raspberry Pi A, B, 2, 3, 4 and Zero

With this Dockerfile:

```auto
FROM balenalib/%%BALENA_MACHINE_NAME%%-debian:buster-build

RUN apt update -y
RUN apt-get update -y
RUN apt-get upgrade -y
RUN apt-get install -y cmake
RUN apt-get install -y libraspberrypi-dev raspberrypi-kernel-headers

RUN git clone https://github.com/juj/fbcp-ili9341.git
WORKDIR fbcp-ili9341
RUN git reset --hard 662e8db76ba16d86cf6fd09d85240adc19e62735

RUN mkdir -p build
WORKDIR build
RUN cmake -DSTATISTICS=0 -DSPI_BUS_CLOCK_DIVISOR=6 -DST7789=ON -DGPIO_TFT_DATA_CONTROL=25 -DGPIO_TFT_BACKLIGHT=26 -DBACKLIGHT_CONTROL=ON -DSINGLE_CORE_BOARD=ON -DARMV6Z=ON -DUSE_DMA_TRANSFERS=OFF ..
RUN make -j

ENTRYPOINT ./fbcp-ili9341

```
