Add esp32s2psram dev target with mbedTLS PSRAM override#1202
Merged
Conversation
Tasmota's prebuilt mbedTLS sets CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=1, which forces every TLS allocation into internal SRAM and ignores PSRAM even when it's available. Override the calloc/free hooks at runtime so SSL record buffers and BIGNUM workspace land in PSRAM, freeing ~40 KB of internal heap during an active TLS session. The override is gated by both the BOARD_HAS_PSRAM compile flag and a runtime ESP.getPsramSize() > 0 check, so production board profiles (esp32dev, esp32-solo1, esp32-s2-saola-1, esp32-c3-devkitm-1, esp32-s3-devkitc-1 — none of which define BOARD_HAS_PSRAM) are completely unaffected. Fallback to MALLOC_CAP_INTERNAL preserves today's behavior if PSRAM allocation ever fails. Also adds an [env:esp32s2psram] platformio.ini target for the Wemos S2 Mini (lolin_s2_mini, ESP32-S2FNR2) used for dev/testing.
🔧 PR Build ArtifactsVersion: All environments built successfully. Download the zip files:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an
esp32s2psrambuild env for ESP32-S2 boards with PSRAM, including an mbedTLS PSRAM allocation override. Dev/build target only; not part of the release matrix. Builds clean (and esp32 unaffected).