|
| 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=y |
| 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 | +# Disable ALPN support as it's not implemented in MicroPython |
| 67 | +CONFIG_MBEDTLS_SSL_ALPN=n |
| 68 | + |
| 69 | +# Disable slow or unused EC curves |
| 70 | +CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=n |
| 71 | +CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=n |
| 72 | +CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=n |
| 73 | +CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=n |
| 74 | + |
| 75 | +# Disable certificate bundle as it's not implemented in MicroPython |
| 76 | +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=n |
| 77 | +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=n |
| 78 | + |
| 79 | +# Allow mbedTLS to allocate from PSRAM or internal memory |
| 80 | +# |
| 81 | +# (The ESP-IDF default is internal-only, partly for physical security to prevent |
| 82 | +# possible information leakage from unencrypted PSRAM contents on the original |
| 83 | +# ESP32 - no PSRAM encryption on that chip. MicroPython doesn't support flash |
| 84 | +# encryption and is already storing the Python heap in PSRAM so this isn't a |
| 85 | +# significant factor in overall physical security.) |
| 86 | +CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC=y |
| 87 | + |
| 88 | +# ULP coprocessor support |
| 89 | +# Only on: ESP32, ESP32S2, ESP32S3 |
| 90 | +CONFIG_ULP_COPROC_ENABLED=y |
| 91 | +CONFIG_ULP_COPROC_TYPE_FSM=y |
| 92 | +CONFIG_ULP_COPROC_RESERVE_MEM=2040 |
| 93 | + |
| 94 | +# For cmake build |
| 95 | +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y |
| 96 | +CONFIG_PARTITION_TABLE_CUSTOM=y |
| 97 | +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions-4MiB.csv" |
| 98 | + |
| 99 | +# To reduce iRAM usage |
| 100 | +CONFIG_ESP32_WIFI_IRAM_OPT=n |
| 101 | +CONFIG_ESP32_WIFI_RX_IRAM_OPT=n |
| 102 | +CONFIG_SPI_MASTER_ISR_IN_IRAM=n |
| 103 | +CONFIG_SPI_SLAVE_ISR_IN_IRAM=n |
| 104 | +CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR=n |
| 105 | +CONFIG_PERIPH_CTRL_FUNC_IN_IRAM=n |
| 106 | + |
| 107 | +# Legacy ADC Calibration Configuration |
| 108 | +# Only on: ESP32 |
| 109 | +CONFIG_ADC_CAL_EFUSE_TP_ENABLE=y |
| 110 | +CONFIG_ADC_CAL_EFUSE_VREF_ENABLE=y |
| 111 | +CONFIG_ADC_CAL_LUT_ENABLE=y |
| 112 | + |
| 113 | +# UART Configuration |
| 114 | +CONFIG_UART_ISR_IN_IRAM=y |
| 115 | + |
| 116 | +# IDF 5 deprecated |
| 117 | +CONFIG_ADC_SUPPRESS_DEPRECATE_WARN=y |
| 118 | +CONFIG_RMT_SUPPRESS_DEPRECATE_WARN=y |
| 119 | + |
| 120 | +CONFIG_ETH_USE_SPI_ETHERNET=y |
| 121 | +CONFIG_ETH_SPI_ETHERNET_W5500=y |
| 122 | +CONFIG_ETH_SPI_ETHERNET_KSZ8851SNL=y |
| 123 | +CONFIG_ETH_SPI_ETHERNET_DM9051=y |
| 124 | + |
| 125 | +# Using newlib "nano" formatting saves size on SoCs where "nano" formatting |
| 126 | +# functions are in ROM. Note some newer chips (c2,c6) have "full" newlib |
| 127 | +# formatting in ROM instead and should override this, check |
| 128 | +# ESP_ROM_HAS_NEWLIB_NANO_FORMAT. |
| 129 | +CONFIG_NEWLIB_NANO_FORMAT=y |
| 130 | + |
| 131 | +# IRAM/DRAM split protection is a memory protection feature on some parts |
| 132 | +# that support SOC_CPU_IDRAM_SPLIT_USING_PMP, eg. C2, C5, C6, H2 |
| 133 | +# Due to limitations in the PMP system this feature breaks native emitters |
| 134 | +# so is disabled by default. |
| 135 | +CONFIG_ESP_SYSTEM_PMP_IDRAM_SPLIT=n |
| 136 | + |
| 137 | +# Further limit total sockets in TIME-WAIT when there are many short-lived |
| 138 | +# connections. |
| 139 | +CONFIG_LWIP_MAX_ACTIVE_TCP=12 |
0 commit comments