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.54k stars 1.02k forks source link

ESP32 Core 1 panic'ed (StoreProhibited). Exception was unhandled when tft.init() is executed. #3332

Open taylorjwnc20 opened 1 month ago

taylorjwnc20 commented 1 month ago

The issue that I am encountering is that a "Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled." just prior to executing the tft.init() function. This issue appears to be only graphics bases since I can execute this sketch with only Serial.println("..."); calls. I can use the Adafruit_GFX.h with the Adafruit_ST7789.h driver to do a test on a GFX application.

During an update something changed and I am at a loss to determine the root cause. Wiring is correct ( I have checked it many times).

  1. IDE - Arduino version 2.3.2 CLI version 0.35.3
  2. TFT_eSPI - version 2.5.43
  3. Board Version - esp32 version 3.0.0.rc3 (I have regressed it back to ESP version 2.0.16 with no change in functionality, still reboots).
  4. PROCESSOR - ESP32-S3
  5. TFT Driver - ST7789 (TFT_eSPI sourced)
  6. TFT Interface - SPI

See the following attached files for additional information you require:

User_Setup.zip

Sketch: WIFI_Channel_List.zip

TFT ; ST7789 IC 1.9 Inch ips Full View TFT Display LCD Color Module SPI Serial Port HD 170x320 MSP430 and C51 Programs I have only one of these displays....

1_9inch ST7789 TFT

DEBUG Output: Debug Output.zip

Plus further information as appropriate to the problem:

  1. TFT to processor connections used
  2. A zip file containing your setup file (just drag and drop in message window - do not paste in long files!)
  3. A zip file containing a simple and complete example sketch that demonstrates the problem but needs no special hardware sensors or libraries.
  4. Screen shot pictures showing the setup

TFT_eSPI Setup

Thanks, John Taylor I can be reached at taylorjw.nc@att.net

taylorjwnc20 commented 1 month ago

Corrected Debug Output in zip file. (elements dropped during the copy)

Regressed to 2.0.16

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


Hello! ESP32-S3-WROOM SPI PINS

MOSI: 11 MISO: 13 SCK: 12 SS: 10


Start Channel Scanning

Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled.

Core 1 register dump: PC : 0x42003e9d PS : 0x00060830 A0 : 0x82003f6c A1 : 0x3fcebda0
A2 : 0x00000010 A3 : 0x00000000 A4 : 0x60004000 A5 : 0x0000000b
A6 : 0x000000ff A7 : 0x00000000 A8 : 0x08000000 A9 : 0x3fcebd70
A10 : 0x3fc996ac A11 : 0x00000001 A12 : 0xffffffff A13 : 0x00000040
A14 : 0x00000000 A15 : 0x3fc940c4 SAR : 0x00000010 EXCCAUSE: 0x0000001d
EXCVADDR: 0x00000010 LBEG : 0x420083f0 LEND : 0x42008453 LCOUNT : 0x00000000

Backtrace: 0x42003e9a:0x3fcebda0 0x42003f69:0x3fcebdd0 0x42002b98:0x3fcebdf0 0x420091ca:0x3fcebe20

APF-MRoger commented 1 month ago

Having a similar issue on a completely different hardware setup (Waveshare round LCD with integrated ESP32S3). Using platformio, this happened once the platform 6.7.0 was updated for espressif32. For now to workaround I am locking the platform version to 6.6.0 in my platformio.ini using "platform = espressif32@6.6.0"

elgerg commented 1 month ago

Looks like this is a duplicate of: https://github.com/Bodmer/TFT_eSPI/issues/3329 ?

APF-MRoger commented 1 month ago

@elgerg Yup, I would tend to agree...

taylorjwnc commented 1 month ago

Yes, I agree with the assessment.... I did not read far enough.... my oversight!

ats3788 commented 1 month ago

I have the same Issue with ESP32-S3 and the ILI9341 Rebooting... ␀�ESP-ROM:esp32s3-20210327 Build:Mar 27 2021 rst:0xc (RTC_SW_CPU_RST),boot:0xa (SPI_FAST_FLASH_BOOT) Saved PC:0x4202934a SPIWP:0xee mode:DIO, clock div:1 load:0x3fce3808,len:0x4bc load:0x403c9700,len:0xbd8 load:0x403cc700,len:0x2a0c entry 0x403c98d0 [ 112][V][esp32-hal-uart.c:330] uartBegin(): UART0 baud(115200) Mode(800001c) rxPin(44) txPin(43) [ 121][V][esp32-hal-uart.c:416] uartBegin(): UART0 not installed. Starting installation [ 129][V][esp32-hal-uart.c:463] uartBegin(): UART0 initialization done. Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled.

Core 1 register dump: PC : 0x42002c3f PS : 0x00060830 A0 : 0x82002d14 A1 : 0x3fcebbd0
A2 : 0x00000010 A3 : 0x00000000 A4 : 0x60004000 A5 : 0x00000023 A6 : 0x000000ff A7 : 0x00000000 A8 : 0x08000000 A9 : 0x3fcebba0 A10 : 0x3fc9732c A11 : 0x00000001 A12 : 0xffffffff A13 : 0x00000040
A14 : 0x00000000 A15 : 0x3fc93748 SAR : 0x00000010 EXCCAUSE: 0x0000001d EXCVADDR: 0x00000010 LBEG : 0x42018dd4 LEND : 0x42018e38 LCOUNT : 0x00000002

Backtrace: 0x42002c3c:0x3fcebbd0 0x42002d11:0x3fcebc00 0x42001ace:0x3fcebc20 0x4200635a:0x3fcebc50

ELF file SHA256: 9ad77e336525fede

Rebooting... ␀�ESP-ROM:esp32s3-20210327 Build:Mar 27 2021 rst:0xc (RTC_SW_CPU_RST),boot:0xa (SPI_FAST_FLASH_BOOT) Saved PC:0x4202934a SPIWP:0xee

taylorjwnc20 commented 1 month ago

I have since regressed my versions to TFT_eSPI to 2.5.0 an ESP32 to 2.015 and everything is working well. My projects are working as expected . This is true for my ESP32-S3 and ESP32-C3 designs. My ESP32-S3 code test configuration, shown below, now displays the information very nicely. At this point in time, I am ok with the current versions, but still want to work with the current releases.

image

ats3788 commented 1 month ago

with this platformIO [env:esp32-s3-devkitc-1] platform = espressif32 @ 6.5.0 board = esp32-s3-devkitc-1

; change microcontroller board_build.mcu = esp32s3

framework = arduino monitor_speed = 115200 monitor_port = COM10 upload_port = COM10 build_flags = -DCORE_DEBUG_LEVEL=5

lib_deps = Wire https://github.com/Bodmer/TFT_eSPI.git bitbank2/PNGdec@^1.0.2

it works now with the ESP32-S3

LiuGuoGY commented 1 month ago

I have the same problem .

image


    end_tft_write();
  } // end of: if just _booted

Serial.printf("!!!!here!!!\n");

  // Toggle RST low to reset
#ifdef TFT_RST
  #if !defined(RP2040_PIO_INTERFACE)
    // Set to output once again in case MISO is used for TFT_RST
    if (TFT_RST >= 0) {
      Serial.printf("!!!!5555here!!!\n");
      pinMode(TFT_RST, OUTPUT);
    }
  #endif
  if (TFT_RST >= 0) {
    Serial.printf("!!!!6666here!!!\n");
    writecommand(0x00); // Put SPI bus in known state for TFT with CS tied low
    Serial.printf("!!!!7777here!!!\n");
    digitalWrite(TFT_RST, HIGH);
    Serial.printf("!!!!8888here!!!\n");
    delay(5);
    digitalWrite(TFT_RST, LOW);
    delay(20);
    digitalWrite(TFT_RST, HIGH);
  }
  else writecommand(TFT_SWRST); // Software reset
#else
  writecommand(TFT_SWRST); // Software reset
#endif

log is bellows:

lv init over

!!!!here!!!
!!!!5555here!!!
!!!!6666here!!!
Guru Meditation Error: Core  0 panic'ed (Store access fault). Exception was unhandled.

Core  0 register dump:
MEPC    : 0x4200ddce  RA      : 0x4200ddbe  SP      : 0x3fcae920  GP      : 0x3fc92400
TP      : 0x3fc7a558  T0      : 0x00000003  T1      : 0xffc3ffff  T2      : 0x00000020
S0/FP   : 0x60004000  S1      : 0x3fc9dac4  A0      : 0x00000001  A1      : 0xffffffff
A2      : 0x20000000  A3      : 0xfdffffff  A4      : 0x08000000  A5      : 0x00000010
A6      : 0xffffffff  A7      : 0x04c4b400  S2      : 0x00000000  S3      : 0x3fcae978
S4      : 0x3fcae96c  S5      : 0x3fca453a  S6      : 0x3c14c000  S7      : 0x00000000  
S8      : 0x00000000  S9      : 0x00000000  S10     : 0x00000000  S11     : 0x00000000
T3      : 0x0196e6aa  T4      : 0x0000000f  T5      : 0x003c0000  T6      : 0x00000003
MSTATUS : 0x00001881  MTVEC   : 0x40380001  MCAUSE  : 0x00000007  MTVAL   : 0x00000010
MHARTID : 0x00000000

Stack memory:
3fcae920: 0x3fca4000 0x3fca4000 0x019bfcc0 0xfc000301 0x00000001 0x3fc9f000 0x3fc9dac4 0x4200e320
3fcae940: 0x00332220 0x3a227668 0x0000000d 0x4204fa0a 0x3fca4000 0x3fc9e000 0x3fc9f000 0x42003b44
3fcae960: 0x00000000 0x00000000 0x00000000 0x41444345 0x39434233 0x43354637 0x00000000 0x00000000
3fcae980: 0x00000000 0x00000000 0x03004000 0xfbcacc51 0x00000000 0x00000000 0x00000000 0x00000000
3fcae9a0: 0x00000000 0x3fca4000 0x4204f000 0x42053c40 0x00000000 0x00000000 0x00000000 0x4038d966
3fcae9c0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5
3fcae9e0: 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xa5a5a5a5 0xbaad5678 0x00000160 0xabba1234 0x00000154
3fcaea00: 0x3fcae8d0 0x892c9f6b 0x3fca09bc 0x3fca09bc 0x3fcaea00 0x3fca09b4 0x00000018 0xdb8fc590
3fcaea20: 0x0a6e05b9 0x3fcaea00 0x00000000 0x00000001 0x3fcac9f0 0x706f6f6c 0x6b736154 0x0e8b7900
3fcaea40: 0x00fb7f40 0x00000000 0x3fcae9e0 0x00000001 0x00000002 0x00000000 0x00000000 0x00000000
3fcaea60: 0x3fca62c4 0x3fca632c 0x3fca6394 0x00000000 0x00000000 0x00000001 0x00000000 0x00000000
3fcaea80: 0x3fcafb20 0x420fc1ee 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcaeaa0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcaeac0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcaeae0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcaeb00: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcaeb20: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcaeb40: 0x00000000 0x00000000 0x00000000 0x00000000 0x0e000000 0xbaad5678 0x00000060 0xabba1234
3fcaeb60: 0x00000054 0x00000000 0x3fcaeb64 0x00000000 0x00000000 0x00000000 0x3fcaeb7c 0xffffffff
3fcaeb80: 0x3fcaeb7c 0x3fcaeb7c 0x00000000 0x3fcaeb90 0xffffffff 0x3fcaeb90 0x3fcaeb90 0x00000001
3fcaeba0: 0x00000001 0x00000000 0x5e00ffff 0x00000000 0xb33fffff 0x00000000 0xbaad5678 0x00000100
3fcaebc0: 0xabba1234 0x000000f4 0x00000000 0x00000014 0x3fcaf258 0x00000000 0x00000000 0x00000000
3fcaebe0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcaec00: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcaec20: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcaec40: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcaec60: 0x00000000 0x00000000 0x00000101 0x00000000 0x00000000 0x0000000a 0x3fcaf220 0x00000000
3fcaec80: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x3fcaeccc
3fcaeca0: 0x3fcaee20 0x00000000 0x3fcaf090 0x3fcaf02c 0x3fcaf1bc 0x3fcaf158 0x3fcaf0f4 0xbaad5678
3fcaecc0: 0x00000150 0xabba1234 0x00000144 0x3fcaed20 0x3fcaed20 0x3fcaee10 0x3fcaee04 0x00000000
3fcaece0: 0x3fcaece4 0xffffffff 0x3fcaece4 0x3fcaece4 0x00000000 0x3fcaecf8 0xffffffff 0x3fcaecf8
3fcaed00: 0x3fcaecf8 0x00000000 0x00000014 0x0000000c 0xdd00ffff 0x00000000 0xb33fffff 0x00000000

ELF file SHA256: d4ac4283e18a9e36

E (493) esp_core_dump_flash: Core dump flash config is corrupted! CRC=0x7bd5c66f instead of 0x0
Rebooting...

platform.ini as bellows:

build_flags =
    -Wall
    -Os

    -D FIRMWARE_VER=${common.firmware_version}
    -D LV_LVGL_H_INCLUDE_SIMPLE
    '-D LV_CONF_PATH=${PROJECT_DIR}/lib/lvgl_conf/lv_conf.h'

    ; TFT_eSPI
    -D USER_SETUP_LOADED
    -D DISABLE_ALL_LIBRARY_WARNINGS
    -D ST7789_2_DRIVER
    -D TFT_RGB_ORDER=TFT_RGB
    -D TFT_WIDTH=240
    -D TFT_HEIGHT=240
    -D TFT_MOSI=7
    -D TFT_SCLK=6
    -D TFT_CS=10
    -D TFT_DC=3
    -D TFT_RST=4
    -D TFT_BL=1
    -D SPI_FREQUENCY=27000000
    -D SPI_READ_FREQUENCY=20000000
    -D SPI_TOUCH_FREQUENCY=2500000
ChrisZang0815 commented 1 month ago

same problem here. I'm using a Seeduino XIAO ESP32-C3 (but basically the same happens on a XIAO ESP32S3) I am using version 2.5.43 of TFT_eSPI and am on version 3.0.0 for esp32

Here's my sketch:

include

include

TFT_eSPI tft = TFT_eSPI();

void setup() { Serial.begin(115200); Serial.println(" Program: " FILE " \n compiled on: " DATE " at: " TIME );

SPI.begin();

tft.begin(); //tft.setRotation(2); //tft.fillScreen(TFT_BLACK); //tft.setTextColor(TFT_BLACK);
}

void loop() { Serial.println ("loop: "+String(millis())); delay (1000); }

as soon as I uncomment the line tft.begin(); I get:

Program: C:\Users\chris\Dropbox\Arduino\Arduino Project Code\CAN\SportChrono FOLDER\XIAO_TFT\XIAO_TFT.ino compiled on: May 29 2024 at: 08:59:54 Guru Meditation Error: Core 0 panic'ed (Store access fault). Exception was unhandled.

Core 0 register dump: MEPC : 0x42001bbc RA : 0x42001bac SP : 0x3fc94740 GP : 0x3fc8be00
TP : 0x3fc85628 T0 : 0x00051616 T1 : 0xffc3ffff T2 : 0x2a0a206f
S0/FP : 0x60004000 S1 : 0x3fc8c860 A0 : 0x00000000 A1 : 0x00002001
A2 : 0x00000000 A3 : 0x00000001 A4 : 0x08000000 A5 : 0x00000010
A6 : 0x00000002 A7 : 0x00000020 S2 : 0x00000001 S3 : 0x00000000
S4 : 0x00000000 S5 : 0x00000000 S6 : 0x00000000 S7 : 0x00000000
S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x01927358 T4 : 0x0196e6aa T5 : 0x00000041 T6 : 0x0000000f
MSTATUS : 0x00001881 MTVEC : 0x40380001 MCAUSE : 0x00000007 MTVAL : 0x00000010
MHARTID : 0x00000000

ChrisZang0815 commented 1 month ago

OK, quick update: I first downgraded my versions to TFT_eSPI to 2.5.0 and ESP32 to 2.015 AFter that it worked on XIAO ESP32S3 but on XIAO ESP32C3 I still have the crash Then I upgraded TFT_eSPI back to 2.5.43 and it still works on the ESP32S3. So that seems to indicate that the problem lies with esp32 and not with TFT_eSPI. However I would think that Bodmer has way more pull with the powers to be that write esp32 than we, so I hope that he can do some "magic" there.

ChrisZang0815 commented 1 month ago

one more update: It also works with esp 2.0.17 (which is the final version of 2.0.x) meaning they broke it between 2.0.17 and 3.0.0

ChrisZang0815 commented 1 month ago

final (?) update: "last known good" version for esp32:

SergePD commented 4 weeks ago

For me, last working core is: 2.0.14

Jptasznik commented 4 weeks ago

I have spent days trying to get to this point where init doesn't crash. Based on above comment I may try with 2.0.17 board version to see if it works, but I thought I tested it and failed.

ESP core version 2.0.14 is working for me with TFT_eSPI 2.5.43. ESP core versions 3.0.1, 3.0.0 - Crash, sadly I spent 2 days upgrading my solution to 3.X and then ran into this issue. ESP32 S3 16MB Flash. 8 MB PSRAM

Setup file: // Setup for the ESP32 S3 with ILI9341 display // Note SPI DMA with ESP32 S3 is not currently supported

define USER_SETUP_ID 70

// See SetupX_Template.h for all options available

define ILI9341_DRIVER

                // Typical board default pins - change to match your board

define TFT_CS 10 // Orange 10 or 34 (FSPI CS0)

define TFT_MOSI 11 // Blue 11 or 35 (FSPI D)

define TFT_SCLK 12 // Purple 12 or 36 (FSPI CLK)

define TFT_MISO 13 // White 13 or 37 (FSPI Q)

// Use pins in range 0-31

define TFT_DC 7 // Green

define TFT_RST 6 // Yellow

//#define TOUCH_CS 16 // Optional for touch screen

define LOAD_GLCD

define LOAD_FONT2

define LOAD_FONT4

define LOAD_FONT6

define LOAD_FONT7

define LOAD_FONT8

define LOAD_GFXFF

define SMOOTH_FONT

// FSPI (or VSPI) port (SPI2) used unless following defined. HSPI port is (SPI3) on S3. // #define USE_HSPI_PORT

//#define SPI_FREQUENCY 27000000

define SPI_FREQUENCY 40000000 // Maximum for ILI9341

define SPI_READ_FREQUENCY 6000000 // 6 MHz is the maximum SPI read speed for the ST7789V

Sofronio commented 2 weeks ago

2.0.14 works for me. Thanks

mulcmu commented 1 week ago

After much trial and error, I was able to avoid the panic reboot from tft.init() with addition of #define USE_HSPI_PORT in user setup. This was with a custom board

//Configuration for tft_espi user_setup.h
// #define ST7789_DRIVER  
// #define TFT_RGB_ORDER TFT_BGR
// #define TFT_WIDTH  240
// #define TFT_HEIGHT 320 
// #define TFT_MOSI            10
// #define TFT_SCLK            11
// #define TFT_CS              12
// #define TFT_DC              13
// #define TFT_RST             9
// #define TFT_INVERSION_ON

// #define USE_HSPI_PORT

I don't know how or why...I'm pretty sure I reverted all the other hacks that were tested in TFT_eSPI_ESP32_S3.h

ChrisZang0815 commented 1 week ago

I just tried with esp32 3.0.2. Result ESP32-S3: works, no longer getting panic ESP32-C3: still the same problem