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;
}
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
Thank you.