ESP32-S3 Arduino_GFX_Library reboot automatically

maggymtac
Posts: 43
Joined: Wed Aug 04, 2021 7:47 am

ESP32-S3 Arduino_GFX_Library reboot automatically

Postby maggymtac » Sat Apr 05, 2025 8:09 pm

Dear,

i have this code with my ESP32-S3 with esp32 lib 3.2.0 and library from: https://github.com/profi-max/JC4827W543 ... 32S3_board :

Code: Select all

#include <U8g2lib.h>
#include <Arduino_GFX_Library.h>

/* OPTION 1: Uncomment a dev device in Arduino_GFX_dev_device.h */
#include "Arduino_GFX_dev_device.h"

#include <SD.h>
#include <FS.h>
#include <SPI.h>
#include <ArduinoJson.h>
#include <WiFi.h>
#include "time.h"

int nbFails=0;
const char* ssid     = "test";
const char* password = "test";
bool isWifiConnected=false;


void setup()
{
  Serial.begin(115200);
  Serial.setDebugOutput(false);
  
  TaskHandle_t Task_Second;
  TaskHandle_t Task_Main;
xTaskCreatePinnedToCore(
                    Task1code,   /* Task function. */
                    "Task_Main",     /* name of task. */
                    10000,       /* Stack size of task */
                    NULL,        /* parameter of the task */
                    5,           /* priority of the task */
                    &Task_Main,      /* Task handle to keep track of created task */
                    0);          /* pin task to core 0 */                  
   
      delay(500);
      //create a task that will be executed in the Task2code() function, with priority 0 and executed on core 0
      xTaskCreatePinnedToCore(
                    Task2code,   /* Task function. */
                    "Task_Second",     /* name of task. */
                    10000,       /* Stack size of task */
                    NULL,        /* parameter of the task */
                    1,           /* priority of the task */
                    &Task_Second,      /* Task handle to keep track of created task */
                    1);          /* pin task to core 0 */
 
      delay(500);

}


void Task1code( void * pvParameters ){
  Serial.println("Task1 running on core "+xPortGetCoreID());

  for(;;){

    ManageWebAndDisplay();


 
  }  // for
}


void Task2code( void * pvParameters ){
 Serial.println("Task2 running on core "+xPortGetCoreID());

  for(;;){
    
  
      Manage();    
  }
}

void ManageWebAndDisplay(){
  Serial.println(F("ManageWebAndDisplay"));

  if (isWifiConnected == false){ 
    Serial.println(isWifiConnected);
    connectToAP();
  }
  
  int32_t usecFilledRoundRects=displayBlockHours();
  serialOut(F("Rounded rects (filled)\t"), usecFilledRoundRects, 100, true);
  delay(2000);
  
  }
  
  
  void Manage(){
  delay(1000);
  }
  
  bool connectToAP(){

// Connect to Wi-Fi
  Serial.print("Connecting to ");
  Serial.println(ssid);
  //WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);
  //delay(1000);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    nbFails++;
    Serial.print(".");
    if(nbFails>=20){
        nbFails=0;
        isWifiConnected=false;
        break;
    }
  }
  if (WiFi.status() == WL_CONNECTED){ 
    Serial.println("");
    Serial.println("WiFi connected.");
    isWifiConnected=true;
    return true;
  }else{
    // unconnected
    isWifiConnected=false;
    WiFi.disconnect(true);
    WiFi.mode(WIFI_OFF);
    return false;
  }


  //disconnect WiFi as it's no longer needed
  //WiFi.disconnect(true);
  //WiFi.mode(WIFI_OFF);

}
int32_t displayBlockHours()
{
  uint32_t start;
  uint16_t colorGreen=gfx->color565(1, 31 , 9);
start = micros_start();

  gfx->setCursor(0, 10);

  gfx->setTextSize(1);
  gfx->setTextColor(WHITE, BLACK);
  
  gfx->println(F("Title"));

return micros() - start;
}  

i get theses errors:

Code: Select all

Read from file: Guru Meditation Error: Core  0 panic'ed (StoreProhibited). Exception was unhandled.

Core  0 register dump:
PC      : 0x420aa3f8  PS      : 0x00060930  A0      : 0x82006cd0  A1      : 0x3fcb8730  
A2      : 0x3fca4944  A3      : 0x00000000  A4      : 0x0000000a  A5      : 0x00000000  
A6      : 0x3fcc6418  A7      : 0x420aa3cc  A8      : 0x00002580  A9      : 0x00000000  
A10     : 0x3fc9ca80  A11     : 0x00000050  A12     : 0x3fcb888c  A13     : 0xffffffff  
A14     : 0x00000005  A15     : 0x3fc9c920  SAR     : 0x00000004  EXCCAUSE: 0x0000001d  
EXCVADDR: 0x00002580  LBEG    : 0x400556d5  LEND    : 0x400556e5  LCOUNT  : 0xffffffff  


Backtrace: 0x420aa3f5:0x3fcb8730 0x42006ccd:0x3fcb8750 0x42006805:0x3fcb8790 0x420aa90f:0x3fcb87c0 0x420aa932:0x3fcb87e0 0x4200ecde:0x3fcb8800 0x42003a74:0x3fcb8820 0x4200429a:0x3fcb8850 0x42004360:0x3fcb88b0 0x4037ef42:0x3fcb88d0

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x28 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40377061
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce2820,len:0x118c
load:0x403c8700,len:0x4
load:0x403c8704,len:0xc20
load:0x403cb700,len:0x30e0
entry 0x403c88b8

Where is the problem please?

Thank you.

lbernstone
Posts: 1131
Joined: Mon Jul 22, 2019 3:20 pm

Re: ESP32-S3 Arduino_GFX_Library reboot automatically

Postby lbernstone » Sat Apr 05, 2025 8:46 pm

Some of the graphics libraries are known to have problems with esp32-s3 & v3.x of arduino-esp32. Roll back to v2.0.17 and see if it works. Otherwise, you will need to provide a decoded backtrace

maggymtac
Posts: 43
Joined: Wed Aug 04, 2021 7:47 am

Re: ESP32-S3 Arduino_GFX_Library reboot automatically

Postby maggymtac » Sun Apr 06, 2025 4:35 pm

I put folder on .arduino15/packages/arduino/tools/ this plugin is not available on Tools > ESP Exception Decoder.

Rollback on v2.0.17, i have many issues from Wifi connections with Task on Core 0 (manage wifi connections) and Core 1.

maggymtac
Posts: 43
Joined: Wed Aug 04, 2021 7:47 am

Re: ESP32-S3 Arduino_GFX_Library reboot automatically

Postby maggymtac » Mon Apr 07, 2025 8:03 am

I install this plugin: https://github.com/dankeboy36/esp-exception-decoder

Code: Select all

ESP Exception Decoder
Sketch: MyTest FQBN: esp32:esp32:esp32s3

A6      : 0x3fca9624  A7      : 0x420be8b0  A8      : 0x00002580  A9      : 0x00000000  
A10     : 0x3fc9cab0  A11     : 0x00000050  A12     : 0x3fcb938c  A13     : 0xffffffff  
A14     : 0x00000005  A15     : 0x3fc9c950  SAR     : 0x00000004  EXCCAUSE: 0x0000001d  
EXCVADDR: 0x00002580  LBEG    : 0x400570a4  LEND    : 0x400570a9  LCOUNT  : 0x00000000  


Backtrace: 0x420be8d9:0x3fcb9230 0x42006ecd:0x3fcb9250 0x42006a05:0x3fcb9290 0x420bf023:0x3fcb92c0 0x420bf046:0x3fcb92e0 0x42013056:0x3fcb9300 0x42003cd4:0x3fcb9320 0x420044a7:0x3fcb9350 0x4200454c:0x3fcb93b0 0x4037ef42:0x3fcb93d0



EXCVADDR: 0x00002580

Decoding stack results
0x420be8d9:  is in Arduino_Canvas::writePixelPreclipped(short, short, unsigned short) (/home/james/Arduino/libraries/GFX_Library_for_Arduino/src/canvas/Arduino_Canvas.cpp:76).
0x42006ecd:  is in Arduino_GFX::drawChar(short, short, unsigned char, unsigned short, unsigned short) (/home/james/Arduino/libraries/GFX_Library_for_Arduino/src/Arduino_GFX.cpp:2217).
0x42006a05:  is in Arduino_GFX::write(unsigned char) (/home/james/Arduino/libraries/GFX_Library_for_Arduino/src/Arduino_GFX.cpp:2485).
0x420bf023:  is in Print::write(unsigned char const*, unsigned int) (/home/james/.arduino15/packages/esp32/hardware/esp32/3.2.0/cores/esp32/Print.cpp:41).
0x420bf046:  is in Print::print(String const&) (/home/james/.arduino15/packages/esp32/hardware/esp32/3.2.0/cores/esp32/Print.h:66).
0x42013056:  is in Print::println(String const&) (/home/james/.arduino15/packages/esp32/hardware/esp32/3.2.0/cores/esp32/Print.cpp:174).
0x42003cd4: displayBlockHours() at /home/james/Arduino/MyTest/MyTest.ino:1343
0x420044a7: ManageWebAndDisplay() at /home/james/Arduino/MyTest/MyTest.ino:473
0x4200454c: Task1code(void*) at /home/james/Arduino/MyTest/MyTest.ino:329
0x4037ef42: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:139

lbernstone
Posts: 1131
Joined: Mon Jul 22, 2019 3:20 pm

Re: ESP32-S3 Arduino_GFX_Library reboot automatically

Postby lbernstone » Mon Apr 07, 2025 4:01 pm

No idea. Open an issue

maggymtac
Posts: 43
Joined: Wed Aug 04, 2021 7:47 am

Re: ESP32-S3 Arduino_GFX_Library reboot automatically

Postby maggymtac » Wed Apr 09, 2025 6:37 pm


maggymtac
Posts: 43
Joined: Wed Aug 04, 2021 7:47 am

Re: ESP32-S3 Arduino_GFX_Library reboot automatically

Postby maggymtac » Fri Apr 11, 2025 7:59 pm

i found 2 root causes for crash, the 1):

when i declare

Code: Select all

#include <WiFi.h>

i get crash -> GFX is not initialize. the execution enter on this if condition:

Code: Select all

// Init Display
  if (!gfx->begin())
  // if (!gfx->begin(80000000)) /* specify data bus speed */
  {
    Serial.println("gfx->begin() failed!");
  }

Code: Select all

Sketch: PDQgraphicstest FQBN: esp32:esp32:esp32s3

A14     : 0x00000000  A15     : 0x3fc9a6ac  SAR     : 0x00000004  EXCCAUSE: 0x0000001d  
EXCVADDR: 0x00000000  LBEG    : 0x40056fc5  LEND    : 0x40056fe7  LCOUNT  : 0xffffffff  


Backtrace: 0x4209b207:0x3fcabb60 0x4209ac0e:0x3fcabb80 0x42004577:0x3fcabbb0 0x4200459d:0x3fcabbd0 0x42003119:0x3fcabbf0 0x42003320:0x3fcabc10 0x4200e904:0x3fcabc30 0x4037ef2e:0x3fcabc50




EXCVADDR: 0x00000000

Decoding stack results
0x4209b207:  is in Arduino_Canvas::writeFillRectPreclipped(short, short, short, short, unsigned short) (/home/james/Arduino/libraries/GFX_Library_for_Arduino/src/canvas/Arduino_Canvas.cpp:231).
0x4209ac0e:  is in Arduino_GFX::writeFillRect(short, short, short, short, unsigned short) (/home/james/Arduino/libraries/GFX_Library_for_Arduino/src/Arduino_GFX.cpp:283).
0x42004577:  is in Arduino_GFX::fillRect(short, short, short, short, unsigned short) (/home/james/Arduino/libraries/GFX_Library_for_Arduino/src/Arduino_GFX.cpp:368).
0x4200459d:  is in Arduino_GFX::fillScreen(unsigned short) (/home/james/Arduino/libraries/GFX_Library_for_Arduino/src/Arduino_GFX.cpp:380).
0x42003119: testFillScreen() at /home/james/Arduino/PDQgraphicstest/PDQgraphicstest.ino:379
0x42003320: loop() at /home/james/Arduino/PDQgraphicstest/PDQgraphicstest.ino:173
0x4200e904: loopTask(void*) at /home/james/.arduino15/packages/esp32/hardware/esp32/3.2.0/cores/esp32/main.cpp:74
0x4037ef2e: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:139

2) i have a crash on this line when wifi is not available:

Code: Select all

int httpCode = https.GET();

Code: Select all

WiFiClientSecure *client = new WiFiClientSecure;
  if(client) {
    // set secure client without certificate
    client->setInsecure();
    //create an HTTPClient instance
    HTTPClient https;

    //Initializing an HTTPS communication using the secure client
    Serial.print("[HTTPS] begin...\n");
    if (https.begin(*client, URL)) {  // HTTPS test: "https://www.howsmyssl.com/a/check"
      
      
      Serial.print("[HTTPS] GET...\n");
      // start connection and send HTTP header
      int httpCode = https.GET();
   
   https.end();
   }
   
   }else {
    Serial.printf("[HTTPS] Unable to connect\n");
  }

Code: Select all

ESP Exception Decoder
Sketch: PDQgraphicstest FQBN: esp32:esp32:esp32s3

assert failed: xQueueSemaphoreTake queue.c:1709 (( pxQueue ))


Backtrace: 0x403765ed:0x3fca51f0 0x4037c6c5:0x3fca5210 0x403831f6:0x3fca5230 0x4037cdee:0x3fca5370 0x4203066e:0x3fca53b0 0x420241aa:0x3fca53d0 0x42030ef1:0x3fca53f0 0x42022985:0x3fca5430 0x420092e4:0x3fca54a0 0x42007bff:0x3fca5520 0x42007cee:0x3fca55a0 0x42066659:0x3fca55c0 0x42009bf3:0x3fca55e0 0x4200b21d:0x3fca5610 0x4200b48f:0x3fca5670 0x42002aef:0x3fca5690 0x42002c4a:0x3fca57a0 0x420106e6:0x3fca57c0 0x4037d396:0x3fca57e0



Decoding stack results
0x403765ed: panic_abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/panic.c:454
0x4037c6c5: esp_system_abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/port/esp_system_chip.c:87
0x403831f6: __assert_func at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/newlib/assert.c:80
0x4037cdee: xQueueSemaphoreTake at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel/queue.c:1713
0x4203066e: sys_mutex_lock at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/port/freertos/sys_arch.c:63
0x420241aa: tcpip_send_msg_wait_sem at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/api/tcpip.c:446
0x42030ef1: netconn_gethostbyname_addrtype at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/api/api_lib.c:1333
0x42022985: lwip_getaddrinfo at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/api/netdb.c:495
0x420092e4:  is in NetworkManager::hostByName(char const*, IPAddress&) (/home/james/.arduino15/packages/esp32/hardware/esp32/3.2.0/libraries/Network/src/NetworkManager.cpp:113).
0x42007bff:  is in NetworkClientSecure::connect(char const*, unsigned short, char const*, char const*, char const*) (/home/james/.arduino15/packages/esp32/hardware/esp32/3.2.0/libraries/NetworkClientSecure/src/NetworkClientSecure.cpp:140).
0x42007cee:  is in NetworkClientSecure::connect(char const*, unsigned short) (/home/james/.arduino15/packages/esp32/hardware/esp32/3.2.0/libraries/NetworkClientSecure/src/NetworkClientSecure.cpp:126).
0x42066659:  is in NetworkClientSecure::connect(char const*, unsigned short, long) (/home/james/.arduino15/packages/esp32/hardware/esp32/3.2.0/libraries/NetworkClientSecure/src/NetworkClientSecure.cpp:131).
0x42009bf3: HTTPClient::connect() at /home/james/.arduino15/packages/esp32/hardware/esp32/3.2.0/libraries/HTTPClient/src/HTTPClient.cpp:1104
0x4200b21d:  is in HTTPClient::sendRequest(char const*, unsigned char*, unsigned int) (/home/james/.arduino15/packages/esp32/hardware/esp32/3.2.0/libraries/HTTPClient/src/HTTPClient.cpp:577).
0x4200b48f: HTTPClient::GET() at /home/james/.arduino15/packages/esp32/hardware/esp32/3.2.0/libraries/HTTPClient/src/HTTPClient.cpp:500
0x42002aef: httpsRequest() at /home/james/Arduino/PDQgraphicstest/PDQgraphicstest.ino:95
0x42002c4a: setup() at /home/james/Arduino/PDQgraphicstest/PDQgraphicstest.ino:154
0x420106e6: loopTask(void*) at /home/james/.arduino15/packages/esp32/hardware/esp32/3.2.0/cores/esp32/main.cpp:59
0x4037d396: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:139

Paste exception to decode...


maggymtac
Posts: 43
Joined: Wed Aug 04, 2021 7:47 am

Re: ESP32-S3 Arduino_GFX_Library reboot automatically

Postby maggymtac » Fri Apr 11, 2025 8:10 pm

PDQgraphicstest.zip
(13.47 KiB) Downloaded 22 times

Who is online

Users browsing this forum: ChatGPT-User, Google [Bot] and 4 guests