Problems with esp32s3 sense with spi st7789 display

I can’t get my Kedei 2 inch LCD spi display to work with my esp32s3 sense. The display works great with my xiao esp32c3. Using the same pin out and sketch, I get nothing on the s3. I’m using the Bodmer’s tft_espi library from git hub for this project. I posted this same question on their discussion page with no responses. I’m hoping for some help here. My test code is below; It’s pretty simple. I’m just setting the color on the display.

The defines at the end are for the pins that I’m using on the two boards and defined in the tft_espi setup file. On the c3, I get the red screen that I’m asking for and any other library command I send. On the s3, I just get a black sreen for any command. The tft_espi library does support the s3 but everything I’ve found refers to the dev boards. The spi pins are the same for c3 and s3 and the others should be a general I/O (???). I’m kind of stuck on this one so if anyone has any ideas, I would appreciate the help.

#include <SPI.h>
#include <TFT_eSPI.h> // Hardware-specific library
TFT_eSPI tft = TFT_eSPI(); // Invoke custom library

void setup()

void loop() {
// do nothing

//#define TFT_MISO -1
//#define TFT_MOSI D10
//#define TFT_SCLK D8
//#define TFT_CS D7 // Chip select control pin
//#define TFT_DC D3 // Data Command control pin
//#define TFT_RST D4 // Reset pin (could connect to RST pin)

@bamoore01 any chance you found a fix? I am having the same experience.

I wish I could tell you that I have figured it out. But… Nope. I’m still in the same spot. I’m hoping someone that has worked through this will eventually chime in.

Solved. I posted on Bodmer’s Github discussion page. Instead of reposting all of the info here, go to;

Hi,great!btw,We have published a contrbutor wanted program, you can change the wiki contents, accept some assignments or share your thoughts with us. We will offer a range of rewards to our contributors.

Looks like you had to change your cs connection? I switched from 7 to 1 as well but still having the same problem :frowning:

Did you try copying my sketch and running that with the connections I was using? That is the only thing I can think of off hand to try.

#include <SPI.h>
#include <TFT_eSPI.h> // Hardware-specific library

#define ST7789_2_DRIVER
#define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue

#define TFT_MISO -1
#define TFT_MOSI D10
#define TFT_SCLK D8
#define TFT_CS D1 // Chip select control pin. Did not work on D7
#define TFT_DC D3 // Data Command control pin
#define TFT_RST D4 // Reset pin
#define TFT_BL D6

//#define SPI_FREQUENCY 27000000 // It worked at 40000000 but I left this in incase something goes wrong
#define SPI_FREQUENCY 40000000

#define TFT_WIDTH 320
#define TFT_HEIGHT 240

TFT_eSPI tft = TFT_eSPI(); // Invoke custom library

void setup() {
tft.setTextColor(TFT_WHITE, TFT_BLACK);
tft.println("Hello “+String(TFT_WIDTH)+” "+String(TFT_HEIGHT));

void loop() {
// do nothing

Honestly I think I have the same set up as you. I have tried with two different xia esp32s3 but my LCD Module just remains with the backlight on.

Not sure what to tell you at this point. I would just have the usual basic questions;

Are you sure your hardware is good. Does the simple blink program work on the S3? Have you been able to get the LCD working with any other controller?

What boar are you calling out in the IDE? I have “XIAO_ESP32S3”.

Have you tried the 270000000 SPI_FREQUENCY.

Thats all that I can think of off hand. It would be nice it you had it working. I’m really curious if you end up with the same limitation problem I have at the next step.

The blink example works on both S3s, and I have used them for addressable LEDs. This is my first LCD project. I can get the LCD module to work with my UNO with no problem.

Board is “XIAO_ESP32S3” as well.

tried the other Frequency too.

Just feels like it should work lol.

I wish I could be of more help. It works well on my c3 also with zero problems. I did get a response on my other post from seeed on the problems I’m having filling up the entire screen. They just said that they tested the s3/7789 combination and it works fine? Not much information there but I asked for more. We’ll see how they respond.

I am checking versions installed:
Board Manager:
esp32 by Espressif Systems v.2.0.11
Library Manager:
TFT_eSPI by Bodmer v.2.5.0

any chance you could compare if I am missing something from your installs?

I have the same versions on my computer(s). I’ve tried a few things since last posted.

I loaded a new computer with the ide and the tft_espi libraries. With all the same settings I got no display at all. After I tried the new install, I copied over the Arduino directory from the first computer that kind of works and replaced the Arduino directory on the new computer. With that setup, I still got no display and couldn’t get it to work. While I was changing things on both computers trying to understand what the difference was, the first computer quit working also and I can’t figure out what changed. That is where I gave up for now and figured that the tft_espi lib is not so great with the Seeed XIAO s3 board if you can’t use the esp32s3 spi pins.

From there, I went to the Adafruit wiki and tried their setup and …badabingbadaboom…, it works fine. It works fine as long as you use the Adafruit GFX library. I tried a thing using the Adafruit ST7789 driver with the tft_espi libraries wishing that they would somehow work together. No luck. I got the screen to light up but only the 240x240 pixel area would work just like when I got the tft_espi drivers to kinda work before.

The only real reason I’m chasing the tft_espi library is that I like the way that it handles sprites and transparency. It looks like the Adafruit GFX libraries have addons that will do that, so that is probably what I’m going to do from this point. I also ordered an Adafruit s3 board that has the actual SPI pins available to play with…

Although having issues with the ESP32-S3 with a ST7789 display that is connected via SPI can be aggravating, many problems can be fixed with patient investigation. Here are some typical issues and potential fixes:

  1. No Output on the Display:

Check the connections between the ESP32-S3 and the ST7789 display if you’re not receiving any display output. Make sure the SPI pins, such as MOSI, MISO, and SCLK, are connected properly.
2. Improper Wiring

Check the accuracy of the wiring going from the ESP32-S3 to the ST7789. Verify that the pin assignments in your code correspond to the connections you have made physically.
3. Power Concerns

Check to see if the voltage and current being delivered to the ST7789 display are appropriate. Some displays need a certain amount of electricity to function properly. Verify your connections and power source.

That is good advice Hasan. But I think if you look back at the posts you will see that this has been addressed. Without changes to the wiring connections or the sketch, the LCD worked with both the esp32-c3 using the tft-espi libraries and with s3 using the Adafruit GFX libraries.

I finally figured out where I was messing up. Duhh. The problem was simply that I was using the Pin numbers of the board. If I use the GPIO numbers for those pins it works great. What led me down the right track was I got a UM Tiny S3 board that doesn’t label pins as a pin number, but uses the GPIO numbers on the board. What threw me was that using the pin numbers works on the XIAO C3 board. The reason is that the pin number and the GPIO number are the same for that board.