-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathsdkconfig.defaults
More file actions
40 lines (30 loc) · 1.67 KB
/
sdkconfig.defaults
File metadata and controls
40 lines (30 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#
# SDK Configuration defaults for optimizing memory, especially for SSL/TLS
#
# ======================== mbedTLS PSRAM Configuration ========================
# Force mbedTLS to attempt allocations in PSRAM first for its internal buffers.
# This is CRUCIAL for reducing internal heap usage during SSL handshakes.
CONFIG_MBEDTLS_MEM_ALLOC_STRATEGY_SPIRAM=y
# Enable PSRAM specific optimisations within mbedTLS if available/applicable
CONFIG_MBEDTLS_SPIRAM_SETUP=y
# Ensure dynamic allocation for mbedTLS buffers is enabled (usually default)
CONFIG_MBEDTLS_DYNAMIC_BUFFER=y
# OPTIONAL BUT RECOMMENDED: Reduce SSL Maximum Fragment Length
# Default is 16384. Reducing this significantly lowers the peak memory needed
# for SSL buffers (input and output). Values like 8192 or 4096 are common.
# Trade-off: Might slightly decrease throughput for very large data transfers,
# but usually negligible for API calls and WebSockets. Start with 8192.
CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=4096
# ======================== Other Memory Related Settings ========================
# These might already be set by your board definition or other flags,
# but explicitly setting them here ensures they are applied.
# Enable general SPIRAM support
CONFIG_ESP32S3_SPIRAM_SUPPORT=y
# Select the PSRAM mode (Octal SPI assumed for most S3 boards)
# Check your specific board documentation if unsure. Common options:
CONFIG_SPIRAM_MODE_OCT=y
CONFIG_SPIRAM_MODE_QUAD=n # Ensure only one mode is selected
# Enable PSRAM cache workaround (often needed for stability)
CONFIG_SPIRAM_CACHE_WORKAROUND=y
# You can also try adjusting other settings like buffer sizes if needed,
# but the above are the most impactful for SSL memory usage.