Skip to content

Commit 4b50fb4

Browse files
committed
Set custom sdkconfig base
1 parent c9e1da8 commit 4b50fb4

File tree

3 files changed

+152
-9
lines changed

3 files changed

+152
-9
lines changed

firmware/boards/ESP32_GENERIC_S3/mpconfigboard.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
set(IDF_TARGET esp32s3)
22

33
set(SDKCONFIG_DEFAULTS
4-
${MICROPY_ESP32_DIR}/boards/sdkconfig.base
4+
sdkconfig.base
55
${MICROPY_ESP32_DIR}/boards/sdkconfig.usb
66
${MICROPY_ESP32_DIR}/boards/sdkconfig.ble
77
${MICROPY_ESP32_DIR}/boards/sdkconfig.spiram_sx
Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
22
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
3-
# For cmake build
4-
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=
5-
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=
6-
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
7-
CONFIG_ESPTOOLPY_FLASHSIZE_32MB=
8-
9-
CONFIG_PARTITION_TABLE_CUSTOM=y
10-
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-16MiB.csv"
3+
# For cmake build

firmware/boards/sdkconfig.base

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
# MicroPython on ESP32, ESP IDF configuration
2+
# The following options override the defaults
3+
4+
CONFIG_IDF_FIRMWARE_CHIP_ID=0x0000
5+
6+
# Compiler options: use -O2 and disable assertions to improve performance
7+
CONFIG_COMPILER_OPTIMIZATION_PERF=y
8+
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE=y
9+
10+
# Application manager
11+
CONFIG_APP_EXCLUDE_PROJECT_VER_VAR=y
12+
CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR=y
13+
14+
# Bootloader config
15+
CONFIG_BOOTLOADER_LOG_LEVEL_WARN=y
16+
CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP=y
17+
CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y
18+
19+
# Change default log level to "ERROR" (instead of "INFO")
20+
CONFIG_LOG_DEFAULT_LEVEL_ERROR=y
21+
22+
# Set the maximum included log level higher than the default,
23+
# so esp.osdebug() can enable more logging at runtime.
24+
#
25+
# To increase the max log verbosity to Debug or Verbose instead, comment
26+
# CONFIG_LOG_MAXIMUM_LEVEL_INFO=y and uncomment one of the other settings.
27+
#
28+
# If not needed, the next line can be commented entirely to save binary size.
29+
CONFIG_LOG_MAXIMUM_LEVEL_INFO=y
30+
#CONFIG_LOG_MAXIMUM_LEVEL_DEBUG=y
31+
#CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE=y
32+
33+
# Main XTAL Config
34+
# Only on: ESP32
35+
CONFIG_XTAL_FREQ_AUTO=y
36+
37+
# ESP System Settings
38+
# Only on: ESP32, ESP32S3
39+
CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=n
40+
CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=n
41+
42+
# Power Management
43+
CONFIG_PM_ENABLE=y
44+
45+
# Memory protection
46+
# This is required to allow allocating IRAM
47+
CONFIG_ESP_SYSTEM_MEMPROT_FEATURE=n
48+
49+
# FreeRTOS
50+
CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=2
51+
CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y
52+
CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP=n
53+
54+
# UDP
55+
CONFIG_LWIP_PPP_SUPPORT=y
56+
CONFIG_LWIP_PPP_PAP_SUPPORT=y
57+
CONFIG_LWIP_PPP_CHAP_SUPPORT=y
58+
59+
# SSL
60+
# Use 4kiB output buffer instead of default 16kiB
61+
CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y
62+
CONFIG_MBEDTLS_HAVE_TIME_DATE=y
63+
CONFIG_MBEDTLS_PLATFORM_TIME_ALT=y
64+
CONFIG_MBEDTLS_HAVE_TIME=y
65+
66+
# Enable DTLS
67+
CONFIG_MBEDTLS_SSL_PROTO_DTLS=y
68+
69+
# Disable ALPN support as it's not implemented in MicroPython
70+
CONFIG_MBEDTLS_SSL_ALPN=n
71+
72+
# Disable slow or unused EC curves
73+
CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=n
74+
CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=n
75+
CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=n
76+
CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=n
77+
78+
# Disable certificate bundle as it's not implemented in MicroPython
79+
CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=n
80+
CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=n
81+
82+
# Allow mbedTLS to allocate from PSRAM or internal memory
83+
#
84+
# (The ESP-IDF default is internal-only, partly for physical security to prevent
85+
# possible information leakage from unencrypted PSRAM contents on the original
86+
# ESP32 - no PSRAM encryption on that chip. MicroPython doesn't support flash
87+
# encryption and is already storing the Python heap in PSRAM so this isn't a
88+
# significant factor in overall physical security.)
89+
CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC=y
90+
91+
# ULP coprocessor support
92+
# Only on: ESP32, ESP32S2, ESP32S3
93+
CONFIG_ULP_COPROC_ENABLED=y
94+
CONFIG_ULP_COPROC_TYPE_FSM=y
95+
CONFIG_ULP_COPROC_RESERVE_MEM=2040
96+
97+
# For cmake build
98+
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=
99+
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=
100+
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
101+
CONFIG_ESPTOOLPY_FLASHSIZE_32MB=
102+
103+
CONFIG_PARTITION_TABLE_CUSTOM=y
104+
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-16MiB.csv"
105+
106+
# To reduce iRAM usage
107+
CONFIG_ESP32_WIFI_IRAM_OPT=n
108+
CONFIG_ESP32_WIFI_RX_IRAM_OPT=n
109+
CONFIG_SPI_MASTER_ISR_IN_IRAM=n
110+
CONFIG_SPI_SLAVE_ISR_IN_IRAM=n
111+
CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR=n
112+
CONFIG_PERIPH_CTRL_FUNC_IN_IRAM=n
113+
114+
# Legacy ADC Calibration Configuration
115+
# Only on: ESP32
116+
CONFIG_ADC_CAL_EFUSE_TP_ENABLE=y
117+
CONFIG_ADC_CAL_EFUSE_VREF_ENABLE=y
118+
CONFIG_ADC_CAL_LUT_ENABLE=y
119+
120+
# UART Configuration
121+
CONFIG_UART_ISR_IN_IRAM=y
122+
123+
# IDF 5 deprecated
124+
CONFIG_PCNT_SUPPRESS_DEPRECATE_WARN=y
125+
CONFIG_RMT_SUPPRESS_DEPRECATE_WARN=y
126+
127+
CONFIG_ETH_USE_SPI_ETHERNET=y
128+
CONFIG_ETH_SPI_ETHERNET_W5500=y
129+
CONFIG_ETH_SPI_ETHERNET_KSZ8851SNL=y
130+
CONFIG_ETH_SPI_ETHERNET_DM9051=y
131+
132+
# Using newlib "nano" formatting saves size on SoCs where "nano" formatting
133+
# functions are in ROM. ESP32-C6 (and possibly other new chips) have "full"
134+
# newlib formatting in ROM instead and should override this, check
135+
# ESP_ROM_HAS_NEWLIB_NANO_FORMAT in ESP-IDF.
136+
CONFIG_NEWLIB_NANO_FORMAT=y
137+
138+
# IRAM/DRAM split protection is a memory protection feature on some parts
139+
# that support SOC_CPU_IDRAM_SPLIT_USING_PMP, eg. C2, C5, C6, H2
140+
# Due to limitations in the PMP system this feature breaks native emitters
141+
# so is disabled by default.
142+
CONFIG_ESP_SYSTEM_PMP_IDRAM_SPLIT=n
143+
144+
# Further limit total sockets in TIME-WAIT when there are many short-lived
145+
# connections.
146+
CONFIG_LWIP_MAX_ACTIVE_TCP=12
147+
148+
# Enable new I2C slave API, and disable conflict check.
149+
CONFIG_I2C_SKIP_LEGACY_CONFLICT_CHECK=y
150+
CONFIG_I2C_ENABLE_SLAVE_DRIVER_VERSION_2=y

0 commit comments

Comments
 (0)