Bodmer / TFT_eSPI

Arduino and PlatformIO IDE compatible TFT library optimised for the Raspberry Pi Pico (RP2040), STM32, ESP8266 and ESP32 that supports different driver chips
Other
3.8k stars 1.09k forks source link

Guru Meditation Error on tft.begin() (ESP32-S3 dev module) #3289

Open HSBallina opened 7 months ago

HSBallina commented 7 months ago

I'm having issues with my ESP32-S3 module crashing and rebooting on tft.begin() (or on tft.init()). The following output repeats over and over in the monitor:

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x2b (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x4bc
load:0x403c9700,len:0xbd8
load:0x403cc700,len:0x2a0c
entry 0x403c98d0
E (99) esp_core_dump_flash: Core dump data check failed:
Calculated checksum='db82bb1c'
Image checksum='ffffffff'
Guru Meditation Error: Core  1 panic'ed (StoreProhibited). Exception was unhandled.

Core  1 register dump:
PC      : 0x4200289b  PS      : 0x00060a30  A0      : 0x82002928  A1      : 0x3fcebd80  
A2      : 0x00000010  A3      : 0x00000000  A4      : 0x60004000  A5      : 0x00000015  
A6      : 0x000000ff  A7      : 0x00000001  A8      : 0x08000000  A9      : 0x3fcebd50  
A10     : 0x3fc952b0  A11     : 0x00000001  A12     : 0xffffffff  A13     : 0x00000010  
A14     : 0x00000000  A15     : 0x3fc91d98  SAR     : 0x00000010  EXCCAUSE: 0x0000001d  
EXCVADDR: 0x00000010  LBEG    : 0x42004dec  LEND    : 0x42004e4f  LCOUNT  : 0x00000003  

Backtrace: 0x42002898:0x3fcebd80 0x42002925:0x3fcebdb0 0x42002930:0x3fcebdd0 0x4200184d:0x3fcebdf0 0x420058da:0x3fcebe20

Using the EspExceptionDecoder to decode the dump (only works in Arduino 1.8.19) with the ELF file from the build gives this:

PC: 0x4200289b: TFT_eSPI::writecommand(unsigned char) at C:\Users\stompp\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp line 81
EXCVADDR: 0x00000010

Decoding stack results
0x42002898: TFT_eSPI::writecommand(unsigned char) at C:\Users\stompp\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp line 81
0x42002925: TFT_eSPI::init(unsigned char) at C:\Users\stompp\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp line 692
0x42002930: TFT_eSPI::begin(unsigned char) at C:\Users\stompp\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp line 603
0x4200184d: setup() at C:\DEV\ESP32\minimal_tft/minimal_tft.ino line 7
0x420058da: loopTask(void*) at C:\Users\stompp\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.15\cores\esp32\main.cpp line 42

I've minimized the code to the following:

#include <SPI.h>
#include <TFT_eSPI.h>

TFT_eSPI tft = TFT_eSPI();
void setup() {
  Serial.begin(115200);
  tft.begin();
}

void loop() {
}

My setup is the following: IDE: Arduino 1.8.19 & 2.3.2 TFT_eSPI version: 2.5.43 Board package version: 2.0.15 Processor: ESP32-S3 TFT driver: GC9A01 Interface: SPI

The setup file is a copy of 46 with a different MOSI pin. It's added to the User_Setup_Select.h file and the User_Setup.h is set to use the GC9A01 driver.

dbtronics commented 6 months ago

Please refer to this link: https://github.com/Bodmer/TFT_eSPI/issues/3304#issuecomment-2095080442

Revert your ESP32 board package to 2.0.14 will solve this issue.

AlexBestoso commented 2 weeks ago

Edit: The issue is likely misconfiguration of your SPI pins.

I was able to get my ESP32-S3 to work (Specifically the Lillygo T-deck) by using these pin configurations in my User_Setup.h file.

The StoreProhibited is resulting from your spi driver trying to access an invalid pin, thus invalid memory.

#define TFT_MISO 38
#define TFT_MOSI 41
#define TFT_SCLK 40
#define TFT_CS   12 // Not connected
#define TFT_DC   11
#define TFT_RST  -1  //

Please refer to this link: #3304 (comment)

Revert your ESP32 board package to 2.0.14 will solve this issue.

Downgrading to potentially vulnerable software is not a solution.