From bf81ac4ae5683a6d0c4cff43ec0cdc31c678f05e Mon Sep 17 00:00:00 2001 From: David Montero Crespo Date: Wed, 19 Aug 2026 10:47:37 +0200 Subject: [PATCH] feat(compile): esp32p4 defaults to PSRAM enabled The Function-EV module always carries 32 MB AP-hex PSRAM and esp_lcd allocates DSI framebuffers from it unconditionally - without it the board's flagship peripheral cannot run. Explicit psram=disabled still wins; the UI only sends the field after the user opens the board-options modal. Validated: an optionless espidf compile now embeds esp_psram. --- backend/app/services/espidf_compiler.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/app/services/espidf_compiler.py b/backend/app/services/espidf_compiler.py index 4fe747d1..742a169a 100644 --- a/backend/app/services/espidf_compiler.py +++ b/backend/app/services/espidf_compiler.py @@ -2601,6 +2601,14 @@ class ESPIDFCompiler: if idf_target in ('esp32c3', 'esp32c6', 'esp32c5'): normalized['psram'] = 'disabled' + # The P4-Function-EV module always carries 32 MB AP-hex PSRAM and + # esp_lcd allocates DSI framebuffers from it unconditionally - the + # board's flagship peripheral needs it. Default ON unless the + # request explicitly says otherwise (the UI only sends the field + # once the user opens the board-options modal). + if idf_target == 'esp32p4' and 'psram' not in (opts or {}): + normalized['psram'] = 'enabled' + # ESP32-C3 / ESP32-C6 top out at 160 MHz — clamp the historical 240 # default (and any stale higher value) instead of failing the build. # (On C3 the 240 choice was always an unknown kconfig symbol that