Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions variants/esp32/ESP32_GENERIC_S3/LCD_4_3/mpconfigvariant.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Upstream's octal-PSRAM variant, unchanged. This board's own settings are the
# sdkconfig beside this file, which build_mp.py appends last.
# Upstream's octal-PSRAM variant, unchanged. This board needs nothing beyond
# what every S3 build gets (variants/esp32/sdkconfig.esp32s3).
include(${MICROPY_BOARD_DIR}/mpconfigvariant_SPIRAM_OCT.cmake)
25 changes: 0 additions & 25 deletions variants/esp32/ESP32_GENERIC_S3/LCD_4_3/sdkconfig

This file was deleted.

32 changes: 5 additions & 27 deletions variants/esp32/ESP32_GENERIC_S3/LCD_7/sdkconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,8 @@ CONFIG_ESP_WIFI_RX_BA_WIN=8
CONFIG_LWIP_TCP_WND_DEFAULT=16384
CONFIG_LWIP_TCP_RECVMBOX_SIZE=16

# 1 ms tick. At 100 Hz, MicroPython's sleep_ms() under one tick falls through
# to mp_hal_delay_us() and busy-waits with the GIL held: appdev's 10 ms loop
# kept the UI thread 54 % busy while idle and starved every other Python
# thread, and 2-5 ms native waits rounded down to zero ticks.
CONFIG_FREERTOS_HZ=1000

# Caches sized for LVGL. Its code runs from flash and its objects and
# framebuffers live in PSRAM, which the RGB scanout is streaming from at the
# same time; with the port's 16 KB instruction cache and 32-byte lines every
# LVGL call ran 5-10x slower than its code. Measured on the remote's UI
# (2026-09-25): 64-byte lines took a full-screen redraw from 176 to 146 ms;
# a 32 KB instruction cache then took a list row from 66 to 44 ms and the
# redraw to 117 ms.
#
# A 64 KB data cache on top, measured while the board also decodes and
# streams audio: full redraw 205 -> 147 ms, panel switch 88 -> 59 ms, 30
# list rows built 780 -> 399 ms and laid out 608 -> 335 ms. The same layout
# runs ~216x faster on a desktop, so this board is memory-bound, and the
# data cache is the lever. Together the caches take 48 KB of internal RAM:
# free internal went 54 -> 23 KB. Soaked 30 min of real use (about 25 skips
# and track picks, Wi-Fi streaming and a USB host running): the minimum
# stayed at 17 KB, with no allocation failures, Wi-Fi drops or audio
# stalls. (The 24-byte failure above came from every malloc under 8 KB
# landing in internal RAM; ALWAYSINTERNAL=512 sends those to PSRAM now.)
CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y
CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y
CONFIG_ESP32S3_DATA_CACHE_64KB=y
# The 1 ms tick and the larger caches come from every S3's settings now. With
# them, free internal RAM under the remote's UI went 54 -> 23 KB, and a 30 min
# soak of real use stayed above 17 KB with no allocation failures, Wi-Fi drops
# or audio stalls. (A 24-byte failure on this board came from every malloc
# under 8 KB landing in internal RAM; ALWAYSINTERNAL=512 sends those to PSRAM.)
26 changes: 26 additions & 0 deletions variants/esp32/sdkconfig.esp32s3
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,29 @@ CONFIG_LWIP_TCP_SACK_OUT=y
CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y
CONFIG_ESP_WIFI_RX_BA_WIN=16
CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=48

# A 1 ms tick and caches sized for LVGL, on every S3 board, whether or not it
# shipped with a display: a display added after flashing gets the same speed.
#
# The tick: at the port's 100 Hz, any wait shorter than 10 ms rounds to a whole
# tick. DotClockFramebuffer.refresh() polls for the panel to take the new frame
# with vTaskDelay(1), a 10 ms sleep at 100 Hz, and sleep_ms() under one tick
# busy-waits with the GIL held.
#
# The caches: LVGL's code runs from flash and its objects and frame buffers
# live in PSRAM, so the port's 16 KB instruction cache, 32 KB data cache and
# 32-byte lines starve it. Together these take 48 KB of internal RAM.
#
# lv_test_timer's kit run, median of three, port defaults -> these four:
# Waveshare LCD-4.3 (RGB panel) 10.4 -> 17.7 fps (the tick alone: 17.7)
# LilyGO T-Embed (SPI panel) 59.5 -> 66.9 fps, with the frame period at
# 1 ms (at the standard 33 ms it's pinned at
# 30 either way); free internal RAM with the
# display up went 175,867 -> 161,295 B
# Waveshare LCD-7, under its remote UI: a full-screen redraw 205 -> 147 ms
# A 36-minute Wi-Fi and TLS soak on the LCD-4.3 with these never had less than
# 94 KB of internal RAM free.
CONFIG_FREERTOS_HZ=1000
CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y
CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y
CONFIG_ESP32S3_DATA_CACHE_64KB=y