BPI-M5 not working with SPI TFT display board

Hello ! I bought some time ago a 3.5 inch TFT display (http://www.lcdwiki.com/3.5inch_RPi_Display) and I have followed the installation instructions to be used in my BPI-M5 however the TFT display is always just plain white.

Before installing the display drivers, I ran an apt update and upgrade commands and rebooted. The installation process was simply cloning the repo and running the script:

git clone https://github.com/goodtft/LCD-show.git
chmod -R 755 LCD-show
cd LCD-show/
sudo ./LCD35-show

Some info about my system (Im using the Ubuntu Mate image from the BPI wiki)

[email protected]:~$ uname -r
4.9.241-BPI-M5
[email protected]:~$ uname -a
Linux bananapi 4.9.241-BPI-M5 #2 SMP PREEMPT Mon Jun 21 16:29:40 HKT 2021 aarch64 aarch64 aarch64 GNU/Linux

After running sudo ./LCD35-show for the first time, the connected HDMI display stopped working but the TFT screen was blank. I noticed in the log there was a cmake error while running the script:

include <bcm_host.h>: No such file or directory

I found the solution (not 100% sure since it’s for the RPI) in this thread of stackoverflow with the command sudo apt-get install libraspberrypi-dev (I didnt install raspberrypi-kernel-headers since it was not found)

I also noticed I was getting these errors in the script:

grep: /boot/cmdline.txt: No such file or directory
cp: cannot stat '/boot/cmdline.txt': No such file or directory

So I manually made created an empty file in the boot partition cmdline.txt. However I checked later and there was nothing added to this file (?)

This is the output Im getting now from the script:

[email protected]:~/Documents/LCD-show$ sudo ./LCD35-show
Hit:1 http://ppa.launchpad.net/ubuntu-pi-flavour-makers/ppa/ubuntu focal InRelease
Hit:2 http://ports.ubuntu.com/ubuntu-ports focal InRelease
Hit:3 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease
Hit:4 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
cmake is already the newest version (3.16.3-1ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 13 not upgraded.

Cloning into 'rpi-fbcp'...
remote: Enumerating objects: 61, done.
remote: Total 61 (delta 0), reused 0 (delta 0), pack-reused 61
Unpacking objects: 100% (61/61), 18.24 KiB | 209.00 KiB/s, done.
CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/Documents/LCD-show/rpi-fbcp/build
Scanning dependencies of target fbcp
[ 50%] Building C object CMakeFiles/fbcp.dir/main.c.o
[100%] Linking C executable fbcp
[100%] Built target fbcp
2021
need to update touch configuration
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  xserver-xorg-input-evdev
0 upgraded, 1 newly installed, 0 to remove and 13 not upgraded.
Need to get 0 B/29.7 kB of archives.
After this operation, 98.3 kB of additional disk space will be used.
Selecting previously unselected package xserver-xorg-input-evdev.
(Reading database ... 177716 files and directories currently installed.)
Preparing to unpack .../xserver-xorg-input-evdev_1%3a2.10.6-1_arm64.deb ...
Unpacking xserver-xorg-input-evdev (1:2.10.6-1) ...
Setting up xserver-xorg-input-evdev (1:2.10.6-1) ...
Processing triggers for man-db (2.9.1-1) ...

reboot now

I tried running the script, rebooting several times, connecting and disconnecting the HDMI, running the ./LCD-hdmi script and then the ./LCD35-show script but nothing have worked so far, at one point after running ./LCD35-show the HDMI display showed the desktop environment again (it was reconnected somehow) which it’s still somewhat confusing.

Some data about my boot partition:

[email protected]:~$ ls -l /boot
total 20772
-rwxr-xr-x 1 root root     5546 Jun  7  2021  boot.ini
-rwxr-xr-x 1 root root   212492 Nov 13  2020  boot-logo.bmp.gz
-rwxr-xr-x 1 root root        1 Jun 27 01:04  cmdline.txt
-rwxr-xr-x 1 root root     1960 Jun 27 01:17  config.txt
-rwxr-xr-x 1 root root      120 Jan  1  1980  display.bin
-rwxr-xr-x 1 root root      128 Jan  1  1980  edid.bin
-rwxr-xr-x 1 root root  9198024 Jun 21  2021  Image.gz
-rwxr-xr-x 1 root root    70715 Jun 21  2021  meson64_bananapi_m2_pro.dtb
-rwxr-xr-x 1 root root    70980 Jun 21  2021  meson64_bananapi_m5.dtb
drwxr-xr-x 2 root root     2560 Jun 27 01:17  overlays
drwxr-xr-x 2 root root      512 Jun 27 00:47 'System Volume Information'
-rwxr-xr-x 1 root root 11704481 Oct 27  2020  uInitrd
[email protected]:~$ cat /boot/config.txt
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
#dtoverlay=vc4-fkms-v3d
max_framebuffers=2

[all]
#dtoverlay=vc4-fkms-v3d
hdmi_force_hotplug=1
dtparam=i2c_arm=on
dtparam=spi=on
enable_uart=1
dtoverlay=tft35a:rotate=90
hdmi_group=2
hdmi_mode=1
hdmi_mode=87
hdmi_cvt 480 320 60 6 0 0 0
hdmi_drive=2

Some notes

  • apt upgrade shows all packages updated
  • I checked the pins and they seem to be the same as in the RPI, so I connected the TFT screen in the same manner
  • I’m using a “fast charge” phone charger which I guess gives enough power. It states “5V 2A 10W or 5V 6A Max 30W”
  • I have no other RPI/BPI to check that the display is working correctly
  • Everytime I ran the LCD35-show script it seems to try to install the xserver-xorg-input-evdev package (and succeed):
The following NEW packages will be installed:
  xserver-xorg-input-evdev
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.

Update I also tried with the official preconfigured image of Ubuntu Mate (32bits) from here http://www.lcdwiki.com/3.5inch_RPi_Display with no luck