diff --git a/ports/espressif/esp-idf-config/sdkconfig-esp32s2.defaults b/ports/espressif/esp-idf-config/sdkconfig-esp32s2.defaults index 9020572ccb..ac3e909dfc 100644 --- a/ports/espressif/esp-idf-config/sdkconfig-esp32s2.defaults +++ b/ports/espressif/esp-idf-config/sdkconfig-esp32s2.defaults @@ -83,12 +83,12 @@ CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y # end of Sleep Config # -# ESP System Settings +# PHY # -CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE=y -# end of ESP System Settings +# CONFIG_ESP_PHY_ENABLE_USB is not set +# end of PHY -CONFIG_ESP_SYSTEM_MEMPROT_DEPCHECK=y +CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE=y # # Memory protection # @@ -151,10 +151,6 @@ CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y # CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 CONFIG_ESP32_PHY_MAX_TX_POWER=20 -CONFIG_ESP32S2_PANIC_PRINT_HALT=y -# CONFIG_ESP32S2_PANIC_PRINT_REBOOT is not set -# CONFIG_ESP32S2_PANIC_SILENT_REBOOT is not set -# CONFIG_ESP32S2_PANIC_GDBSTUB is not set CONFIG_ESP32S2_ALLOW_RTC_FAST_MEM_AS_HEAP=y CONFIG_ESP32H2_MEMPROT_FEATURE=y CONFIG_ESP32H2_MEMPROT_FEATURE_LOCK=y diff --git a/ports/espressif/esp-idf-config/sdkconfig-esp32s3.defaults b/ports/espressif/esp-idf-config/sdkconfig-esp32s3.defaults index 4f3614692b..e655f4ceb1 100644 --- a/ports/espressif/esp-idf-config/sdkconfig-esp32s3.defaults +++ b/ports/espressif/esp-idf-config/sdkconfig-esp32s3.defaults @@ -86,6 +86,8 @@ CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES=4 # end of MAC Config CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND=y + +CONFIG_ESP_PHY_ENABLE_USB=y # CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0 is not set CONFIG_ESP_MAIN_TASK_AFFINITY_CPU1=y # CONFIG_ESP_MAIN_TASK_AFFINITY_NO_AFFINITY is not set @@ -130,10 +132,6 @@ CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y # CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 CONFIG_ESP32_PHY_MAX_TX_POWER=20 -# CONFIG_ESP32S2_PANIC_PRINT_HALT is not set -# CONFIG_ESP32S2_PANIC_PRINT_REBOOT is not set -CONFIG_ESP32S2_PANIC_SILENT_REBOOT=y -# CONFIG_ESP32S2_PANIC_GDBSTUB is not set CONFIG_ESP32S2_ALLOW_RTC_FAST_MEM_AS_HEAP=y # CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set # CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set diff --git a/ports/espressif/esp-idf-config/sdkconfig-opt.defaults b/ports/espressif/esp-idf-config/sdkconfig-opt.defaults index 0d0e75af0e..273303446e 100644 --- a/ports/espressif/esp-idf-config/sdkconfig-opt.defaults +++ b/ports/espressif/esp-idf-config/sdkconfig-opt.defaults @@ -75,6 +75,10 @@ CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE=y CONFIG_OPTIMIZATION_ASSERTIONS_SILENT=y # CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set CONFIG_OPTIMIZATION_ASSERTION_LEVEL=1 +# CONFIG_ESP32S2_PANIC_PRINT_HALT is not set +# CONFIG_ESP32S2_PANIC_PRINT_REBOOT is not set +CONFIG_ESP32S2_PANIC_SILENT_REBOOT=y +# CONFIG_ESP32S2_PANIC_GDBSTUB is not set # CONFIG_CONSOLE_UART_DEFAULT is not set # CONFIG_CONSOLE_UART_CUSTOM is not set CONFIG_ESP_CONSOLE_UART_NONE=y diff --git a/ports/espressif/esp-idf-config/sdkconfig.defaults b/ports/espressif/esp-idf-config/sdkconfig.defaults index 3bf9a09c26..f4efac4063 100644 --- a/ports/espressif/esp-idf-config/sdkconfig.defaults +++ b/ports/espressif/esp-idf-config/sdkconfig.defaults @@ -246,7 +246,6 @@ CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=y # CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION is not set CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=20 CONFIG_ESP_PHY_MAX_TX_POWER=20 -CONFIG_ESP_PHY_ENABLE_USB=y # end of PHY # CONFIG_PM_ENABLE is not set diff --git a/ports/espressif/supervisor/port.c b/ports/espressif/supervisor/port.c index c8cb344aae..d6eb32b395 100644 --- a/ports/espressif/supervisor/port.c +++ b/ports/espressif/supervisor/port.c @@ -81,7 +81,17 @@ #include "esp32/spiram.h" #endif +// Heap sizes for when there is no external RAM for CircuitPython to use +// exclusively. +#ifdef CONFIG_IDF_TARGET_ESP32S2 #define HEAP_SIZE (48 * 1024) +#endif +#ifdef CONFIG_IDF_TARGET_ESP32S3 +#define HEAP_SIZE (176 * 1024) +#endif +#ifdef CONFIG_IDF_TARGET_ESP32C3 +#define HEAP_SIZE (88 * 1024) +#endif uint32_t *heap; uint32_t heap_size; diff --git a/ports/espressif/tools/update_sdkconfig.py b/ports/espressif/tools/update_sdkconfig.py index a9d61532bb..ce174fd12a 100644 --- a/ports/espressif/tools/update_sdkconfig.py +++ b/ports/espressif/tools/update_sdkconfig.py @@ -48,6 +48,7 @@ TARGET_SETTINGS = [ "CONFIG_SDK_TOOLPREFIX", "CONFIG_TOOLPREFIX", "ESP_SLEEP_GPIO_RESET_WORKAROUND", + "CONFIG_ESP_PHY_ENABLE_USB", ] BOARD_SETTINGS = [