juj / fbcp-ili9341

A blazing fast display driver for SPI-based LCD displays for Raspberry Pi A, B, 2, 3, 4 and Zero
MIT License
1.62k stars 270 forks source link

Pimoroni STT7789V display stays black #277

Open jackcarey opened 2 years ago

jackcarey commented 2 years ago

Hardware

The display works with Pimoroni's examples, but I'm unsure if the V variant of the driver chip will make a difference for this drivers support.

Software

Using Raspberry Pi OS with Desktop Release date: April 4th 2022 System: 64-bit Kernel version: 5.15 Debian version: 11 (bullseye)

Following the steps in the readme, I ran:

sudo apt-get install cmake
cd ~
git clone https://github.com/juj/fbcp-ili9341.git
cd fbcp-ili9341
mkdir build
cd build
cmake -DST7789VW=ON -DGPIO_TFT_DATA_CONTROL=9 -DSPI_BUS_CLOCK_DIVISOR=6 -DSINGLE_CORE_BOARD=ON -DDISPLAY_BREAK_ASPECT_RATIO_WHEN_SCALING=ON ..
make -j

My /boot/config.txt file looks like this:

# 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 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
hdmi_group=2
hdmi_mode=87
hdmi_cvt=240 240 60 1 0 0 0

# 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

# Automatically load overlays for detected cameras
camera_auto_detect=1

# Automatically load overlays for detected DSI displays
display_auto_detect=1

# Enable DRM VC4 V3D driver - disabled per https://github.com/juj/fbcp-ili9341/issues/100
# dtoverlay=vc4-kms-v3d
max_framebuffers=2

# Disable compensation for displays with overscan
disable_overscan=1

[cm4]
# Enable host mode on the 2711 built-in XHCI USB controller.
# This line should be removed if the legacy DWC2 controller is required
# (e.g. for USB device mode) or if USB support is not required.
otg_mode=1

[all]

[pi4]
# Run as fast as firmware / board allows
arm_boost=1

[all]

When I then run sudo ./fbcp-ili9341, the last console line is "All initialized, now running main loop" but the screen stays black.

The same happens when I run the cmake step, replacing -DST7789VW=ON with -DST7789=ON.

jam-eth commented 2 years ago

unless you're using 2 SPI devices I don't think hooking up CS to GPIO7 will work, that's the pin that goes low to tell a "second" SPI device to start listening out for SPI data, because GPIO7 is Chip Select 1.

GPIO8 is Chip Select 0 (the "first" in binary)

again, if you're doing clever-er stuff with SPI than I am, this could be moot, but I connect my SPI displays to GPIO8.

I think GPIO9 is also a bad call for DC as GPIO9 is the SPIO MISO pin, even though it's not used by fcbp it is still "doing SPI stuff" with SPI enabled. (make sure SPI is enabled in raspi-config that's caught me out more than once)

I hook up DC to GPIO24 and I also include -DGPIO_TFT_RESET_PIN=number in my cmake config, I connect the reset pin on the display to GPIO25

I hope that helps, good news is I'm pretty sure its just mis-wired at this point :) It took me finding this driver on like, 4 different projects before I got it working the first time.