Instruction access fault on esp32-p4 at open_console
Posted: Sat Feb 07, 2026 8:09 pm
I have this simple code with lvgl adapter:
But it always throws this error: No matter what i try its always the same error.
Code: Select all
#include <esp_lcd_panel_dev.h>
#include <esp_lcd_panel_commands.h>
#include <esp_lcd_st7703.h>
#include <esp_lcd_panel_st7789.h>
#include <esp_lcd_panel_io.h>
#include <esp_ldo_regulator.h>
#include <esp_lcd_panel_io_interface.h>
#include <esp_lcd_mipi_dsi.h>
#include <esp_log.h>
#include <esp_lcd_panel_ops.h>
#include <lvgl.h>
#include <esp_lv_adapter.h>
#include <esp_lcd_touch.h>
#include <esp_lcd_touch_gt911.h>
#include <driver/i2c_master.h>
#include "ui/ui.h"
#include "esp_sntp.h"
esp_lcd_panel_handle_t panel_handle;
time_t now;
char strftime_buf[64];
char strftime_buf1[64];
struct tm timeinfo;
void updTime(){
time(&now);
localtime_r(&now, &timeinfo);
strftime(strftime_buf, sizeof(strftime_buf), "%R", &timeinfo);
strftime(strftime_buf1, sizeof(strftime_buf1), "%A %d %Ob %Y", &timeinfo);
}
void app_main(void)
{
setenv("TZ", "GMT+1", 1);
tzset();
esp_ldo_channel_handle_t ldo_mipi_phy = NULL;
esp_ldo_channel_config_t ldo_mipi_phy_config = {
.chan_id = 3,
.voltage_mv = 2500,
};
ESP_ERROR_CHECK(esp_ldo_acquire_channel(&ldo_mipi_phy_config, &ldo_mipi_phy));
ESP_LOGI("nullplayer", "Initialize MIPI DSI bus");
esp_lcd_dsi_bus_handle_t mipi_dsi_bus = NULL;
esp_lcd_dsi_bus_config_t bus_config = ST7703_PANEL_BUS_DSI_2CH_CONFIG();
ESP_ERROR_CHECK(esp_lcd_new_dsi_bus(&bus_config, &mipi_dsi_bus));
ESP_LOGI("nullplayer", "Install panel IO");
esp_lcd_panel_io_handle_t mipi_dbi_io = NULL;
esp_lcd_dbi_io_config_t dbi_config = ST7703_PANEL_IO_DBI_CONFIG();
ESP_ERROR_CHECK(esp_lcd_new_panel_io_dbi(mipi_dsi_bus, &dbi_config, &mipi_dbi_io));
ESP_LOGI("nullplayer", "Install ST7703 panel driver");
esp_lcd_dpi_panel_config_t dpi_config = { .dpi_clk_src = MIPI_DSI_DPI_CLK_SRC_DEFAULT, .dpi_clock_freq_mhz = 38, .pixel_format = LCD_COLOR_PIXEL_FORMAT_RGB565, .num_fbs = 3, .video_timing = { .h_size = 720, .v_size = 720, .hsync_back_porch = 50, .hsync_front_porch = 50, .vsync_back_porch = 20, .vsync_front_porch = 20, }} ;
dpi_config.virtual_channel = 0;
dpi_config.flags.use_dma2d = true;
dpi_config.video_timing.hsync_pulse_width=20;
dpi_config.video_timing.vsync_pulse_width=4;
st7703_vendor_config_t vendor_config = {
.mipi_config = {
.dsi_bus = mipi_dsi_bus,
.dpi_config = &dpi_config,
},
};
const esp_lcd_panel_dev_config_t panel_config = {
.reset_gpio_num = 27, // Set to -1 if not use
.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB, // Implemented by LCD command `36h`
.bits_per_pixel = 24, // Implemented by LCD command `3Ah` (16/18/24)
.vendor_config = &vendor_config,
};
ESP_ERROR_CHECK(esp_lcd_new_panel_st7703(mipi_dbi_io, &panel_config, &panel_handle));
vTaskDelay(200);
ESP_ERROR_CHECK(esp_lcd_panel_reset(panel_handle));
ESP_ERROR_CHECK(esp_lcd_panel_init(panel_handle));
ESP_ERROR_CHECK(esp_lcd_panel_disp_on_off(panel_handle, true));
vTaskDelay(200/portTICK_PERIOD_MS);
esp_lcd_panel_io_handle_t io_handle = NULL;
static i2c_master_bus_handle_t i2c_bus_handle;
i2c_master_bus_config_t i2c_bus_config = {0};
i2c_bus_config.clk_source = I2C_CLK_SRC_DEFAULT;
i2c_bus_config.i2c_port = 0;
i2c_bus_config.scl_io_num = GPIO_NUM_8;
i2c_bus_config.sda_io_num = GPIO_NUM_7;
i2c_bus_config.glitch_ignore_cnt = 7;
i2c_bus_config.flags.enable_internal_pullup = true;
i2c_new_master_bus(&i2c_bus_config, &i2c_bus_handle);
esp_lcd_panel_io_i2c_config_t io_config = ESP_LCD_TOUCH_IO_I2C_GT911_CONFIG();
io_config.scl_speed_hz=100000;
ESP_ERROR_CHECK(esp_lcd_new_panel_io_i2c(i2c_bus_handle, &io_config, &io_handle));
esp_lcd_touch_io_gt911_config_t tp_gt911_config = {
.dev_addr = io_config.dev_addr,
};
esp_lcd_touch_config_t tp_cfg = {
.x_max = 720,
.y_max = 720,
.rst_gpio_num = -1,
.int_gpio_num = -1,
.levels = {
.reset = 0,
.interrupt = 0,
},
.flags = {
.swap_xy = 0,
.mirror_x = 0,
.mirror_y = 0,
},
.driver_data = &tp_gt911_config,
};
esp_lcd_touch_handle_t tp;
esp_lcd_touch_new_i2c_gt911(io_handle, &tp_cfg, &tp);
esp_lv_adapter_config_t cfg = ESP_LV_ADAPTER_DEFAULT_CONFIG();
ESP_ERROR_CHECK(esp_lv_adapter_init(&cfg));
esp_lv_adapter_display_config_t disp_cfg = ESP_LV_ADAPTER_DISPLAY_MIPI_DEFAULT_CONFIG(
panel_handle,
mipi_dbi_io,
720,
720,
ESP_LV_ADAPTER_ROTATE_0
);
lv_display_t *disp = esp_lv_adapter_register_display(&disp_cfg);
assert(disp != NULL);
esp_lv_adapter_touch_config_t touch_cfg = ESP_LV_ADAPTER_TOUCH_DEFAULT_CONFIG(disp, tp);
lv_indev_t *touch = esp_lv_adapter_register_touch(&touch_cfg);
assert(touch != NULL);
ESP_ERROR_CHECK(esp_lv_adapter_start());
vTaskDelay(200/portTICK_PERIOD_MS);
if (esp_lv_adapter_lock(-1) == ESP_OK) {
ui_init();
esp_lv_adapter_unlock();
}
while (1){
updTime();
if (esp_lv_adapter_lock(-1) == ESP_OK) {
ui_tick();
lv_label_set_text(objects.time_label, strftime_buf);
lv_label_set_text(objects.date_label, strftime_buf1);
esp_lv_adapter_unlock();
}
vTaskDelay(16/portTICK_PERIOD_MS);
}
}
Code: Select all
SPI mode:DIO, clock div:1
load:0x4ff33ce0,len:0x164c
load:0x4ff29ed0,len:0xd64
load:0x4ff2cbd0,len:0x3364
entry 0x4ff29eda
I (33) boot: ESP-IDF v5.5-dirty 2nd stage bootloader
I (33) boot: compile time Feb 7 2026 19:54:28
I (33) boot: Multicore bootloader
I (34) boot: chip revision: v1.3
I (36) boot: efuse block revision: v0.3
I (40) boot.esp32p4: SPI Speed : 80MHz
I (44) boot.esp32p4: SPI Mode : DIO
I (47) boot.esp32p4: SPI Flash Size : 32MB
I (51) boot: Enabling RNG early entropy source...
I (56) boot: Partition Table:
I (58) boot: ## Label Usage Type ST Offset Length
I (65) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (71) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (78) boot: 2 factory factory app 00 00 00010000 00300000
I (85) boot: End of partition table
I (88) esp_image: segment 0: paddr=00010020 vaddr=40080020 size=1593e0h (1414112) map
I (304) esp_image: segment 1: paddr=00169408 vaddr=30100000 size=00068h ( 104) load
I (306) esp_image: segment 2: paddr=00169478 vaddr=4ff00000 size=06ba0h ( 27552) load
I (314) esp_image: segment 3: paddr=00170020 vaddr=40000020 size=73e74h (474740) map
I (386) esp_image: segment 4: paddr=001e3e9c vaddr=4ff06ba0 size=0abb8h ( 43960) load
I (395) esp_image: segment 5: paddr=001eea5c vaddr=4ff11780 size=025e8h ( 9704) load
I (402) boot: Loaded app from partition at offset 0x10000
I (402) boot: Disabling RNG early entropy source...
I (414) hex_psram: vendor id : 0x0d (AP)
I (414) hex_psram: Latency : 0x01 (Fixed)
I (414) hex_psram: DriveStr. : 0x00 (25 Ohm)
I (415) hex_psram: dev id : 0x03 (generation 4)
I (419) hex_psram: density : 0x07 (256 Mbit)
I (424) hex_psram: good-die : 0x06 (Pass)
I (428) hex_psram: SRF : 0x02 (Slow Refresh)
I (433) hex_psram: BurstType : 0x00 ( Wrap)
I (437) hex_psram: BurstLen : 0x03 (2048 Byte)
I (441) hex_psram: BitMode : 0x01 (X16 Mode)
I (446) hex_psram: Readlatency : 0x02 (10 cycles@Fixed)
I (451) hex_psram: DriveStrength: 0x00 (1/1)
I (455) esp_psram: Found 32MB PSRAM device
I (459) esp_psram: Speed: 20MHz
I (462) hex_psram: psram CS IO is dedicated
I (465) cpu_start: Multicore app
I (2541) esp_psram: SPI SRAM memory test OK
I (2550) cpu_start: Pro cpu start user code
I (2550) cpu_start: cpu freq: 360000000 Hz
I (2550) app_init: Application information:
I (2550) app_init: Project name: SmartClock
I (2554) app_init: App version: 1
I (2558) app_init: Compile time: Feb 7 2026 19:55:49
I (2563) app_init: ELF file SHA256: 11066a426...
I (2567) app_init: ESP-IDF: v5.5-dirty
I (2572) efuse_init: Min chip rev: v0.1
I (2575) efuse_init: Max chip rev: v1.99
I (2580) efuse_init: Chip rev: v1.3
I (2584) heap_init: Initializing. RAM available for dynamic allocation:
I (2590) heap_init: At 4FF259A0 len 00015620 (85 KiB): RAM
I (2595) heap_init: At 4FF3AFC0 len 00004BF0 (18 KiB): RAM
I (2601) heap_init: At 50108080 len 00007F80 (31 KiB): RTCRAM
I (2606) heap_init: At 30100068 len 00001F98 (7 KiB): TCM
I (2611) esp_psram: Adding pool of 32768K of PSRAM memory to heap allocator
Guru Meditation Error: Core 0 panic'ed (Instruction access fault). Exception was unhandled.
Core 0 register dump:
MEPC : 0x4ff258b4 RA : 0x40008e7e SP : 0x4ff3cab0 GP : 0x4ff11f80
--- 0x40008e7e: console_open at A:/ESP-IDF/v5.5/esp-idf/components/esp_vfs_console/vfs_console.c:62
TP : 0x00000000 T0 : 0x4fc1a058 T1 : 0x0000000f T2 : 0x00010000
--- 0x4fc1a058: _printf_i in ROM
S0/FP : 0x00000000 S1 : 0x4ff25e5c A0 : 0x40083a14 A1 : 0x00000000
A2 : 0x000001b6 A3 : 0x00000000 A4 : 0x00000010 A5 : 0x00000000
A6 : 0x00000800 A7 : 0x0000002b S2 : 0x400833c4 S3 : 0x4ff11ee4
S4 : 0x00000000 S5 : 0x000001b6 S6 : 0x00010000 S7 : 0x001593e0
S8 : 0x00010020 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x00000000 T4 : 0x00000014 T5 : 0x00000000 T6 : 0x00000000
MSTATUS : 0x00001880 MTVEC : 0x4ff00003 MCAUSE : 0x00000001 MTVAL : 0x4ff258b4
--- 0x4ff00003: _vector_table at ??:?
MHARTID : 0x00000000
Stack memory:
4ff3cab0: 0x400833c4 0x4ff25e5c 0x00000000 0x40073526 0x00010000 0x00073e74 0x4ff00556 0x400833c4
--- 0x40073526: esp_vfs_open at A:/ESP-IDF/v5.5/esp-idf/components/vfs/vfs.c:950
--- 0x4ff00556: call_start_cpu0 at A:/ESP-IDF/v5.5/esp-idf/components/esp_system/port/cpu_start.c:357
4ff3cad0: 0x4ff11ee4 0x00000004 0x4ff25f98 0x400610ca 0x00000000 0x00000008 0x40083a8c 0x00000000
--- 0x400610ca: _fopen_r at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/newlib/libc/stdio/fopen.c:129
4ff3caf0: 0x00000000 0x00000000 0x401d93d8 0x00000000 0x00000000 0x400833c4 0x401d93e0 0x400079a2
--- 0x400079a2: esp_libc_init_global_stdio at A:/ESP-IDF/v5.5/esp-idf/components/newlib/src/newlib_init.c:170
4ff3cb10: 0x00000000 0x00000000 0x401d93e0 0x40007014 0x0000000c 0x40000020 0x401d9370 0x40000536
--- 0x40007014: __esp_system_init_fn_init_libc_stdio at A:/ESP-IDF/v5.5/esp-idf/components/newlib/src/init.c:25
--- 0x40000020: esp_app_format_init_elf_sha256 at A:/ESP-IDF/v5.5/esp-idf/components/esp_app_format/esp_app_desc.c:88
--- 0x40000536: do_system_init_fn at A:/ESP-IDF/v5.5/esp-idf/components/esp_system/startup.c:132
4ff3cb30: 0x00010000 0x00073e74 0x00000000 0x00170020 0x0000000c 0x00300000 0x00000000 0x40000594
--- 0x40000594: do_core_init at A:/ESP-IDF/v5.5/esp-idf/components/esp_system/startup.c:171
4ff3cb50: 0x0000000c 0x02625a00 0x00000000 0x400005f2 0x0000000c 0x02625a00 0x00000000 0x4ff008e6
--- 0x400005f2: start_cpu0_default at A:/ESP-IDF/v5.5/esp-idf/components/esp_system/startup.c:206
--- 0x4ff008e6: call_start_cpu0 at A:/ESP-IDF/v5.5/esp-idf/components/esp_system/port/cpu_start.c:837
4ff3cb70: 0x4ff3cc64 0x4ff33bd4 0x00000000 0x01f3cb94 0x5f0206e9 0x4ff00556 0x000000ee 0x01000012
--- 0x4ff00556: call_start_cpu0 at A:/ESP-IDF/v5.5/esp-idf/components/esp_system/port/cpu_start.c:357
4ff3cb90: 0x0000c700 0x01000000 0x0000000c 0x0000000c 0x40080020 0x40000020 0xffff0000 0x4ff2dfbe
--- 0x40000020: esp_app_format_init_elf_sha256 at A:/ESP-IDF/v5.5/esp-idf/components/esp_app_format/esp_app_desc.c:88
4ff3cbb0: 0x592e2678 0x6611816c 0xebd3df47 0x00010000 0xe40e9b64 0x00080000 0x00010020 0x00170020
4ff3cbd0: 0x40080020 0x40000020 0x001593e0 0x00073e74 0x00007750 0x00000192 0x00000000 0x4ff40000
--- 0x40000020: esp_app_format_init_elf_sha256 at A:/ESP-IDF/v5.5/esp-idf/components/esp_app_format/esp_app_desc.c:88
4ff3cbf0: 0x00007750 0x4fc1da4c 0x0000ffff 0xffffffff 0xffffffff 0x4ff3cd50 0xffffffff 0x4ff2e5c4
4ff3cc10: 0x00010000 0x00300000 0x00010000 0x5f0206e9 0x4ff00556 0x000000ee 0x01000012 0x0000c700
--- 0x4ff00556: call_start_cpu0 at A:/ESP-IDF/v5.5/esp-idf/components/esp_system/port/cpu_start.c:357
4ff3cc30: 0x01000000 0x40080020 0x001593e0 0x30100000 0x00000068 0x4ff00000 0x00006ba0 0x40000020
--- 0x30100000: clk_ll_mpll_enable at A:/ESP-IDF/v5.5/esp-idf/components/hal/esp32p4/include/hal/clk_tree_ll.h:156
--- (inlined by) rtc_clk_mpll_enable at A:/ESP-IDF/v5.5/esp-idf/components/esp_hw_support/port/esp32p4/rtc_clk.c:592
--- 0x4ff00000: _vector_table at ??:?
--- 0x40000020: esp_app_format_init_elf_sha256 at A:/ESP-IDF/v5.5/esp-idf/components/esp_app_format/esp_app_desc.c:88
4ff3cc50: 0x00073e74 0x4ff06ba0 0x0000abb8 0x4ff11780 0x000025e8 0x00000000 0x00000000 0x00000000
--- 0x4ff06ba0: s_print_psram_info at A:/ESP-IDF/v5.5/esp-idf/components/esp_psram/device/esp_psram_impl_ap_hex.c:274
4ff3cc70: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4ff3cc90: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4ff3ccb0: 0x00000000 0x00010020 0x00169408 0x00169478 0x00170020 0x001e3e9c 0x001eea5c 0x00000000
4ff3ccd0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4ff3ccf0: 0x00000000 0x001e1070 0x592e2678 0x6611816c 0xebd3df47 0xb7a13ce0 0xe40e9b64 0x7141a96b
4ff3cd10: 0x0b219947 0xac617bc9 0x00000000 0x00010000 0x00007750 0x4fc1da4c 0x0000ffff 0x4ff40000
4ff3cd30: 0x00000000 0x0000006c 0x00000000 0x4ff29f5c 0x2832d214 0x064f602e 0x00000000 0xffffffff
4ff3cd50: 0x00000000 0x00000000 0x00010000 0x00300000 0x00000000 0x00000000 0x00000000 0x00000000
4ff3cd70: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4ff3cd90: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4ff3cdb0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4ff3cdd0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
4ff3cdf0: 0x3ff10000 0x00000010 0x00000020 0x4fc04f6c 0x00000000 0x00000000 0x00000000 0x00000000
--- 0x4fc04f6c: ets_efuse_write_key in ROM
4ff3ce10: 0x00000000 0x00010000 0x5f0203e9 0x4ff29eda 0x4ff2cbd0 0x00003364 0x000000ee 0x01000012
4ff3ce30: 0x0000c700 0x01000000 0x40007750 0x7533885e 0x5e48fa76 0x2037d9a5 0xb837e682 0x13aadfe2
--- 0x40007750: _gettimeofday_r at A:/ESP-IDF/v5.5/esp-idf/components/newlib/src/time.c:174
4ff3ce50: 0x8c50d338 0x3700ce99 0xd474b3eb 0x58357bb5 0x00000000 0x00000000 0x00000000 0x00000000
4ff3ce70: 0x00000000 0x00000000 0x00000000 0x00000000 0x4ff3cfa0 0x00000101 0x00000002 0x5e48fa76
4ff3ce90: 0x2037d9a5 0xb837e682 0x13aadfe2 0x8c50d338 0x3700ce99 0xd474b3eb 0x58357bb5 0x00000000
ELF file SHA256: 11066a426
Rebooting...
ESP-ROM:esp32p4-eco2-20240710