Error: Guru Meditation Error: Core 0 panic’ed (LoadProhibited). Exception was unhandled

msh911
Posts: 9
Joined: Wed May 10, 2023 5:21 am

Error: Guru Meditation Error: Core 0 panic’ed (LoadProhibited). Exception was unhandled

Postby msh911 » Thu Jun 01, 2023 6:34 am

I am designing a user interface to run a LCD. the code builds and flashes with no error. however, the LCD keeps rebooting with the following error:

Guru Meditation Error: Core 0 panic’ed (LoadProhibited). Exception was unhandled.

Core 0 register dump:
PC : 0x42017789 PS : 0x00060f30 A0 : 0x82016d89 A1 : 0x3fcf5dc0
A2 : 0x00000000 A3 : 0x00000000 A4 : 0x00000010 A5 : 0x00000000
A6 : 0x00000000 A7 : 0x00000010 A8 : 0x8202b45e A9 : 0x3fcf5da0
A10 : 0x00000000 A11 : 0x0000004c A12 : 0x00000159 A13 : 0x00000001
A14 : 0x00000000 A15 : 0x3fcc9ef4 SAR : 0x0000001f EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000022 LBEG : 0x400555cd LEND : 0x400555e1 LCOUNT : 0xffffffff

Backtrace: 0x42017786:0x3fcf5dc0 0x42016d86:0x3fcf5de0 0x42031cdf:0x3fcf5e00 0x4200d133:0x3fcf5e20 0x4200a66f:0x3fcf5e40 0x420097e6:0x3fcf5e60 0x42056a23:0x3fcf5e80 0x40380b5d:0x3fcf5eb0

ELF file SHA256: 2695906877ba8a29

Rebooting.

No luck so far to resolve it.
I appreciate any input.

IDE: Arduino
LCD/Board: ESP32 Development Board WT32-SC01 Plus

Arduino Code:


//--------------------------------------------------------------------------
#include <Wire.h>

// LovyanGFX
#define LGFX_USE_V1
#include <LovyanGFX.hpp>
// LVGL
#include <lvgl.h>
#include "ui.h"

static const int RXPin = 10, TXPin = 11, sclPin = 12, sdaPin = 13;
static const uint32_t GPSBaud = 9600;



#define LGFX_USE_V1
#include <LovyanGFX.hpp>


class LGFX : public lgfx::LGFX_Device {
lgfx::Panel_ST7796 _panel_instance;
lgfx::Bus_Parallel8 _bus_instance;
lgfx::Light_PWM _light_instance;
lgfx::Touch_FT5x06 _touch_instance;

public:
LGFX(void) {
{
auto cfg = _bus_instance.config();
cfg.freq_write = 40000000;
cfg.pin_wr = 47;
cfg.pin_rd = -1;
cfg.pin_rs = 0;
cfg.pin_d0 = 9;
cfg.pin_d1 = 46;
cfg.pin_d2 = 3;
cfg.pin_d3 = 8;
cfg.pin_d4 = 18;
cfg.pin_d5 = 17;
cfg.pin_d6 = 16;
cfg.pin_d7 = 15;
_bus_instance.config(cfg);
_panel_instance.setBus(&_bus_instance);
}

{
auto cfg = _panel_instance.config();
cfg.pin_cs = -1;
cfg.pin_rst = 4;
cfg.pin_busy = -1;
cfg.memory_width = 480;
cfg.memory_height = 320;
cfg.panel_width = 480;
cfg.panel_height = 320;
cfg.offset_x = 0;
cfg.offset_y = 0;
cfg.offset_rotation = 0;
cfg.dummy_read_pixel = 8;
cfg.dummy_read_bits = 1;
cfg.readable = true;
cfg.invert = true;
cfg.rgb_order = false;
cfg.dlen_16bit = false;
cfg.bus_shared = true;

_panel_instance.config(cfg);
}

{
auto cfg = _light_instance.config();
cfg.pin_bl = 45;
cfg.invert = false;
cfg.freq = 44100;
cfg.pwm_channel = 7;

_light_instance.config(cfg);
_panel_instance.setLight(&_light_instance);
}

{
auto cfg = _touch_instance.config();
cfg.i2c_port = 1;
cfg.i2c_addr = 0x38;
cfg.pin_sda = 6;
cfg.pin_scl = 5;
cfg.freq = 400000;
cfg.x_min = 0;
cfg.x_max = 480;
cfg.y_min = 0;
cfg.y_max = 320;

_touch_instance.config(cfg);
_panel_instance.setTouch(&_touch_instance);
}

setPanel(&_panel_instance);
}
};

static LGFX tft;

/*Change to your screen resolution*/
static const uint32_t screenWidth = 480;
static const uint32_t screenHeight = 320;
static lv_disp_draw_buf_t draw_buf;
static lv_color_t buf[screenWidth * 10];

/* Display flushing */
void my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p) {
uint32_t w = (area->x2 - area->x1 + 1);
uint32_t h = (area->y2 - area->y1 + 1);

tft.startWrite();
tft.setAddrWindow(area->x1, area->y1, w, h);
tft.writePixels((lgfx::rgb565_t *)&color_p->full, w * h);
tft.endWrite();

lv_disp_flush_ready(disp);
}

/*Read the touchpad*/
void my_touchpad_read(lv_indev_drv_t *indev_driver, lv_indev_data_t *data) {

uint16_t x, y;
if (tft.getTouch(&x, &y)) {
data->state = LV_INDEV_STATE_PR;
data->point.x = x;
data->point.y = y;

} else {
data->state = LV_INDEV_STATE_REL;
}
}

void setup() {
lv_init();
Serial.begin(115200);
initDisplay();

lv_disp_draw_buf_init(&draw_buf, buf, NULL, screenWidth * 10);

/*Initialize the display*/
static lv_disp_drv_t disp_drv;
lv_disp_drv_init(&disp_drv);

/*Change the following line to your display resolution*/
disp_drv.hor_res = screenWidth;
disp_drv.ver_res = screenHeight;
disp_drv.flush_cb = my_disp_flush;
disp_drv.draw_buf = &draw_buf;
lv_disp_drv_register(&disp_drv);

/*Initialize the (dummy) input device driver*/
static lv_indev_drv_t indev_drv;
lv_indev_drv_init(&indev_drv);
indev_drv.type = LV_INDEV_TYPE_POINTER;
indev_drv.read_cb = my_touchpad_read;
lv_indev_drv_register(&indev_drv);

ui_init();


xTaskCreate(b_task,
"b_task",
12000,
NULL,
3,
NULL);
}

void loop() {
lv_timer_handler();

delay(100);
}

void initDisplay() {
tft.begin();
tft.setRotation(1);
tft.setBrightness(255);
tft.fillScreen(TFT_BLACK);
}


void b_task(void *pvParameters) {


while (1) {

vTaskDelay(100 / portTICK_PERIOD_MS);
}
}

ESP_Sprite
Posts: 8921
Joined: Thu Nov 26, 2015 4:08 am

Re: Error: Guru Meditation Error: Core 0 panic’ed (LoadProhibited). Exception was unhandled

Postby ESP_Sprite » Thu Jun 01, 2023 6:49 am

Can you decode that backtrace?

msh911
Posts: 9
Joined: Wed May 10, 2023 5:21 am

Re: Error: Guru Meditation Error: Core 0 panic’ed (LoadProhibited). Exception was unhandled

Postby msh911 » Thu Jun 01, 2023 3:37 pm

thanks for the response.

Backtrace: 0x42017746:0x3fcf5dc0 0x42016d46:0x3fcf5de0 0x42035667:0x3fcf5e00 0x4200d12f:0x3fcf5e20 0x4200a66b:0x3fcf5e40 0x420097e2:0x3fcf5e60 0x420569e3:0x3fcf5e80 0x40380b5d:0x3fcf5eb0
0x42017746: lv_obj_mark_layout_as_dirty at C:/Espressif/frameworks/esp-idf-v5.0.1/workspace/LCD_V2/components/lvgl/src/core/lv_obj_pos.c:289

0x42016d46: lv_obj_class_init_obj at C:/Espressif/frameworks/esp-idf-v5.0.1/workspace/LCD_V2/components/lvgl/src/core/lv_obj_class.c:106

0x42035667: lv_textarea_create at C:/Espressif/frameworks/esp-idf-v5.0.1/workspace/LCD_V2/components/lvgl/src/widgets/lv_textarea.c:92

0x4200d12f: ui_Menu_screen_init at C:/Espressif/frameworks/esp-idf-v5.0.1/workspace/LCD_V2/main/screens/ui_Menu.c:1041

0x4200a66b: ui_init at C:/Espressif/frameworks/esp-idf-v5.0.1/workspace/LCD_V2/main/ui.c:979

0x420097e2: app_main at C:/Espressif/frameworks/esp-idf-v5.0.1/workspace/LCD_V2/main/main.cpp:524

0x420569e3: main_task at C:/Espressif/frameworks/esp-idf-v5.0.1/components/freertos/FreeRTOS-Kernel/portable/port_common.c:131 (discriminator 2)

0x40380b5d: vPortTaskWrapper at C:/Espressif/frameworks/esp-idf-v5.0.1/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:154



I deleted that object in the line (1041) but then again it picks up the next object that comes right at that line. So the error backtrace does not seem to be helpful. Can it be the case that anything that comes after line 1041 is causing the issue because there is not enough memory or it referred to a prohibited memory address?

MicroController
Posts: 1136
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Error: Guru Meditation Error: Core 0 panic’ed (LoadProhibited). Exception was unhandled

Postby MicroController » Thu Jun 01, 2023 8:23 pm

It seems that the issue is about here:

Code: Select all

scr->scr_layout_inv = 1;
So apparently the "scr" (screen?) is not set correctly (NULL?) on the GUI objects in ui_init().

Who is online

Users browsing this forum: No registered users and 125 guests