ESP32-S3 keeps rebooting when initializing ST7796 with TFT_eSPI

Hello, I’m having an issue with my ESP32-S3 and an ST7796 SPI display using TFT_eSPI v2.5.43. When I call tft.init();, the board enters a continuous reboot loop and the serial monitor stops responding. I’m using the following User_Setup.h:

#define TFT_MOSI 11
#define TFT_SCLK 12  
#define TFT_CS   10
#define TFT_DC    9
#define TFT_RST  14
#define TFT_MISO 13

#define TFT_BL   15
#define TFT_BACKLIGHT_ON HIGH


#define USER_SETUP_ID 52
#define ST7796_DRIVER
#define ESP32_DMA


#define LOAD_GLCD   // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2  // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4  // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6  // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7  // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-.
#define LOAD_FONT8  // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
//#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
#define LOAD_GFXFF  // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts

#define SMOOTH_FONT

#define SPI_FREQUENCY 16000000
#define SPI_READ_FREQUENCY  12000000

I have tried changing SPI pins, reducing SPI frequency, and commenting out ESP32_DMA, but the problem persists. Any help or minimal working sketch would be appreciated.

There are so many issues about TFT_eSPI with ESP32.

The following information is available regarding the ST7796:

So possible solutions reported include:

  • Use version 2.0.14 of ESP32 platform package by Espressif Systems
  • #define USE_FSPI_PORT or USE_HSPI_PORT in User_Setup.h for ESP32S3
3 Likes

I bought me a new ESP32-S3 N16R8 board and getting no place with it on TFT_eSPI
Tried:
changing over to HSPI (GPIO 11-GPIO 13-GPIO 12-GPIO 10 you know the drill)
My LCD is ST7796U display driver but non -S3 boards worked with ILI9488,

Getting reboots and crash errors. I could bore you all with code samples but there are enough of them out there.
My question is there really a good solid solution for the “core 1 panic'ed storeprohibited exception was unhandled“??
thanks for the help

See post #2 ?

In my experience, this error seems to occur when an invalid address is accessed. If you're using IDE 2.x, you can use the following tool to identify the error:

Lately, I've been using online tool:

However, if the error is caused by the TFT_eSPI rather than your program, debugging could be difficult.

Switching to HSPI seems to be effective if you properly distribute multiple devices (e.g. LCD, Touch, SD) across the SPI buses.

If you've tried ESP32 Espressif 2.0.14 and it doesn't work, I'm sorry I can't help you.

Thank you for the assist I have reverted to 2.0.14 and no longer getting the looping error crash.
Still not working. using the read_user_setup to check my settings

in user setup I have defined
#define TFT_MISO 13
#define TFT_MOSI 11
#define TFT_SCLK 12
#define TFT_CS 10 // Chip select control pin
#define TFT_DC 6 // Data Command control pin
#define TFT_RST 7 //

however the ino read_user_setup the reported values are
TFT_eSPI ver = 2.5.43
Processor = ESP32
Frequency = 240MHz
Transactions = Yes
Interface = SPI
Display driver = 9341
Display width = 240
Display height = 320

MOSI = GPIO 13
MISO = GPIO 12
SCK = GPIO 14
TFT_CS = GPIO 15
TFT_DC = GPIO 0
TFT_RST = GPIO 2
Font GLCD loaded
Font 2 loaded
Font 4 loaded
Font 6 loaded
Font 7 loaded
Font 8 loaded
Smooth font enabled
Display SPI frequency = 27.00

so what TFT_eSPI thinks I have is not what I truly have.
thoughts??

TFT_eSPI works as you configured and not as you thought it would.

Those are the values ​​set by the default User_Setup.h, not the ones in your User_Setup.h.

Including TFT_eSPI.h in your sketch includes User_Setup_Select.h :

Then User_Setup_Select.h includes User_Serup.h.

If there is no User_Setup.h in your sketch folder, the compiler will load User_Setup.h in the TFT_eSPI library folder :

As a result, the following values ​​are set :

The values of PIN_XX are defined at the end of User_Setup_Select.h:

So I'd ask you where do you place your User_Setup.h? or how do you define such as TFT_MISO ?

Thanks for the reply mate… I located one major issue. Somehow (PEBKAC error) TFT_eSPI was installed to a different directory. Now corrected and reporting the proper pins.. Now the task of locating the proper user_setup to actually have something appear on the screen for my ST7796U display, BTW there is a new Library TFT_eSPI_ES32Lab. Looks to be optimized of esp23.

It is optimized for ESP32Lab:

I think you should research it to see if it suits your needs.

https://docs.arduino.cc/libraries/es32lab/

it now is running!!! Pulled out all the jumper wires and triple checked everything.

Congratulations.

Just making a note for others.

As mentioned in post #8, one possible cause is an incorrect installation of TFT_eSPI.

Running Read_User_Setup in Test and diagnostics to check the actual settings may provide a clue to the solution.