lovyan03 / LovyanGFX

SPI LCD graphics library for ESP32 (ESP-IDF/ArduinoESP32) / ESP8266 (ArduinoESP8266) / SAMD51(Seeed ArduinoSAMD51)
Other
1.12k stars 200 forks source link

ESP32-S3 Boot Loop with ESP-IDF v5.0 #322

Closed JeremiahGillis closed 1 year ago

JeremiahGillis commented 1 year ago

Environment

Problem Description

My ESP32-S3 display does not work after upgrading to IDF v5.0. The log shows that my module is stuck in a boot loop. Please see the log below.

Based on the log file, and reviewing the code, the LCD peripheral clock source is not being set, resulting in an ASSERT. Setting bus_config.clk_src to LCD_CLK_SRC_PLL160M or LCD_CLK_SRC_DEFAULT results in my screen and project functioning correctly. This needs to be set before calling esp_lcd_new_i80_bus(). I also tried LCD_CLK_SRC_PLL240M but it crashes (different errors).

Rebooting...
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0x9 (SPI_FAST_FLASH_BOOT)
Saved PC:0x403759d5
0x403759d5: esp_restart_noos_dig at C:/Users/jerem/esp/esp-idf/components/esp_system/esp_system.c:46 (discriminator 1)

SPIWP:0xee
Octal Flash Mode Enabled
For OPI Flash, Use Default Flash Boot Mode
mode:SLOW_RD, clock div:1
load:0x3fce3810,len:0x1074
load:0x403c9700,len:0xa10
load:0x403cc700,len:0x2bbc
entry 0x403c9890
W (281) FLASH: DO NOT USE FOR MASS PRODUCTION! Timing parameters will be updated in future IDF version.
I (282) octal_psram: vendor id    : 0x0d (AP)
I (285) octal_psram: dev id       : 0x02 (generation 3)
I (291) octal_psram: density      : 0x03 (64 Mbit)
I (296) octal_psram: good-die     : 0x01 (Pass)
I (302) octal_psram: Latency      : 0x01 (Fixed)
I (307) octal_psram: VCC          : 0x00 (1.8V)
I (312) octal_psram: SRF          : 0x01 (Fast Refresh)
I (318) octal_psram: BurstType    : 0x01 (Hybrid Wrap)
I (324) octal_psram: BurstLen     : 0x01 (32 Byte)
I (329) octal_psram: Readlatency  : 0x02 (10 cycles@Fixed)
I (335) octal_psram: DriveStrength: 0x00 (1/1)
W (340) PSRAM: DO NOT USE FOR MASS PRODUCTION! Timing parameters will be updated in future IDF version.
I (351) esp_psram: Found 8MB PSRAM device
I (355) esp_psram: Speed: 80MHz
I (359) cpu_start: Pro cpu up.
I (363) cpu_start: Starting app cpu, entry point is 0x4037550c
0x4037550c: call_start_cpu1 at C:/Users/jerem/esp/esp-idf/components/esp_system/port/cpu_start.c:142

I (0) cpu_start: App cpu up.
I (378) cpu_start: Pro cpu start user code
I (378) cpu_start: cpu freq: 240000000 Hz
I (378) cpu_start: Application information:
I (378) cpu_start: Project name:     Touch
I (379) cpu_start: App version:      326fba0-dirty
I (379) cpu_start: Compile time:     Dec  2 2022 14:43:53
I (379) cpu_start: ELF file SHA256:  312038256095433c...
I (379) cpu_start: ESP-IDF:          v5.0
I (379) heap_init: Initializing. RAM available for dynamic allocation:
I (380) heap_init: At 3FC9B618 len 0004E0F8 (312 KiB): D/IRAM
I (380) heap_init: At 3FCE9710 len 00005724 (21 KiB): STACK/DRAM
I (380) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
I (381) heap_init: At 600FE010 len 00001FF0 (7 KiB): RTCRAM
I (381) esp_psram: Adding pool of 8192K of PSRAM memory to heap allocator
I (382) spi_flash: detected chip: mxic (opi)
I (382) spi_flash: flash io: opi_dtr
I (382) sleep: Configure to isolate all GPIO pins in sleep state
I (383) sleep: Enable automatic switching of GPIO sleep configuration
I (383) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (384) esp_psram: Reserving pool of 32K of internal memory for DMA/internal allocations
I (385) gpio: GPIO[1]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (385) uart: queue free spaces: 20
I (386) gpio: GPIO[18]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0

assert failed: lcd_ll_select_clk_src /IDF/components/hal/esp32s3/include/hal/lcd_ll.h:67 (false)

Backtrace: 0x40376036:0x3fcf3c00 0x4037bde5:0x3fcf3c20 0x40381971:0x3fcf3c40 0x42043dde:0x3fcf3d60 0x42044261:0x3fcf3da0 0x42017450:0x3fcf3dd0 0x4205c5db:0x3fcf3e70 0x42014cdd:0x3fcf3e90 0x420158f1:0x3fcf3eb0 0x4201354a:0x3fcf3f10 0x4200cac5:0x3fcf3f30 0x4200858d:0x3fcf3fd0 0x4205f6c3:0x3fcf3ff0 0x4037ea8d:0x3fcf4020
0x40376036: panic_abort at C:/Users/jerem/esp/esp-idf/components/esp_system/panic.c:412

0x4037bde5: esp_system_abort at C:/Users/jerem/esp/esp-idf/components/esp_system/esp_system.c:135

0x40381971: __assert_func at C:/Users/jerem/esp/esp-idf/components/newlib/assert.c:78

0x42043dde: lcd_ll_select_clk_src at C:/Users/jerem/esp/esp-idf/components/hal/esp32s3/include/hal/lcd_ll.h:67
 (inlined by) lcd_i80_select_periph_clock at C:/Users/jerem/esp/esp-idf/components/esp_lcd/src/esp_lcd_panel_io_i80.c:475

0x42044261: esp_lcd_new_i80_bus at C:/Users/jerem/esp/esp-idf/components/esp_lcd/src/esp_lcd_panel_io_i80.c:152 (discriminator 2)

0x42017450: lgfx::v1::Bus_Parallel8::init() at C:/Users/jerem/Source/Repos/<removed>/libraries/LovyanGFX/src/lgfx/v1/platforms/esp32s3/Bus_Parallel8.cpp:96

0x4205c5db: lgfx::v1::Panel_Device::init(bool) at C:/Users/jerem/Source/Repos/<removed>/libraries/LovyanGFX/src/lgfx/v1/panel/Panel_Device.cpp:60

0x42014cdd: lgfx::v1::Panel_LCD::init(bool) at C:/Users/jerem/Source/Repos/<removed>/libraries/LovyanGFX/src/lgfx/v1/panel/Panel_LCD.cpp:31

0x420158f1: lgfx::v1::Panel_SSD1963::init(bool) at C:/Users/jerem/Source/Repos/<removed>/libraries/LovyanGFX/src/lgfx/v1/panel/Panel_SSD1963.cpp:39

0x4201354a: lgfx::v1::LGFX_Device::init_impl(bool, bool) at C:/Users/jerem/Source/Repos/<removed>/libraries/LovyanGFX/src/lgfx/v1/LGFXBase.cpp:3099

0x4200cac5: lgfx::v1::LGFX_Device::begin() at c:\users\jerem\source\repos\<removed>\libraries\lovyangfx\src\lgfx\v1/LGFXBase.hpp:1139
 (inlined by) display_init at C:/Users/jerem/Source/Repos/<removed>/touch/main/display.cpp:93

0x4200858d: app_main at C:/Users/jerem/Source/Repos/<removed>/touch/main/main.cpp:37

0x4205f6c3: main_task at C:/Users/jerem/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/port_common.c:131 (discriminator 2)

0x4037ea8d: vPortTaskWrapper at C:/Users/jerem/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:151
sukesh-ak commented 1 year ago

I was about to open an issue for this. This is happening for Parallel 8bit & 16bit. SPI works fine.

IDF 4.4.3 on LovyanGFX release branch - Works. IDF 5.0 Release with LovyanGFX develop branch - Fails

Tested with

sukesh-ak commented 1 year ago

I can confirm that the fix (or workaround) mentioned by @JeremiahGillis works.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 1 year ago

This issue has been automatically closed because it has not had recent activity. Thank you for your contributions.