Files
desklock/firmware/sdkconfig.defaults
jpmschweitzerandClaude Opus 4.8 9521deddc5 feat(dev): device screenshot over USB
Adds a way to capture the live LVGL screen off the device and rebuild it
as a PNG on the host, so UI changes can be verified remotely without a
camera. A watcher task polls the USB-serial-JTAG RX for a trigger byte and
streams the current screen as raw RGB565 straight to the USB FIFO (framed
by ###SHOT_BEGIN/END### with a CRC); firmware/tools/device_shot.py and the
device-screenshot skill drive it from the host.

Writing straight to the USB FIFO bypasses the primary UART console, which
at 115200 baud would take ~37s per frame. The whole capability is behind
DESKLOCK_DEVMODE (off by default, enable at deploy time with
-DDESKLOCK_DEVMODE=ON) so production spends no internal RAM on the watcher
and nothing extra runs on the render path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LKPbR6DY2JygHbyLjxm7Uu
2026-07-15 20:24:41 +02:00

77 lines
2.8 KiB
Plaintext

# Target: Waveshare ESP32-P4-WIFI6-Touch-LCD-3.4C
CONFIG_IDF_TARGET="esp32p4"
# 32 MB NOR flash
CONFIG_ESPTOOLPY_FLASHSIZE_32MB=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
# PSRAM at 200 MHz — REQUIRED for the 800x800 MIPI-DSI framebuffer.
# 200 MHz is gated behind IDF_EXPERIMENTAL_FEATURES; without it the build
# silently falls back to 20 MHz and the DSI underruns (mirrors the official
# 08_lvgl_demo_v9 example config).
CONFIG_SPIRAM=y
CONFIG_IDF_EXPERIMENTAL_FEATURES=y
CONFIG_SPIRAM_SPEED_200M=y
CONFIG_SPIRAM_XIP_FROM_PSRAM=y
CONFIG_CACHE_L2_CACHE_256KB=y
CONFIG_CACHE_L2_CACHE_LINE_128B=y
CONFIG_COMPILER_OPTIMIZATION_PERF=y
CONFIG_FREERTOS_HZ=1000
# LVGL font for the bring-up placeholder face
CONFIG_LV_FONT_MONTSERRAT_48=y
# LVGL font for status/elapsed/clock chrome
CONFIG_LV_FONT_MONTSERRAT_28=y
# ESP-Hosted C6 radio
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y
# custom fonts are uncompressed, but enable the decoder as belt-and-braces
CONFIG_LV_USE_FONT_COMPRESSED=y
# lv_snapshot_take() — render the live screen to a buffer for the dev
# screenshot-over-USB dump (face_screenshot_dump)
CONFIG_LV_USE_SNAPSHOT=y
# ESP-Hosted board variant + wifi-remote data-path tuning (from factory brookesia config;
# without these the RPC control path works but data frames never flow)
CONFIG_SLAVE_IDF_TARGET_ESP32C6=y
CONFIG_ESP_HOSTED_CP_TARGET_ESP32C6=y
CONFIG_ESP_HOSTED_P4_DEV_BOARD_FUNC_BOARD=y
CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM=16
CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM=32
CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER_NUM=64
CONFIG_WIFI_RMT_AMPDU_TX_ENABLED=y
CONFIG_WIFI_RMT_TX_BA_WIN=32
CONFIG_WIFI_RMT_AMPDU_RX_ENABLED=y
CONFIG_WIFI_RMT_RX_BA_WIN=16
# hosted task stacks MUST stay in internal RAM (PSRAM stacks assert on P4)
CONFIG_ESP_HOSTED_DFLT_TASK_FROM_SPIRAM=n
# hosted 2.x: keep internal RAM for task stacks; buffers go to PSRAM.
# NOTE: tried MEMPOOL_PREFER_SPIRAM=n (buffers -> internal RAM) to keep esp-hosted's
# SDIO DMA off the PSRAM bus and stop it starving the DSI FIFO — but it exhausts
# internal RAM and boot-loops (crashes in esp-hosted init before Wi-Fi). Must stay =y.
CONFIG_ESP_HOSTED_MEMPOOL_PREFER_SPIRAM=y
# conservative SDIO clock for first data-path proof (raise after verification)
CONFIG_ESP_HOSTED_SDIO_CLOCK_FREQ_KHZ=20000
# headroom for diag event handlers that touch LVGL
CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=4096
# 1-bit SDIO: fixes the "Unrecoverable host sdio state" wedge family
# (esp-hosted-mcu #167/#148); 2.5MB/s is ~80x what voice needs
CONFIG_ESP_HOSTED_SDIO_1_BIT_BUS=y
# absorb the mic-audio upstream burst without stalling the SDIO write
CONFIG_ESP_HOSTED_SDIO_TX_Q_SIZE=32
CONFIG_ESP_HOSTED_SDIO_RX_Q_SIZE=32
# esp-sr wake word: "Computer" (wn9_computer_tts), models in the flash "model" partition
CONFIG_MODEL_IN_FLASH=y
CONFIG_SR_WN_WN9_COMPUTER_TTS=y