Skip to content

Fix ADR-045 display never refreshing (LVGL tick) + add ST7789 LCD HAL#890

Open
markt-heximal wants to merge 1 commit into
ruvnet:mainfrom
markt-heximal:fix/adr-045-lvgl-tick-st7789
Open

Fix ADR-045 display never refreshing (LVGL tick) + add ST7789 LCD HAL#890
markt-heximal wants to merge 1 commit into
ruvnet:mainfrom
markt-heximal:fix/adr-045-lvgl-tick-st7789

Conversation

@markt-heximal
Copy link
Copy Markdown

What

Fixes #889, and adds an ST7789 SPI-LCD panel HAL.

1. Display never refreshes — the critical fix

The ADR-045 LVGL UI only ever rendered its boot frame: LVGL's tick never advanced, so the 30 ms refresh timer never fired and live readouts never reached the panel. main/lv_conf.h sets LV_TICK_CUSTOM 1, but the managed lvgl/lvgl component is Kconfig-configured and ignores lv_conf.h (# CONFIG_LV_TICK_CUSTOM is not set), and nothing called lv_tick_inc().

Fix: an esp_timer that calls lv_tick_inc(2) every 2 ms in display_task_start() after lv_init(). Host-independent → works headless. This affects every panel, including the existing SH8601 AMOLED.

Isolated with a backlight-breathe beacon (LEDC, bypasses LVGL/SPI): backlight pulsed (task loop alive) while on-screen content stayed frozen → the failure is LVGL refresh, not the task or panel.

2. ST7789 SPI LCD HAL

display_hal.c only implemented the SH8601/RM67162 QSPI AMOLED path. Added display_hal_st7789.c (ESP-IDF built-in esp_lcd_new_panel_st7789 + CST816 touch + LEDC backlight) for the Waveshare ESP32-S3-Touch-LCD-1.69 (240×280), selected via a new DISPLAY_PANEL Kconfig choice — CMakeLists.txt compiles exactly one panel HAL + matching UI. Added a compact display_ui_st7789.c since the 4-view AMOLED UI is laid out for 368×448.

Files

  • display_task.cLVGL tick timer (the fix) + backlight self-heal
  • display_hal_st7789.c, display_ui_st7789.c — new ST7789 panel HAL + compact 240×280 UI
  • display_hal.{c,h}display_hal_refresh() (backlight re-assert)
  • Kconfig.projbuildDISPLAY_PANEL choice + ST7789 pins/geometry/touch
  • CMakeLists.txt — per-panel HAL/UI selection
  • sdkconfig.defaults.st7789 — build overlay (panel select, fonts, bar widget)

Testing

  • Built with ESP-IDF v5.4 (espressif/idf:release-v5.4), target esp32s3.
  • Flashed to a Waveshare ESP32-S3-Touch-LCD-1.69: panel init OK, CST816 touch detected, live UI (heartbeat + activity bar tracking CSI motion/presence), running concurrently with the full CSI pipeline on the other core — verified on USB and standalone on a charger.

Note

The LCD board boot-loops from a startup-inrush brownout on a single host-USB port (full-screen draws + WiFi connect at once); mitigated by avoiding full-white init frames + a dimmable backlight, and a ≥2 A supply resolves it fully.

🤖 Generated with Claude Code

- Add an esp_timer-driven lv_tick_inc() in the display task. Without it
  LVGL's tick never advances, its 30ms refresh timer never fires, and the
  panel only ever shows the boot frame (CONFIG_LV_TICK_CUSTOM is unset and
  lv_conf.h is ignored by the Kconfig-driven managed lvgl component).
  Fixes ruvnet#889.
- Add display_hal_st7789.c: ST7789V2 SPI LCD + CST816 touch + LEDC backlight
  HAL (Waveshare ESP32-S3-Touch-LCD-1.69), selected via a new DISPLAY_PANEL
  Kconfig choice; CMake compiles exactly one panel HAL.
- Add display_ui_st7789.c: compact 240x280 UI (the 4-view AMOLED UI is laid
  out for 368x448 and overflows a 1.69in panel).
- display_hal_refresh() backlight re-assert for transient brownout recovery.
- sdkconfig.defaults.st7789 build overlay (panel select + fonts + bar).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ADR-045 display never refreshes — LVGL tick never advances (CONFIG_LV_TICK_CUSTOM unset, no lv_tick_inc())

1 participant