Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Failure compiling driver for Adafruit Mini PiTFT - 135x240 C
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Failure compiling driver for Adafruit Mini PiTFT - 135x240 C

by Hixie on Mon Aug 31, 2020 10:00 pm

Hello. I tried to follow all the steps here: https://learn.adafruit.com/adafruit-min ... spberry-pi

However when it comes to compiling the kernel module, the script fails, as shown below. I've confirmed that I'm on the latest kernel "apt" will let me upgrade to (4.19.66-v7+), I did a full "dist-upgrade" and so on. I've tried rebooting a few times. The salient error message is:

Code: Select all | TOGGLE FULL SIZE
make: Entering directory '/usr/src/linux-headers-4.19.66-v7+'
  CC [M]  /home/ianh/dev/Raspberry-Pi-Installer-Scripts/st7789_module/st7789v_ada.o
/home/ianh/dev/Raspberry-Pi-Installer-Scripts/st7789_module/st7789v_ada.c:23:35: fatal error: drm/drm_damage_helper.h: No such file or directory
 #include <drm/drm_damage_helper.h>
                                   ^
compilation terminated.


Here's the full log:
Code: Select all | TOGGLE FULL SIZE
This script downloads and installs
PiTFT Support using userspace touch
controls and a DTO for display drawing.
one of several configuration files.
Run time of up to 5 minutes. Reboot required!

Select configuration:
1. PiTFT 2.4", 2.8" or 3.2" resistive (240x320)
2. PiTFT 2.2" no touch (240x320)
3. PiTFT 2.8" capacitive touch (240x320)
4. PiTFT 3.5" resistive touch (320x480)
5. PiTFT Mini 1.3" or 1.54" display (240x240) - WARNING! WILL UPGRADE YOUR KERNEL TO LATEST
6. MiniPiTFT 1.14" display (240x135) - WARNING! WILL UPGRADE YOUR KERNEL TO LATEST
7. ST7789V 2.0" no touch (240x320) - WARNING! WILL UPGRADE YOUR KERNEL TO LATEST
8. Uninstall PiTFT
9. Quit without installing

SELECT 1-9: 6
Select rotation:
1. 90 degrees (landscape)
2. 180 degrees (portrait)
3. 270 degrees (landscape)
4. 0 degrees (portrait)

SELECT 1-4: 1
[PITFT] Checking init system...
Found systemd
/boot is mounted
[PITFT] System update
Updating apt indexes...
...
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

......
Reading package lists...
.........
[PITFT] Installing Python libraries & Software...
Installing Pre-requisite Software...This may take a few minutes!
[PITFT] Updating /boot/config.txt...
/boot/overlays/drm-minipitft114.dtbo: Warning (unit_address_vs_reg): Node /fragment@0 has a unit name, but no reg property
/boot/overlays/drm-minipitft114.dtbo: Warning (unit_address_vs_reg): Node /fragment@0/__overlay__/spidev@0 has a unit name, but no reg property
/boot/overlays/drm-minipitft114.dtbo: Warning (unit_address_vs_reg): Node /fragment@1 has a unit name, but no reg property
/boot/overlays/drm-minipitft114.dtbo: Warning (unit_address_vs_reg): Node /fragment@2 has a unit name, but no reg property
/boot/overlays/drm-minipitft114.dtbo: Warning (unit_address_vs_reg): Node /fragment@3 has a unit name, but no reg property
############# UPGRADING KERNEL ###############
Hit:1 http://raspbian.raspberrypi.org/raspbian stretch InRelease
Hit:2 http://archive.raspberrypi.org/debian stretch InRelease
Ign:3 https://storage.googleapis.com/download.dartlang.org/linux/debian stable InRelease
Hit:4 https://storage.googleapis.com/download.dartlang.org/linux/debian stable Release
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  libpulsedsp rtkit
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
/home/ianh/dev/Raspberry-Pi-Installer-Scripts/st7789_module /home/ianh/dev/Raspberry-Pi-Installer-Scripts
make: Entering directory '/usr/src/linux-headers-4.19.66-v7+'
  CC [M]  /home/ianh/dev/Raspberry-Pi-Installer-Scripts/st7789_module/st7789v_ada.o
/home/ianh/dev/Raspberry-Pi-Installer-Scripts/st7789_module/st7789v_ada.c:23:35: fatal error: drm/drm_damage_helper.h: No such file or directory
 #include <drm/drm_damage_helper.h>
                                   ^
compilation terminated.
scripts/Makefile.build:309: recipe for target '/home/ianh/dev/Raspberry-Pi-Installer-Scripts/st7789_module/st7789v_ada.o' failed
make[1]: *** [/home/ianh/dev/Raspberry-Pi-Installer-Scripts/st7789_module/st7789v_ada.o] Error 1
Makefile:1519: recipe for target '_module_/home/ianh/dev/Raspberry-Pi-Installer-Scripts/st7789_module' failed
make: *** [_module_/home/ianh/dev/Raspberry-Pi-Installer-Scripts/st7789_module] Error 2
make: Leaving directory '/usr/src/linux-headers-4.19.66-v7+'
WARNING : Apt failed to compile ST7789V drivers!


This is a Pi 3 Model B+.

Any ideas?

Hixie
 
Posts: 5
Joined: Mon Aug 31, 2020 9:52 pm

Re: Failure compiling driver for Adafruit Mini PiTFT - 135x2

by mikeysklar on Wed Sep 02, 2020 3:23 pm

Hello Hixie,

We have had some bugs related to compiling this driver on various Raspbian kernel. Although the error you are seeing I've not found before.

Code: Select all | TOGGLE FULL SIZE
Scripts/st7789_module/st7789v_ada.o
/home/ianh/dev/Raspberry-Pi-Installer-Scripts/st7789_module/st7789v_ada.c:23:35: fatal error: drm/drm_damage_helper.h: No such file or directory
 #include <drm/drm_damage_helper.h>


Which version of PiOS are you running? I ask because the last one was released in the last two weeks so you might need to go back one version.

mikeysklar
 
Posts: 2089
Joined: Mon Aug 01, 2016 8:10 pm

Re: Failure compiling driver for Adafruit Mini PiTFT - 135x2

by Hixie on Wed Sep 02, 2020 7:46 pm

`uname -a` says `Linux burmilla 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l GNU/Linux`.
Which version should I use? I'm happy to downgrade if that would help (the instructions for the display say to run `apt dist-upgrade` which is how I ended up on this version).

Hixie
 
Posts: 5
Joined: Mon Aug 31, 2020 9:52 pm

Re: Failure compiling driver for Adafruit Mini PiTFT - 135x2

by mikeysklar on Thu Sep 03, 2020 12:42 pm

We recommend the current release of Pi OS. The most recent drop was done on August 20th 2020.

https://www.raspberrypi.org/downloads/raspberry-pi-os/

Your kernel was built in 2019 and looks like a relatively old release of linux. You should upgrade to the above release and re-install the drivers with the pi-tft script.

PS - `raspinfo` is a great command to summarize your setup. It needs to be installed, but quickly summarizes what you are running.

Code: Select all | TOGGLE FULL SIZE
sudo apt-get install raspinfo


Code: Select all | TOGGLE FULL SIZE
pi@pi4:~ $ raspinfo | head -19
System Information
------------------

Raspberry Pi 4 Model B Rev 1.2
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"

Raspberry Pi reference 2019-07-10
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 175dfb027ffabd4b8d5080097af0e51ed9a4a56c, stage5

Linux pi4 5.4.51-v7l+ #1333 SMP Mon Aug 10 16:51:40 BST 2020 armv7l GNU/Linux
Revision        : c03112
Serial          : 100000002da2cf7a
Model           : Raspberry Pi 4 Model B Rev 1.2
Throttled flag  : throttled=0x0
Camera          : supported=0 detected=0

mikeysklar
 
Posts: 2089
Joined: Mon Aug 01, 2016 8:10 pm

Re: Failure compiling driver for Adafruit Mini PiTFT - 135x2

by Hixie on Thu Sep 03, 2020 2:23 pm

Ah, interesting. Is there no command to upgrade to the newest version directly? I expected `dist-upgrade` to do that but I guess not?

edit: never mind, I can Google these things myself. Will give it a go and report back. Thanks!

Hixie
 
Posts: 5
Joined: Mon Aug 31, 2020 9:52 pm

Re: Failure compiling driver for Adafruit Mini PiTFT - 135x2

by mikeysklar on Fri Sep 04, 2020 5:23 pm

Hi Hixie,

The usual command sequence to upgrade to the latest release is the following:

Code: Select all | TOGGLE FULL SIZE
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get dist-upgrade
$ sudo rpi-update   

mikeysklar
 
Posts: 2089
Joined: Mon Aug 01, 2016 8:10 pm

Re: Failure compiling driver for Adafruit Mini PiTFT - 135x2

by Hixie on Fri Sep 04, 2020 5:55 pm

rpi-update documentation says: "You should not use rpi-update on any system unless recommended to do so by a Raspberry Pi engineer. It may leave your system unreliable or even completely broken. It should not be used as part of any regular update process."

In any case, I updated to the latest and now it works great! Thanks for the help!

Hixie
 
Posts: 5
Joined: Mon Aug 31, 2020 9:52 pm

Re: Failure compiling driver for Adafruit Mini PiTFT - 135x2

by mikeysklar on Tue Sep 08, 2020 2:04 pm

Good to know. I checked the documentation and read that WARNING about a Pi engineers recommendation. It is understandable since it is updating firmware to pre-release versions. Had you run the rpi-update or just the apt-get updates? I will stop recommend the rpi-update since there is some risk involved with early releases.

mikeysklar
 
Posts: 2089
Joined: Mon Aug 01, 2016 8:10 pm

Re: Failure compiling driver for Adafruit Mini PiTFT - 135x2

by Hixie on Tue Sep 08, 2020 2:58 pm

I just replaced the old distro name with the new distro name in the apt list and ran update/dist-upgrade.

Hixie
 
Posts: 5
Joined: Mon Aug 31, 2020 9:52 pm

Please be positive and constructive with your questions and comments.