From bb88338118957c2214a4c0a33cd4a152e2e1f8ba Mon Sep 17 00:00:00 2001 From: Marius Vikhammer Date: Fri, 7 Jan 2022 12:22:56 +0800 Subject: [PATCH] system: move kconfig options out of target component Moved the following kconfig options out of the target component: * ESP32_X_BROWNOUT_* -> esp_system * ESP32_X_DEBUG_OCDAWARE -> esp_system * APP_NO_BLOBS -> build type (main kconfig) --- Kconfig | 7 +++ components/bt/Kconfig | 2 +- components/esp32/Kconfig | 57 ------------------ components/esp32/sdkconfig.rename | 12 ---- components/esp32c2/Kconfig | 57 ------------------ components/esp32c3/Kconfig | 59 ------------------- components/esp32h2/Kconfig | 58 ------------------ components/esp32s2/Kconfig | 54 ----------------- components/esp32s3/Kconfig | 55 ----------------- components/esp_hw_support/cpu_util.c | 7 +-- components/esp_phy/CMakeLists.txt | 2 +- components/esp_phy/Kconfig | 2 +- components/esp_system/Kconfig | 11 ++++ components/esp_system/port/brownout.c | 14 +---- .../esp_system/port/soc/esp32/Kconfig.system | 52 ++++++++++++++++ .../port/soc/esp32c2/Kconfig.system | 45 ++++++++++++++ .../port/soc/esp32c3/Kconfig.system | 45 ++++++++++++++ .../port/soc/esp32h2/Kconfig.system | 45 ++++++++++++++ .../port/soc/esp32s2/Kconfig.system | 49 +++++++++++++++ .../port/soc/esp32s3/Kconfig.system | 49 +++++++++++++++ components/esp_system/sdkconfig.rename | 12 ++++ components/esp_system/sdkconfig.rename.esp32 | 13 ++++ .../esp_system/sdkconfig.rename.esp32c3 | 14 +++++ .../esp_system/sdkconfig.rename.esp32s2 | 14 +++++ .../esp_system/sdkconfig.rename.esp32s3 | 17 ++++++ components/esp_system/startup.c | 7 +-- components/esp_wifi/CMakeLists.txt | 2 +- components/freertos/Kconfig | 2 +- .../mdns/test_afl_fuzz_host/sdkconfig.h | 12 ++-- docs/en/api-guides/fatal-errors.rst | 4 +- .../jtag-debugging/tips-and-quirks.rst | 2 +- docs/zh_CN/api-guides/fatal-errors.rst | 4 +- .../jtag-debugging/tips-and-quirks.rst | 2 +- sdkconfig.rename | 1 + tools/ldgen/samples/sdkconfig | 23 ++++---- 35 files changed, 406 insertions(+), 405 deletions(-) create mode 100644 components/esp_system/port/soc/esp32/Kconfig.system create mode 100644 components/esp_system/port/soc/esp32c2/Kconfig.system create mode 100644 components/esp_system/port/soc/esp32c3/Kconfig.system create mode 100644 components/esp_system/port/soc/esp32h2/Kconfig.system create mode 100644 components/esp_system/port/soc/esp32s2/Kconfig.system create mode 100644 components/esp_system/port/soc/esp32s3/Kconfig.system create mode 100644 components/esp_system/sdkconfig.rename.esp32s3 diff --git a/Kconfig b/Kconfig index 1ea412ef6c..5d8896fd1f 100644 --- a/Kconfig +++ b/Kconfig @@ -194,6 +194,13 @@ mainmenu "Espressif IoT Development Framework Configuration" If enabled, all date, time, and path information would be eliminated. A .gdbinit file would be create automatically. (or will be append if you have one already) + config APP_NO_BLOBS + bool "No Binary Blobs" + default n + help + If enabled, this disables the linking of binary libraries in the application build. Note + that after enabling this Wi-Fi/Bluetooth will not work. + endmenu # Build type source "$COMPONENT_KCONFIGS_PROJBUILD_SOURCE_FILE" diff --git a/components/bt/Kconfig b/components/bt/Kconfig index 8a15de6b86..59b67049c4 100644 --- a/components/bt/Kconfig +++ b/components/bt/Kconfig @@ -3,7 +3,7 @@ menu "Bluetooth" config BT_ENABLED bool "Bluetooth" - depends on (IDF_TARGET_ESP32 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3) + depends on SOC_BT_SUPPORTED && !APP_NO_BLOBS help Select this option to enable Bluetooth and show the submenu with Bluetooth configuration choices. diff --git a/components/esp32/Kconfig b/components/esp32/Kconfig index 72cba90904..c68af9770e 100644 --- a/components/esp32/Kconfig +++ b/components/esp32/Kconfig @@ -500,63 +500,6 @@ menu "ESP32-specific" default 0x4000 if ESP32_MEMMAP_TRACEMEM && !ESP32_MEMMAP_TRACEMEM_TWOBANKS default 0x0 - config ESP32_DEBUG_OCDAWARE - bool "Make exception and panic handlers JTAG/OCD aware" - default y - select FREERTOS_DEBUG_OCDAWARE - help - The FreeRTOS panic and unhandled exception handers can detect a JTAG OCD debugger and - instead of panicking, have the debugger stop on the offending instruction. - - config ESP32_BROWNOUT_DET - bool "Hardware brownout detect & reset" - depends on !IDF_ENV_FPGA - default y - help - The ESP32 has a built-in brownout detector which can detect if the voltage is lower than - a specific value. If this happens, it will reset the chip in order to prevent unintended - behaviour. - - choice ESP32_BROWNOUT_DET_LVL_SEL - prompt "Brownout voltage level" - depends on ESP32_BROWNOUT_DET - default ESP32_BROWNOUT_DET_LVL_SEL_0 - help - The brownout detector will reset the chip when the supply voltage is approximately - below this level. Note that there may be some variation of brownout voltage level - between each ESP32 chip. - - #The voltage levels here are estimates, more work needs to be done to figure out the exact voltages - #of the brownout threshold levels. - config ESP32_BROWNOUT_DET_LVL_SEL_0 - bool "2.43V +/- 0.05" - config ESP32_BROWNOUT_DET_LVL_SEL_1 - bool "2.48V +/- 0.05" - config ESP32_BROWNOUT_DET_LVL_SEL_2 - bool "2.58V +/- 0.05" - config ESP32_BROWNOUT_DET_LVL_SEL_3 - bool "2.62V +/- 0.05" - config ESP32_BROWNOUT_DET_LVL_SEL_4 - bool "2.67V +/- 0.05" - config ESP32_BROWNOUT_DET_LVL_SEL_5 - bool "2.70V +/- 0.05" - config ESP32_BROWNOUT_DET_LVL_SEL_6 - bool "2.77V +/- 0.05" - config ESP32_BROWNOUT_DET_LVL_SEL_7 - bool "2.80V +/- 0.05" - endchoice - - config ESP32_BROWNOUT_DET_LVL - int - default 0 if ESP32_BROWNOUT_DET_LVL_SEL_0 - default 1 if ESP32_BROWNOUT_DET_LVL_SEL_1 - default 2 if ESP32_BROWNOUT_DET_LVL_SEL_2 - default 3 if ESP32_BROWNOUT_DET_LVL_SEL_3 - default 4 if ESP32_BROWNOUT_DET_LVL_SEL_4 - default 5 if ESP32_BROWNOUT_DET_LVL_SEL_5 - default 6 if ESP32_BROWNOUT_DET_LVL_SEL_6 - default 7 if ESP32_BROWNOUT_DET_LVL_SEL_7 - choice ESP32_TIME_SYSCALL prompt "Timers used for gettimeofday function" default ESP32_TIME_SYSCALL_USE_RTC_HRT diff --git a/components/esp32/sdkconfig.rename b/components/esp32/sdkconfig.rename index da62213b7d..60bc3289a4 100644 --- a/components/esp32/sdkconfig.rename +++ b/components/esp32/sdkconfig.rename @@ -13,21 +13,9 @@ CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL CONFIG_ESP32_RTC_CLK_SRC CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_OSC CONFIG_ESP32_RTC_CLK_SRC_EXT_OSC CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_8MD256 CONFIG_ESP32_RTC_CLK_SRC_INT_8MD256 CONFIG_DISABLE_BASIC_ROM_CONSOLE CONFIG_ESP32_DISABLE_BASIC_ROM_CONSOLE -CONFIG_NO_BLOBS CONFIG_ESP32_NO_BLOBS CONFIG_COMPATIBLE_PRE_V2_1_BOOTLOADERS CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS CONFIG_ESP32_ULP_COPROC_ENABLED CONFIG_ULP_COPROC_ENABLED CONFIG_ESP32_ULP_COPROC_RESERVE_MEM CONFIG_ULP_COPROC_RESERVE_MEM -CONFIG_BROWNOUT_DET CONFIG_ESP32_BROWNOUT_DET -CONFIG_BROWNOUT_DET_LVL_SEL CONFIG_ESP32_BROWNOUT_DET_LVL_SEL -CONFIG_BROWNOUT_DET_LVL_SEL_0 CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_0 -CONFIG_BROWNOUT_DET_LVL_SEL_1 CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_1 -CONFIG_BROWNOUT_DET_LVL_SEL_2 CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_2 -CONFIG_BROWNOUT_DET_LVL_SEL_3 CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_3 -CONFIG_BROWNOUT_DET_LVL_SEL_4 CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_4 -CONFIG_BROWNOUT_DET_LVL_SEL_5 CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_5 -CONFIG_BROWNOUT_DET_LVL_SEL_6 CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_6 -CONFIG_BROWNOUT_DET_LVL_SEL_7 CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_7 -CONFIG_BROWNOUT_DET_LVL CONFIG_ESP32_BROWNOUT_DET_LVL CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1 CONFIG_ESP32_TIME_SYSCALL_USE_RTC_HRT CONFIG_ESP32_TIME_SYSCALL_USE_FRC1 CONFIG_ESP32_TIME_SYSCALL_USE_HRT # SPI RAM config diff --git a/components/esp32c2/Kconfig b/components/esp32c2/Kconfig index a4bc83363d..f4d2ff7740 100644 --- a/components/esp32c2/Kconfig +++ b/components/esp32c2/Kconfig @@ -56,13 +56,6 @@ menu "ESP32C2-Specific" endmenu - config ESP32C2_DEBUG_OCDAWARE - bool "Make exception and panic handlers JTAG/OCD aware" - default y - select FREERTOS_DEBUG_OCDAWARE - help - The FreeRTOS panic and unhandled exception handers can detect a JTAG OCD debugger and - instead of panicking, have the debugger stop on the offending instruction. config ESP32C2_DEBUG_STUBS_ENABLE bool "OpenOCD debug stubs" @@ -72,48 +65,6 @@ menu "ESP32C2-Specific" Debug stubs are used by OpenOCD to execute pre-compiled onboard code which does some useful debugging, e.g. GCOV data dump. - config ESP32C2_BROWNOUT_DET - bool "Hardware brownout detect & reset" - default y - help - The ESP32C2 has a built-in brownout detector which can detect if the voltage is lower than - a specific value. If this happens, it will reset the chip in order to prevent unintended - behaviour. - - choice ESP32C2_BROWNOUT_DET_LVL_SEL - prompt "Brownout voltage level" - depends on ESP32C2_BROWNOUT_DET - default ESP32C2_BROWNOUT_DET_LVL_SEL_7 - help - The brownout detector will reset the chip when the supply voltage is approximately - below this level. Note that there may be some variation of brownout voltage level - between each chip. - - #The voltage levels here are estimates, more work needs to be done to figure out the exact voltages - #of the brownout threshold levels. - config ESP32C2_BROWNOUT_DET_LVL_SEL_7 - bool "2.51V" - config ESP32C2_BROWNOUT_DET_LVL_SEL_6 - bool "2.64V" - config ESP32C2_BROWNOUT_DET_LVL_SEL_5 - bool "2.76V" - config ESP32C2_BROWNOUT_DET_LVL_SEL_4 - bool "2.92V" - config ESP32C2_BROWNOUT_DET_LVL_SEL_3 - bool "3.10V" - config ESP32C2_BROWNOUT_DET_LVL_SEL_2 - bool "3.27V" - endchoice - - config ESP32C2_BROWNOUT_DET_LVL - int - default 2 if ESP32C2_BROWNOUT_DET_LVL_SEL_2 - default 3 if ESP32C2_BROWNOUT_DET_LVL_SEL_3 - default 4 if ESP32C2_BROWNOUT_DET_LVL_SEL_4 - default 5 if ESP32C2_BROWNOUT_DET_LVL_SEL_5 - default 6 if ESP32C2_BROWNOUT_DET_LVL_SEL_6 - default 7 if ESP32C2_BROWNOUT_DET_LVL_SEL_7 - choice ESP32C2_TIME_SYSCALL prompt "Timers used for gettimeofday function" default ESP32C2_TIME_SYSCALL_USE_RTC_SYSTIMER @@ -187,14 +138,6 @@ menu "ESP32C2-Specific" In case more value will help improve the definition of the launch of the crystal. If the crystal could not start, it will be switched to internal RC. - config ESP32C2_NO_BLOBS - bool "No Binary Blobs" - depends on !BT_ENABLED - default n - help - If enabled, this disables the linking of binary libraries in the application build. Note - that after enabling this Wi-Fi/Bluetooth will not work. - config ESP32C2_LIGHTSLEEP_GPIO_RESET_WORKAROUND # IDF-3904 bool "light sleep GPIO reset workaround" default y diff --git a/components/esp32c3/Kconfig b/components/esp32c3/Kconfig index 5d1b9ce8d1..d8681d9c63 100644 --- a/components/esp32c3/Kconfig +++ b/components/esp32c3/Kconfig @@ -48,57 +48,6 @@ menu "ESP32C3-Specific" default 2 if ESP32C3_REV_MIN_2 default 3 if ESP32C3_REV_MIN_3 - config ESP32C3_DEBUG_OCDAWARE - bool "Make exception and panic handlers JTAG/OCD aware" - default y - select FREERTOS_DEBUG_OCDAWARE - help - The FreeRTOS panic and unhandled exception handers can detect a JTAG OCD debugger and - instead of panicking, have the debugger stop on the offending instruction. - - config ESP32C3_BROWNOUT_DET - bool "Hardware brownout detect & reset" - depends on !IDF_ENV_FPGA - default y - help - The ESP32-C3 has a built-in brownout detector which can detect if the voltage is lower than - a specific value. If this happens, it will reset the chip in order to prevent unintended - behaviour. - - choice ESP32C3_BROWNOUT_DET_LVL_SEL - prompt "Brownout voltage level" - depends on ESP32C3_BROWNOUT_DET - default ESP32C3_BROWNOUT_DET_LVL_SEL_7 - help - The brownout detector will reset the chip when the supply voltage is approximately - below this level. Note that there may be some variation of brownout voltage level - between each chip. - - #The voltage levels here are estimates, more work needs to be done to figure out the exact voltages - #of the brownout threshold levels. - config ESP32C3_BROWNOUT_DET_LVL_SEL_7 - bool "2.51V" - config ESP32C3_BROWNOUT_DET_LVL_SEL_6 - bool "2.64V" - config ESP32C3_BROWNOUT_DET_LVL_SEL_5 - bool "2.76V" - config ESP32C3_BROWNOUT_DET_LVL_SEL_4 - bool "2.92V" - config ESP32C3_BROWNOUT_DET_LVL_SEL_3 - bool "3.10V" - config ESP32C3_BROWNOUT_DET_LVL_SEL_2 - bool "3.27V" - endchoice - - config ESP32C3_BROWNOUT_DET_LVL - int - default 2 if ESP32C3_BROWNOUT_DET_LVL_SEL_2 - default 3 if ESP32C3_BROWNOUT_DET_LVL_SEL_3 - default 4 if ESP32C3_BROWNOUT_DET_LVL_SEL_4 - default 5 if ESP32C3_BROWNOUT_DET_LVL_SEL_5 - default 6 if ESP32C3_BROWNOUT_DET_LVL_SEL_6 - default 7 if ESP32C3_BROWNOUT_DET_LVL_SEL_7 - choice ESP32C3_TIME_SYSCALL prompt "Timers used for gettimeofday function" default ESP32C3_TIME_SYSCALL_USE_RTC_SYSTIMER @@ -176,12 +125,4 @@ menu "ESP32C3-Specific" In case more value will help improve the definition of the launch of the crystal. If the crystal could not start, it will be switched to internal RC. - config ESP32C3_NO_BLOBS - bool "No Binary Blobs" - depends on !BT_ENABLED - default n - help - If enabled, this disables the linking of binary libraries in the application build. Note - that after enabling this Wi-Fi/Bluetooth will not work. - endmenu # ESP32C3-Specific diff --git a/components/esp32h2/Kconfig b/components/esp32h2/Kconfig index 46c70d0867..08ff6b8aa9 100644 --- a/components/esp32h2/Kconfig +++ b/components/esp32h2/Kconfig @@ -45,56 +45,6 @@ menu "ESP32H2-Specific" int default 0 if ESP32H2_REV_MIN_0 - config ESP32H2_DEBUG_OCDAWARE - bool "Make exception and panic handlers JTAG/OCD aware" - default y - select FREERTOS_DEBUG_OCDAWARE - help - The FreeRTOS panic and unhandled exception handers can detect a JTAG OCD debugger and - instead of panicking, have the debugger stop on the offending instruction. - - config ESP32H2_BROWNOUT_DET - bool "Hardware brownout detect & reset" - default y - help - The ESP32-C3 has a built-in brownout detector which can detect if the voltage is lower than - a specific value. If this happens, it will reset the chip in order to prevent unintended - behaviour. - - choice ESP32H2_BROWNOUT_DET_LVL_SEL - prompt "Brownout voltage level" - depends on ESP32H2_BROWNOUT_DET - default ESP32H2_BROWNOUT_DET_LVL_SEL_7 - help - The brownout detector will reset the chip when the supply voltage is approximately - below this level. Note that there may be some variation of brownout voltage level - between each chip. - - #The voltage levels here are estimates, more work needs to be done to figure out the exact voltages - #of the brownout threshold levels. - config ESP32H2_BROWNOUT_DET_LVL_SEL_7 - bool "2.51V" - config ESP32H2_BROWNOUT_DET_LVL_SEL_6 - bool "2.64V" - config ESP32H2_BROWNOUT_DET_LVL_SEL_5 - bool "2.76V" - config ESP32H2_BROWNOUT_DET_LVL_SEL_4 - bool "2.92V" - config ESP32H2_BROWNOUT_DET_LVL_SEL_3 - bool "3.10V" - config ESP32H2_BROWNOUT_DET_LVL_SEL_2 - bool "3.27V" - endchoice - - config ESP32H2_BROWNOUT_DET_LVL - int - default 2 if ESP32H2_BROWNOUT_DET_LVL_SEL_2 - default 3 if ESP32H2_BROWNOUT_DET_LVL_SEL_3 - default 4 if ESP32H2_BROWNOUT_DET_LVL_SEL_4 - default 5 if ESP32H2_BROWNOUT_DET_LVL_SEL_5 - default 6 if ESP32H2_BROWNOUT_DET_LVL_SEL_6 - default 7 if ESP32H2_BROWNOUT_DET_LVL_SEL_7 - choice ESP32H2_TIME_SYSCALL prompt "Timers used for gettimeofday function" default ESP32H2_TIME_SYSCALL_USE_RTC_SYSTIMER @@ -171,14 +121,6 @@ menu "ESP32H2-Specific" In case more value will help improve the definition of the launch of the crystal. If the crystal could not start, it will be switched to internal RC. - config ESP32H2_NO_BLOBS - bool "No Binary Blobs" - depends on !BT_ENABLED - default n - help - If enabled, this disables the linking of binary libraries in the application build. Note - that after enabling this Wi-Fi/Bluetooth will not work. - config ESP32H2_LIGHTSLEEP_GPIO_RESET_WORKAROUND bool "light sleep GPIO reset workaround" default y diff --git a/components/esp32s2/Kconfig b/components/esp32s2/Kconfig index cf6f413c65..33c3b5af0b 100644 --- a/components/esp32s2/Kconfig +++ b/components/esp32s2/Kconfig @@ -220,60 +220,6 @@ menu "ESP32S2-specific" default 0x4000 if ESP32S2_MEMMAP_TRACEMEM && !ESP32S2_MEMMAP_TRACEMEM_TWOBANKS default 0x0 - config ESP32S2_DEBUG_OCDAWARE - bool "Make exception and panic handlers JTAG/OCD aware" - default y - select FREERTOS_DEBUG_OCDAWARE - help - The FreeRTOS panic and unhandled exception handers can detect a JTAG OCD debugger and - instead of panicking, have the debugger stop on the offending instruction. - - config ESP32S2_BROWNOUT_DET - bool "Hardware brownout detect & reset" - depends on !IDF_ENV_FPGA - default y - help - The ESP32-S2 has a built-in brownout detector which can detect if the voltage is lower than - a specific value. If this happens, it will reset the chip in order to prevent unintended - behaviour. - - choice ESP32S2_BROWNOUT_DET_LVL_SEL - prompt "Brownout voltage level" - depends on ESP32S2_BROWNOUT_DET - default ESP32S2_BROWNOUT_DET_LVL_SEL_7 - help - The brownout detector will reset the chip when the supply voltage is approximately - below this level. Note that there may be some variation of brownout voltage level - between each ESP3-S2 chip. - - #The voltage levels here are estimates, more work needs to be done to figure out the exact voltages - #of the brownout threshold levels. - config ESP32S2_BROWNOUT_DET_LVL_SEL_7 - bool "2.44V" - config ESP32S2_BROWNOUT_DET_LVL_SEL_6 - bool "2.56V" - config ESP32S2_BROWNOUT_DET_LVL_SEL_5 - bool "2.67V" - config ESP32S2_BROWNOUT_DET_LVL_SEL_4 - bool "2.84V" - config ESP32S2_BROWNOUT_DET_LVL_SEL_3 - bool "2.98V" - config ESP32S2_BROWNOUT_DET_LVL_SEL_2 - bool "3.19V" - config ESP32S2_BROWNOUT_DET_LVL_SEL_1 - bool "3.30V" - endchoice - - config ESP32S2_BROWNOUT_DET_LVL - int - default 1 if ESP32S2_BROWNOUT_DET_LVL_SEL_1 - default 2 if ESP32S2_BROWNOUT_DET_LVL_SEL_2 - default 3 if ESP32S2_BROWNOUT_DET_LVL_SEL_3 - default 4 if ESP32S2_BROWNOUT_DET_LVL_SEL_4 - default 5 if ESP32S2_BROWNOUT_DET_LVL_SEL_5 - default 6 if ESP32S2_BROWNOUT_DET_LVL_SEL_6 - default 7 if ESP32S2_BROWNOUT_DET_LVL_SEL_7 - choice ESP32S2_TIME_SYSCALL prompt "Timers used for gettimeofday function" default ESP32S2_TIME_SYSCALL_USE_RTC_SYSTIMER diff --git a/components/esp32s3/Kconfig b/components/esp32s3/Kconfig index e48c14e6f7..84bd13543a 100644 --- a/components/esp32s3/Kconfig +++ b/components/esp32s3/Kconfig @@ -305,61 +305,6 @@ menu "ESP32S3-Specific" default 0x8000 if ESP32S3_MEMMAP_TRACEMEM && ESP32S3_MEMMAP_TRACEMEM_TWOBANKS default 0x4000 if ESP32S3_MEMMAP_TRACEMEM && !ESP32S3_MEMMAP_TRACEMEM_TWOBANKS default 0x0 - - config ESP32S3_DEBUG_OCDAWARE - bool "Make exception and panic handlers JTAG/OCD aware" - default y - select FREERTOS_DEBUG_OCDAWARE - help - The FreeRTOS panic and unhandled exception handers can detect a JTAG OCD debugger and - instead of panicking, have the debugger stop on the offending instruction. - - config ESP32S3_BROWNOUT_DET - bool "Hardware brownout detect & reset" - depends on !IDF_ENV_FPGA - default y - help - The ESP32-S3 has a built-in brownout detector which can detect if the voltage is lower than - a specific value. If this happens, it will reset the chip in order to prevent unintended - behaviour. - - choice ESP32S3_BROWNOUT_DET_LVL_SEL - prompt "Brownout voltage level" - depends on ESP32S3_BROWNOUT_DET - default ESP32S3_BROWNOUT_DET_LVL_SEL_7 - help - The brownout detector will reset the chip when the supply voltage is approximately - below this level. Note that there may be some variation of brownout voltage level - between each ESP3-S3 chip. - - #The voltage levels here are estimates, more work needs to be done to figure out the exact voltages - #of the brownout threshold levels. - config ESP32S3_BROWNOUT_DET_LVL_SEL_7 - bool "2.44V" - config ESP32S3_BROWNOUT_DET_LVL_SEL_6 - bool "2.56V" - config ESP32S3_BROWNOUT_DET_LVL_SEL_5 - bool "2.67V" - config ESP32S3_BROWNOUT_DET_LVL_SEL_4 - bool "2.84V" - config ESP32S3_BROWNOUT_DET_LVL_SEL_3 - bool "2.98V" - config ESP32S3_BROWNOUT_DET_LVL_SEL_2 - bool "3.19V" - config ESP32S3_BROWNOUT_DET_LVL_SEL_1 - bool "3.30V" - endchoice - - config ESP32S3_BROWNOUT_DET_LVL - int - default 1 if ESP32S3_BROWNOUT_DET_LVL_SEL_1 - default 2 if ESP32S3_BROWNOUT_DET_LVL_SEL_2 - default 3 if ESP32S3_BROWNOUT_DET_LVL_SEL_3 - default 4 if ESP32S3_BROWNOUT_DET_LVL_SEL_4 - default 5 if ESP32S3_BROWNOUT_DET_LVL_SEL_5 - default 6 if ESP32S3_BROWNOUT_DET_LVL_SEL_6 - default 7 if ESP32S3_BROWNOUT_DET_LVL_SEL_7 - choice ESP32S3_TIME_SYSCALL prompt "Timers used for gettimeofday function" default ESP32S3_TIME_SYSCALL_USE_RTC_SYSTIMER diff --git a/components/esp_hw_support/cpu_util.c b/components/esp_hw_support/cpu_util.c index 722fb35686..546d049b60 100644 --- a/components/esp_hw_support/cpu_util.c +++ b/components/esp_hw_support/cpu_util.c @@ -70,12 +70,7 @@ void IRAM_ATTR esp_cpu_clear_watchpoint(int no) bool IRAM_ATTR esp_cpu_in_ocd_debug_mode(void) { -#if CONFIG_ESP32_DEBUG_OCDAWARE || \ - CONFIG_ESP32S2_DEBUG_OCDAWARE || \ - CONFIG_ESP32S3_DEBUG_OCDAWARE || \ - CONFIG_ESP32C3_DEBUG_OCDAWARE || \ - CONFIG_ESP32H2_DEBUG_OCDAWARE || \ - CONFIG_ESP32C2_DEBUG_OCDAWARE +#if CONFIG_ESP_DEBUG_OCDAWARE return cpu_ll_is_debugger_attached(); #else return false; // Always return false if "OCD aware" is disabled diff --git a/components/esp_phy/CMakeLists.txt b/components/esp_phy/CMakeLists.txt index d505483386..25b776b86c 100644 --- a/components/esp_phy/CMakeLists.txt +++ b/components/esp_phy/CMakeLists.txt @@ -5,7 +5,7 @@ if(IDF_TARGET STREQUAL "esp32c2") return() endif() -if(CONFIG_ESP32_NO_BLOBS OR CONFIG_ESP32S2_NO_BLOBS) +if(CONFIG_APP_NO_BLOBS) set(link_binary_libs 0) set(ldfragments) else() diff --git a/components/esp_phy/Kconfig b/components/esp_phy/Kconfig index 89e4ea4cae..58a6b2d3d3 100644 --- a/components/esp_phy/Kconfig +++ b/components/esp_phy/Kconfig @@ -99,7 +99,7 @@ menu "PHY" config ESP_PHY_REDUCE_TX_POWER bool "Reduce PHY TX power when brownout reset" - depends on ESP32_BROWNOUT_DET + depends on ESP_BROWNOUT_DET default y help When brownout reset occurs, reduce PHY TX power to keep the code running. diff --git a/components/esp_system/Kconfig b/components/esp_system/Kconfig index 2b53214610..71acce2223 100644 --- a/components/esp_system/Kconfig +++ b/components/esp_system/Kconfig @@ -482,6 +482,14 @@ menu "ESP System Settings" Debug stubs are used by OpenOCD to execute pre-compiled onboard code which does some useful debugging stuff, e.g. GCOV data dump. + config ESP_DEBUG_OCDAWARE + bool "Make exception and panic handlers JTAG/OCD aware" + default y + select FREERTOS_DEBUG_OCDAWARE + help + The FreeRTOS panic and unhandled exception handers can detect a JTAG OCD debugger and + instead of panicking, have the debugger stop on the offending instruction. + choice ESP_SYSTEM_CHECK_INT_LEVEL prompt "Interrupt level to use for Interrupt Watchdog and other system checks" default ESP_SYSTEM_CHECK_INT_LEVEL_4 @@ -501,6 +509,9 @@ menu "ESP System Settings" Using level 4 interrupt for Interrupt Watchdog and other system checks. endchoice + # Insert chip-specific system config + rsource "./port/soc/$IDF_TARGET/Kconfig.system" + endmenu # ESP System Settings menu "IPC (Inter-Processor Call)" diff --git a/components/esp_system/port/brownout.c b/components/esp_system/port/brownout.c index a03c24b4f4..3f8500a58c 100644 --- a/components/esp_system/port/brownout.c +++ b/components/esp_system/port/brownout.c @@ -23,18 +23,8 @@ #include "sdkconfig.h" -#if defined(CONFIG_ESP32_BROWNOUT_DET_LVL) -#define BROWNOUT_DET_LVL CONFIG_ESP32_BROWNOUT_DET_LVL -#elif defined(CONFIG_ESP32S2_BROWNOUT_DET_LVL) -#define BROWNOUT_DET_LVL CONFIG_ESP32S2_BROWNOUT_DET_LVL -#elif defined(CONFIG_ESP32S3_BROWNOUT_DET_LVL) -#define BROWNOUT_DET_LVL CONFIG_ESP32S3_BROWNOUT_DET_LVL -#elif defined(CONFIG_ESP32C3_BROWNOUT_DET_LVL) -#define BROWNOUT_DET_LVL CONFIG_ESP32C3_BROWNOUT_DET_LVL -#elif defined(CONFIG_ESP32H2_BROWNOUT_DET_LVL) -#define BROWNOUT_DET_LVL CONFIG_ESP32H2_BROWNOUT_DET_LVL -#elif defined(CONFIG_ESP32C2_BROWNOUT_DET_LVL) -#define BROWNOUT_DET_LVL CONFIG_ESP32C2_BROWNOUT_DET_LVL +#if defined(CONFIG_ESP_BROWNOUT_DET_LVL) +#define BROWNOUT_DET_LVL CONFIG_ESP_BROWNOUT_DET_LVL #else #define BROWNOUT_DET_LVL 0 #endif diff --git a/components/esp_system/port/soc/esp32/Kconfig.system b/components/esp_system/port/soc/esp32/Kconfig.system new file mode 100644 index 0000000000..c7af8ce2c8 --- /dev/null +++ b/components/esp_system/port/soc/esp32/Kconfig.system @@ -0,0 +1,52 @@ +menu "Brownout Detector" + + config ESP_BROWNOUT_DET + bool "Hardware brownout detect & reset" + depends on !IDF_ENV_FPGA + default y + help + The ESP has a built-in brownout detector which can detect if the voltage is lower than + a specific value. If this happens, it will reset the chip in order to prevent unintended + behaviour. + + choice ESP_BROWNOUT_DET_LVL_SEL + prompt "Brownout voltage level" + depends on ESP_BROWNOUT_DET + default ESP_BROWNOUT_DET_LVL_SEL_0 + help + The brownout detector will reset the chip when the supply voltage is approximately + below this level. Note that there may be some variation of brownout voltage level + between each ESP chip. + + #The voltage levels here are estimates, more work needs to be done to figure out the exact voltages + #of the brownout threshold levels. + config ESP_BROWNOUT_DET_LVL_SEL_0 + bool "2.43V +/- 0.05" + config ESP_BROWNOUT_DET_LVL_SEL_1 + bool "2.48V +/- 0.05" + config ESP_BROWNOUT_DET_LVL_SEL_2 + bool "2.58V +/- 0.05" + config ESP_BROWNOUT_DET_LVL_SEL_3 + bool "2.62V +/- 0.05" + config ESP_BROWNOUT_DET_LVL_SEL_4 + bool "2.67V +/- 0.05" + config ESP_BROWNOUT_DET_LVL_SEL_5 + bool "2.70V +/- 0.05" + config ESP_BROWNOUT_DET_LVL_SEL_6 + bool "2.77V +/- 0.05" + config ESP_BROWNOUT_DET_LVL_SEL_7 + bool "2.80V +/- 0.05" + endchoice + + config ESP_BROWNOUT_DET_LVL + int + default 0 if ESP_BROWNOUT_DET_LVL_SEL_0 + default 1 if ESP_BROWNOUT_DET_LVL_SEL_1 + default 2 if ESP_BROWNOUT_DET_LVL_SEL_2 + default 3 if ESP_BROWNOUT_DET_LVL_SEL_3 + default 4 if ESP_BROWNOUT_DET_LVL_SEL_4 + default 5 if ESP_BROWNOUT_DET_LVL_SEL_5 + default 6 if ESP_BROWNOUT_DET_LVL_SEL_6 + default 7 if ESP_BROWNOUT_DET_LVL_SEL_7 + +endmenu diff --git a/components/esp_system/port/soc/esp32c2/Kconfig.system b/components/esp_system/port/soc/esp32c2/Kconfig.system new file mode 100644 index 0000000000..26c0ee743e --- /dev/null +++ b/components/esp_system/port/soc/esp32c2/Kconfig.system @@ -0,0 +1,45 @@ +menu "Brownout Detector" + config ESP_BROWNOUT_DET + bool "Hardware brownout detect & reset" + depends on !IDF_ENV_FPGA + default y + help + The ESP32-C2 has a built-in brownout detector which can detect if the voltage is lower than + a specific value. If this happens, it will reset the chip in order to prevent unintended + behaviour. + + choice ESP_BROWNOUT_DET_LVL_SEL + prompt "Brownout voltage level" + depends on ESP_BROWNOUT_DET + default ESP_BROWNOUT_DET_LVL_SEL_7 + help + The brownout detector will reset the chip when the supply voltage is approximately + below this level. Note that there may be some variation of brownout voltage level + between each chip. + + #The voltage levels here are estimates, more work needs to be done to figure out the exact voltages + #of the brownout threshold levels. + config ESP_BROWNOUT_DET_LVL_SEL_7 + bool "2.51V" + config ESP_BROWNOUT_DET_LVL_SEL_6 + bool "2.64V" + config ESP_BROWNOUT_DET_LVL_SEL_5 + bool "2.76V" + config ESP_BROWNOUT_DET_LVL_SEL_4 + bool "2.92V" + config ESP_BROWNOUT_DET_LVL_SEL_3 + bool "3.10V" + config ESP_BROWNOUT_DET_LVL_SEL_2 + bool "3.27V" + endchoice + + config ESP_BROWNOUT_DET_LVL + int + default 2 if ESP_BROWNOUT_DET_LVL_SEL_2 + default 3 if ESP_BROWNOUT_DET_LVL_SEL_3 + default 4 if ESP_BROWNOUT_DET_LVL_SEL_4 + default 5 if ESP_BROWNOUT_DET_LVL_SEL_5 + default 6 if ESP_BROWNOUT_DET_LVL_SEL_6 + default 7 if ESP_BROWNOUT_DET_LVL_SEL_7 + +endmenu diff --git a/components/esp_system/port/soc/esp32c3/Kconfig.system b/components/esp_system/port/soc/esp32c3/Kconfig.system new file mode 100644 index 0000000000..c0944b84ee --- /dev/null +++ b/components/esp_system/port/soc/esp32c3/Kconfig.system @@ -0,0 +1,45 @@ +menu "Brownout Detector" + config ESP_BROWNOUT_DET + bool "Hardware brownout detect & reset" + depends on !IDF_ENV_FPGA + default y + help + The ESP32-C3 has a built-in brownout detector which can detect if the voltage is lower than + a specific value. If this happens, it will reset the chip in order to prevent unintended + behaviour. + + choice ESP_BROWNOUT_DET_LVL_SEL + prompt "Brownout voltage level" + depends on ESP_BROWNOUT_DET + default ESP_BROWNOUT_DET_LVL_SEL_7 + help + The brownout detector will reset the chip when the supply voltage is approximately + below this level. Note that there may be some variation of brownout voltage level + between each chip. + + #The voltage levels here are estimates, more work needs to be done to figure out the exact voltages + #of the brownout threshold levels. + config ESP_BROWNOUT_DET_LVL_SEL_7 + bool "2.51V" + config ESP_BROWNOUT_DET_LVL_SEL_6 + bool "2.64V" + config ESP_BROWNOUT_DET_LVL_SEL_5 + bool "2.76V" + config ESP_BROWNOUT_DET_LVL_SEL_4 + bool "2.92V" + config ESP_BROWNOUT_DET_LVL_SEL_3 + bool "3.10V" + config ESP_BROWNOUT_DET_LVL_SEL_2 + bool "3.27V" + endchoice + + config ESP_BROWNOUT_DET_LVL + int + default 2 if ESP_BROWNOUT_DET_LVL_SEL_2 + default 3 if ESP_BROWNOUT_DET_LVL_SEL_3 + default 4 if ESP_BROWNOUT_DET_LVL_SEL_4 + default 5 if ESP_BROWNOUT_DET_LVL_SEL_5 + default 6 if ESP_BROWNOUT_DET_LVL_SEL_6 + default 7 if ESP_BROWNOUT_DET_LVL_SEL_7 + +endmenu diff --git a/components/esp_system/port/soc/esp32h2/Kconfig.system b/components/esp_system/port/soc/esp32h2/Kconfig.system new file mode 100644 index 0000000000..9523dcd171 --- /dev/null +++ b/components/esp_system/port/soc/esp32h2/Kconfig.system @@ -0,0 +1,45 @@ +menu "Brownout Detector" + + config ESP_BROWNOUT_DET + bool "Hardware brownout detect & reset" + default y + help + The ESP32-H2 has a built-in brownout detector which can detect if the voltage is lower than + a specific value. If this happens, it will reset the chip in order to prevent unintended + behaviour. + + choice ESP_BROWNOUT_DET_LVL_SEL + prompt "Brownout voltage level" + depends on ESP_BROWNOUT_DET + default ESP_BROWNOUT_DET_LVL_SEL_7 + help + The brownout detector will reset the chip when the supply voltage is approximately + below this level. Note that there may be some variation of brownout voltage level + between each chip. + + #The voltage levels here are estimates, more work needs to be done to figure out the exact voltages + #of the brownout threshold levels. + config ESP_BROWNOUT_DET_LVL_SEL_7 + bool "2.51V" + config ESP_BROWNOUT_DET_LVL_SEL_6 + bool "2.64V" + config ESP_BROWNOUT_DET_LVL_SEL_5 + bool "2.76V" + config ESP_BROWNOUT_DET_LVL_SEL_4 + bool "2.92V" + config ESP_BROWNOUT_DET_LVL_SEL_3 + bool "3.10V" + config ESP_BROWNOUT_DET_LVL_SEL_2 + bool "3.27V" + endchoice + + config ESP_BROWNOUT_DET_LVL + int + default 2 if ESP_BROWNOUT_DET_LVL_SEL_2 + default 3 if ESP_BROWNOUT_DET_LVL_SEL_3 + default 4 if ESP_BROWNOUT_DET_LVL_SEL_4 + default 5 if ESP_BROWNOUT_DET_LVL_SEL_5 + default 6 if ESP_BROWNOUT_DET_LVL_SEL_6 + default 7 if ESP_BROWNOUT_DET_LVL_SEL_7 + +endmenu diff --git a/components/esp_system/port/soc/esp32s2/Kconfig.system b/components/esp_system/port/soc/esp32s2/Kconfig.system new file mode 100644 index 0000000000..642eb31ac3 --- /dev/null +++ b/components/esp_system/port/soc/esp32s2/Kconfig.system @@ -0,0 +1,49 @@ +menu "Brownout Detector" + + config ESP_BROWNOUT_DET + bool "Hardware brownout detect & reset" + depends on !IDF_ENV_FPGA + default y + help + The ESP32-S2 has a built-in brownout detector which can detect if the voltage is lower than + a specific value. If this happens, it will reset the chip in order to prevent unintended + behaviour. + + choice ESP_BROWNOUT_DET_LVL_SEL + prompt "Brownout voltage level" + depends on ESP_BROWNOUT_DET + default ESP_BROWNOUT_DET_LVL_SEL_7 + help + The brownout detector will reset the chip when the supply voltage is approximately + below this level. Note that there may be some variation of brownout voltage level + between each ESP3-S2 chip. + + #The voltage levels here are estimates, more work needs to be done to figure out the exact voltages + #of the brownout threshold levels. + config ESP_BROWNOUT_DET_LVL_SEL_7 + bool "2.44V" + config ESP_BROWNOUT_DET_LVL_SEL_6 + bool "2.56V" + config ESP_BROWNOUT_DET_LVL_SEL_5 + bool "2.67V" + config ESP_BROWNOUT_DET_LVL_SEL_4 + bool "2.84V" + config ESP_BROWNOUT_DET_LVL_SEL_3 + bool "2.98V" + config ESP_BROWNOUT_DET_LVL_SEL_2 + bool "3.19V" + config ESP_BROWNOUT_DET_LVL_SEL_1 + bool "3.30V" + endchoice + + config ESP_BROWNOUT_DET_LVL + int + default 1 if ESP_BROWNOUT_DET_LVL_SEL_1 + default 2 if ESP_BROWNOUT_DET_LVL_SEL_2 + default 3 if ESP_BROWNOUT_DET_LVL_SEL_3 + default 4 if ESP_BROWNOUT_DET_LVL_SEL_4 + default 5 if ESP_BROWNOUT_DET_LVL_SEL_5 + default 6 if ESP_BROWNOUT_DET_LVL_SEL_6 + default 7 if ESP_BROWNOUT_DET_LVL_SEL_7 + +endmenu diff --git a/components/esp_system/port/soc/esp32s3/Kconfig.system b/components/esp_system/port/soc/esp32s3/Kconfig.system new file mode 100644 index 0000000000..9d54d3a40d --- /dev/null +++ b/components/esp_system/port/soc/esp32s3/Kconfig.system @@ -0,0 +1,49 @@ +menu "Brownout Detector" + + config ESP_BROWNOUT_DET + bool "Hardware brownout detect & reset" + depends on !IDF_ENV_FPGA + default y + help + The ESP32-S3 has a built-in brownout detector which can detect if the voltage is lower than + a specific value. If this happens, it will reset the chip in order to prevent unintended + behaviour. + + choice ESP_BROWNOUT_DET_LVL_SEL + prompt "Brownout voltage level" + depends on ESP_BROWNOUT_DET + default ESP_BROWNOUT_DET_LVL_SEL_7 + help + The brownout detector will reset the chip when the supply voltage is approximately + below this level. Note that there may be some variation of brownout voltage level + between each ESP3-S3 chip. + + #The voltage levels here are estimates, more work needs to be done to figure out the exact voltages + #of the brownout threshold levels. + config ESP_BROWNOUT_DET_LVL_SEL_7 + bool "2.44V" + config ESP_BROWNOUT_DET_LVL_SEL_6 + bool "2.56V" + config ESP_BROWNOUT_DET_LVL_SEL_5 + bool "2.67V" + config ESP_BROWNOUT_DET_LVL_SEL_4 + bool "2.84V" + config ESP_BROWNOUT_DET_LVL_SEL_3 + bool "2.98V" + config ESP_BROWNOUT_DET_LVL_SEL_2 + bool "3.19V" + config ESP_BROWNOUT_DET_LVL_SEL_1 + bool "3.30V" + endchoice + + config ESP_BROWNOUT_DET_LVL + int + default 1 if ESP_BROWNOUT_DET_LVL_SEL_1 + default 2 if ESP_BROWNOUT_DET_LVL_SEL_2 + default 3 if ESP_BROWNOUT_DET_LVL_SEL_3 + default 4 if ESP_BROWNOUT_DET_LVL_SEL_4 + default 5 if ESP_BROWNOUT_DET_LVL_SEL_5 + default 6 if ESP_BROWNOUT_DET_LVL_SEL_6 + default 7 if ESP_BROWNOUT_DET_LVL_SEL_7 + +endmenu diff --git a/components/esp_system/sdkconfig.rename b/components/esp_system/sdkconfig.rename index 4e3827fbb8..5a9dc895b7 100644 --- a/components/esp_system/sdkconfig.rename +++ b/components/esp_system/sdkconfig.rename @@ -27,3 +27,15 @@ CONFIG_TASK_WDT_TIMEOUT_S CONFIG_ESP_TASK_WDT_TIME CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0 CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0 CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1 CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1 CONFIG_ESP32_DEBUG_STUBS_ENABLE CONFIG_ESP_DEBUG_STUBS_ENABLE + +CONFIG_BROWNOUT_DET CONFIG_ESP_BROWNOUT_DET +CONFIG_BROWNOUT_DET_LVL_SEL CONFIG_ESP_BROWNOUT_DET_LVL_SEL +CONFIG_BROWNOUT_DET_LVL_SEL_0 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_0 +CONFIG_BROWNOUT_DET_LVL_SEL_1 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_1 +CONFIG_BROWNOUT_DET_LVL_SEL_2 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_2 +CONFIG_BROWNOUT_DET_LVL_SEL_3 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_3 +CONFIG_BROWNOUT_DET_LVL_SEL_4 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_4 +CONFIG_BROWNOUT_DET_LVL_SEL_5 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_5 +CONFIG_BROWNOUT_DET_LVL_SEL_6 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_6 +CONFIG_BROWNOUT_DET_LVL_SEL_7 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_7 +CONFIG_BROWNOUT_DET_LVL CONFIG_ESP_BROWNOUT_DET_LVL diff --git a/components/esp_system/sdkconfig.rename.esp32 b/components/esp_system/sdkconfig.rename.esp32 index c8b230b688..df1abf5edd 100644 --- a/components/esp_system/sdkconfig.rename.esp32 +++ b/components/esp_system/sdkconfig.rename.esp32 @@ -7,3 +7,16 @@ CONFIG_ESP32_PANIC_PRINT_REBOOT CONFIG_ESP_SYSTEM_PANIC_ CONFIG_ESP32_PANIC_SILENT_REBOOT CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT CONFIG_ESP32_PANIC_GDBSTUB CONFIG_ESP_SYSTEM_PANIC_GDBSTUB CONFIG_ESP32_ALLOW_RTC_FAST_MEM_AS_HEAP CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP +CONFIG_ESP32_DEBUG_OCDAWARE CONFIG_ESP_DEBUG_OCDAWARE + +CONFIG_ESP32_BROWNOUT_DET CONFIG_ESP_BROWNOUT_DET +CONFIG_ESP32_BROWNOUT_DET_LVL_SEL CONFIG_ESP_BROWNOUT_DET_LVL_SEL +CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_0 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_0 +CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_1 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_1 +CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_2 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_2 +CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_3 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_3 +CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_4 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_4 +CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_5 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_5 +CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_6 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_6 +CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_7 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_7 +CONFIG_ESP32_BROWNOUT_DET_LVL CONFIG_ESP_BROWNOUT_DET_LVL diff --git a/components/esp_system/sdkconfig.rename.esp32c3 b/components/esp_system/sdkconfig.rename.esp32c3 index a724a1f41f..25377f06dc 100644 --- a/components/esp_system/sdkconfig.rename.esp32c3 +++ b/components/esp_system/sdkconfig.rename.esp32c3 @@ -3,3 +3,17 @@ CONFIG_ESP32C3_MEMPROT_FEATURE CONFIG_ESP_SYSTEM_MEMPROT_FEATURE CONFIG_ESP32C3_MEMPROT_FEATURE_LOCK CONFIG_ESP_SYSTEM_MEMPROT_FEATURE_LOCK +CONFIG_ESP32C3_DEBUG_OCDAWARE CONFIG_ESP_DEBUG_OCDAWARE + +CONFIG_ESP32C3_BROWNOUT_DET CONFIG_ESP_BROWNOUT_DET +CONFIG_ESP32C3_BROWNOUT_DET CONFIG_ESP_BROWNOUT_DET +CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL CONFIG_ESP_BROWNOUT_DET_LVL_SEL +CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_0 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_0 +CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_1 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_1 +CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_2 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_2 +CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_3 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_3 +CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_4 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_4 +CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_5 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_5 +CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_6 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_6 +CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_7 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_7 +CONFIG_ESP32C3_BROWNOUT_DET_LVL CONFIG_ESP_BROWNOUT_DET_LVL diff --git a/components/esp_system/sdkconfig.rename.esp32s2 b/components/esp_system/sdkconfig.rename.esp32s2 index ac3027174b..e4f2f67579 100644 --- a/components/esp_system/sdkconfig.rename.esp32s2 +++ b/components/esp_system/sdkconfig.rename.esp32s2 @@ -9,3 +9,17 @@ CONFIG_ESP32S2_PANIC_GDBSTUB CONFIG_ESP_SYSTEM_PANIC_ CONFIG_ESP32S2_MEMPROT_FEATURE CONFIG_ESP_SYSTEM_MEMPROT_FEATURE CONFIG_ESP32S2_MEMPROT_FEATURE_LOCK CONFIG_ESP_SYSTEM_MEMPROT_FEATURE_LOCK CONFIG_ESP32S2_ALLOW_RTC_FAST_MEM_AS_HEAP CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP +CONFIG_ESP32S2_DEBUG_OCDAWARE CONFIG_ESP_DEBUG_OCDAWARE + +CONFIG_ESP32S2_BROWNOUT_DET CONFIG_ESP_BROWNOUT_DET +CONFIG_ESP32S2_BROWNOUT_DET CONFIG_ESP_BROWNOUT_DET +CONFIG_ESP32S2_BROWNOUT_DET_LVL_SEL CONFIG_ESP_BROWNOUT_DET_LVL_SEL +CONFIG_ESP32S2_BROWNOUT_DET_LVL_SEL_0 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_0 +CONFIG_ESP32S2_BROWNOUT_DET_LVL_SEL_1 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_1 +CONFIG_ESP32S2_BROWNOUT_DET_LVL_SEL_2 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_2 +CONFIG_ESP32S2_BROWNOUT_DET_LVL_SEL_3 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_3 +CONFIG_ESP32S2_BROWNOUT_DET_LVL_SEL_4 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_4 +CONFIG_ESP32S2_BROWNOUT_DET_LVL_SEL_5 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_5 +CONFIG_ESP32S2_BROWNOUT_DET_LVL_SEL_6 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_6 +CONFIG_ESP32S2_BROWNOUT_DET_LVL_SEL_7 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_7 +CONFIG_ESP32S2_BROWNOUT_DET_LVL CONFIG_ESP_BROWNOUT_DET_LVL diff --git a/components/esp_system/sdkconfig.rename.esp32s3 b/components/esp_system/sdkconfig.rename.esp32s3 new file mode 100644 index 0000000000..ce9c4c7f21 --- /dev/null +++ b/components/esp_system/sdkconfig.rename.esp32s3 @@ -0,0 +1,17 @@ +# sdkconfig replacement configurations for deprecated options formatted as +# CONFIG_DEPRECATED_OPTION CONFIG_NEW_OPTION + +CONFIG_ESP32S3_DEBUG_OCDAWARE CONFIG_ESP_DEBUG_OCDAWARE + +CONFIG_ESP32S3_BROWNOUT_DET CONFIG_ESP_BROWNOUT_DET +CONFIG_ESP32S3_BROWNOUT_DET CONFIG_ESP_BROWNOUT_DET +CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL CONFIG_ESP_BROWNOUT_DET_LVL_SEL +CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_0 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_0 +CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_1 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_1 +CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_2 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_2 +CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_3 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_3 +CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_4 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_4 +CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_5 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_5 +CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_6 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_6 +CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_7 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_7 +CONFIG_ESP32S3_BROWNOUT_DET_LVL CONFIG_ESP_BROWNOUT_DET_LVL diff --git a/components/esp_system/startup.c b/components/esp_system/startup.c index 67cd59d198..dab43faf2f 100644 --- a/components/esp_system/startup.c +++ b/components/esp_system/startup.c @@ -253,12 +253,7 @@ static void do_core_init(void) #endif } -#if CONFIG_ESP32_BROWNOUT_DET || \ - CONFIG_ESP32S2_BROWNOUT_DET || \ - CONFIG_ESP32S3_BROWNOUT_DET || \ - CONFIG_ESP32C3_BROWNOUT_DET || \ - CONFIG_ESP32H2_BROWNOUT_DET || \ - CONFIG_ESP32C2_BROWNOUT_DET +#if CONFIG_ESP_BROWNOUT_DET // [refactor-todo] leads to call chain rtc_is_register (driver) -> esp_intr_alloc (esp32/esp32s2) -> // malloc (newlib) -> heap_caps_malloc (heap), so heap must be at least initialized esp_brownout_init(); diff --git a/components/esp_wifi/CMakeLists.txt b/components/esp_wifi/CMakeLists.txt index 961bcccac7..4b37de238a 100644 --- a/components/esp_wifi/CMakeLists.txt +++ b/components/esp_wifi/CMakeLists.txt @@ -1,7 +1,7 @@ if(CONFIG_ESP32_WIFI_ENABLED) idf_build_get_property(idf_target IDF_TARGET) - if(CONFIG_ESP32_NO_BLOBS OR CONFIG_ESP32S2_NO_BLOBS) + if(CONFIG_APP_NO_BLOBS) set(link_binary_libs 0) set(ldfragments) else() diff --git a/components/freertos/Kconfig b/components/freertos/Kconfig index ecf77a7bd5..d047ed715f 100644 --- a/components/freertos/Kconfig +++ b/components/freertos/Kconfig @@ -439,7 +439,7 @@ menu "FreeRTOS" config FREERTOS_DEBUG_OCDAWARE bool help - Hidden option, gets selected by CONFIG_ESPxx_DEBUG_OCDAWARE + Hidden option, gets selected by CONFIG_ESP_DEBUG_OCDAWARE config FREERTOS_FPU_IN_ISR bool "Allow use of float inside Level 1 ISR (EXPERIMENTAL)" diff --git a/components/mdns/test_afl_fuzz_host/sdkconfig.h b/components/mdns/test_afl_fuzz_host/sdkconfig.h index e210526a95..d17d4f5e8f 100644 --- a/components/mdns/test_afl_fuzz_host/sdkconfig.h +++ b/components/mdns/test_afl_fuzz_host/sdkconfig.h @@ -66,10 +66,10 @@ #define CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR 1 #define CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES 4 #define CONFIG_ESP32_ULP_COPROC_RESERVE_MEM 0 -#define CONFIG_ESP32_DEBUG_OCDAWARE 1 -#define CONFIG_ESP32_BROWNOUT_DET 1 -#define CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_0 1 -#define CONFIG_ESP32_BROWNOUT_DET_LVL 0 +#define CONFIG_ESP_DEBUG_OCDAWARE 1 +#define CONFIG_ESP_BROWNOUT_DET 1 +#define CONFIG_ESP_BROWNOUT_DET_LVL_SEL_0 1 +#define CONFIG_ESP_BROWNOUT_DET_LVL 0 #define CONFIG_ESP32_REDUCE_PHY_TX_POWER 1 #define CONFIG_ESP32_TIME_SYSCALL_USE_RTC_HRT 1 #define CONFIG_ESP32_RTC_CLK_SRC_INT_RC 1 @@ -342,8 +342,8 @@ /* List of deprecated options */ #define CONFIG_ADC2_DISABLE_DAC CONFIG_ADC_DISABLE_DAC -#define CONFIG_BROWNOUT_DET CONFIG_ESP32_BROWNOUT_DET -#define CONFIG_BROWNOUT_DET_LVL_SEL_0 CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_0 +#define CONFIG_BROWNOUT_DET CONFIG_ESP_BROWNOUT_DET +#define CONFIG_BROWNOUT_DET_LVL_SEL_0 CONFIG_ESP_BROWNOUT_DET_LVL_SEL_0 #define CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG CONFIG_COMPILER_OPTIMIZATION_DEFAULT #define CONFIG_CONSOLE_UART_BAUDRATE CONFIG_ESP_CONSOLE_UART_BAUDRATE #define CONFIG_CONSOLE_UART_DEFAULT CONFIG_ESP_CONSOLE_UART_DEFAULT diff --git a/docs/en/api-guides/fatal-errors.rst b/docs/en/api-guides/fatal-errors.rst index 79fe982a7b..192366610f 100644 --- a/docs/en/api-guides/fatal-errors.rst +++ b/docs/en/api-guides/fatal-errors.rst @@ -71,7 +71,7 @@ Subsequent behavior of the panic handler can be set using :ref:`CONFIG_ESP_SYSTE The behavior of the panic handler is affected by two other configuration options. -- If :ref:`CONFIG_{IDF_TARGET_CFG_PREFIX}_DEBUG_OCDAWARE` is enabled (which is the default), the panic handler will detect whether a JTAG debugger is connected. If it is, execution will be halted and control will be passed to the debugger. In this case, registers and backtrace are not dumped to the console, and GDBStub / Core Dump functions are not used. +- If :ref:`CONFIG_ESP_DEBUG_OCDAWARE` is enabled (which is the default), the panic handler will detect whether a JTAG debugger is connected. If it is, execution will be halted and control will be passed to the debugger. In this case, registers and backtrace are not dumped to the console, and GDBStub / Core Dump functions are not used. - If the :doc:`Core Dump ` feature is enabled, then the system state (task stacks and registers) will be dumped to either Flash or UART, for later analysis. @@ -402,7 +402,7 @@ Other Fatal Errors Brownout ^^^^^^^^ -{IDF_TARGET_NAME} has a built-in brownout detector, which is enabled by default. The brownout detector can trigger a system reset if the supply voltage goes below a safe level. The brownout detector can be configured using :ref:`CONFIG_{IDF_TARGET_CFG_PREFIX}_BROWNOUT_DET` and :ref:`CONFIG_{IDF_TARGET_CFG_PREFIX}_BROWNOUT_DET_LVL_SEL` options. +{IDF_TARGET_NAME} has a built-in brownout detector, which is enabled by default. The brownout detector can trigger a system reset if the supply voltage goes below a safe level. The brownout detector can be configured using :ref:`CONFIG_ESP_BROWNOUT_DET` and :ref:`CONFIG_ESP_BROWNOUT_DET_LVL_SEL` options. When the brownout detector triggers, the following message is printed:: diff --git a/docs/en/api-guides/jtag-debugging/tips-and-quirks.rst b/docs/en/api-guides/jtag-debugging/tips-and-quirks.rst index 3695ba8a09..8ac5db7e29 100644 --- a/docs/en/api-guides/jtag-debugging/tips-and-quirks.rst +++ b/docs/en/api-guides/jtag-debugging/tips-and-quirks.rst @@ -58,7 +58,7 @@ Support options for OpenOCD at compile time ESP-IDF has some support options for OpenOCD debugging which can be set at compile time: -* :ref:`CONFIG_{IDF_TARGET_CFG_PREFIX}_DEBUG_OCDAWARE` is enabled by default. If a panic or unhandled exception is thrown and a JTAG debugger is connected (ie OpenOCD is running), ESP-IDF will break into the debugger. +* :ref:`CONFIG_ESP_DEBUG_OCDAWARE` is enabled by default. If a panic or unhandled exception is thrown and a JTAG debugger is connected (ie OpenOCD is running), ESP-IDF will break into the debugger. * :ref:`CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK` (disabled by default) sets watchpoint index 1 (the second of two) at the end of any task stack. This is the most accurate way to debug task stack overflows. Click the link for more details. diff --git a/docs/zh_CN/api-guides/fatal-errors.rst b/docs/zh_CN/api-guides/fatal-errors.rst index 48f216387e..2831cfc67d 100644 --- a/docs/zh_CN/api-guides/fatal-errors.rst +++ b/docs/zh_CN/api-guides/fatal-errors.rst @@ -71,7 +71,7 @@ 紧急处理程序的行为还受到另外两个配置项的影响: -- 如果使能了 :ref:`CONFIG_{IDF_TARGET_CFG_PREFIX}_DEBUG_OCDAWARE` (默认),紧急处理程序会检测 {IDF_TARGET_NAME} 是否已经连接 JTAG 调试器。如果检测成功,程序会暂停运行,并将控制权交给调试器。在这种情况下,寄存器和回溯不会被打印到控制台,并且也不会使用 GDB Stub 和 Core Dump 的功能。 +- 如果使能了 :ref:`CONFIG_ESP_DEBUG_OCDAWARE` (默认),紧急处理程序会检测 {IDF_TARGET_NAME} 是否已经连接 JTAG 调试器。如果检测成功,程序会暂停运行,并将控制权交给调试器。在这种情况下,寄存器和回溯不会被打印到控制台,并且也不会使用 GDB Stub 和 Core Dump 的功能。 - 如果使能了 :doc:`内核转储 ` 功能,系统状态(任务堆栈和寄存器)会被转储到 flash 或者 UART 以供后续分析。 @@ -400,7 +400,7 @@ Interrupt wdt timeout on CPU0 / CPU1 掉电 ^^^^ -{IDF_TARGET_NAME} 内部集成掉电检测电路,并且会默认启用。如果电源电压低于安全值,掉电检测器可以触发系统复位。掉电检测器可以使用 :ref:`CONFIG_{IDF_TARGET_CFG_PREFIX}_BROWNOUT_DET` 和 :ref:`CONFIG_{IDF_TARGET_CFG_PREFIX}_BROWNOUT_DET_LVL_SEL` 这两个选项进行设置。 +{IDF_TARGET_NAME} 内部集成掉电检测电路,并且会默认启用。如果电源电压低于安全值,掉电检测器可以触发系统复位。掉电检测器可以使用 :ref:`CONFIG_ESP_BROWNOUT_DET` 和 :ref:`CONFIG_ESP_BROWNOUT_DET_LVL_SEL` 这两个选项进行设置。 当掉电检测器被触发时,会打印如下信息:: diff --git a/docs/zh_CN/api-guides/jtag-debugging/tips-and-quirks.rst b/docs/zh_CN/api-guides/jtag-debugging/tips-and-quirks.rst index 448bfd4db1..7dfe6b86a7 100644 --- a/docs/zh_CN/api-guides/jtag-debugging/tips-and-quirks.rst +++ b/docs/zh_CN/api-guides/jtag-debugging/tips-and-quirks.rst @@ -58,7 +58,7 @@ OpenOCD 支持的编译时的选项 ESP-IDF 有一些针对 OpenOCD 调试功能的选项可以在编译时进行设置: -* :ref:`CONFIG_{IDF_TARGET_CFG_PREFIX}_DEBUG_OCDAWARE` 默认会被使能。如果程序抛出了不可修复或者未处理的异常,并且此时已经连接上了 JTAG 调试器(即 OpenOCD 正在运行),那么 ESP-IDF 将会进入调试器工作模式。 +* :ref:`CONFIG_ESP_DEBUG_OCDAWARE` 默认会被使能。如果程序抛出了不可修复或者未处理的异常,并且此时已经连接上了 JTAG 调试器(即 OpenOCD 正在运行),那么 ESP-IDF 将会进入调试器工作模式。 * :ref:`CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK` 默认没有使能。在所有任务堆栈的末尾设置观察点,从 1 号开始索引。这是调试任务堆栈溢出的最准确的方式。 diff --git a/sdkconfig.rename b/sdkconfig.rename index e7f17f3dc8..7e9b411017 100644 --- a/sdkconfig.rename +++ b/sdkconfig.rename @@ -21,3 +21,4 @@ CONFIG_STACK_CHECK_ALL CONFIG_COMPILER_STACK_CHECK_MODE_A CONFIG_STACK_CHECK CONFIG_COMPILER_STACK_CHECK CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS CONFIG_DISABLE_GCC8_WARNINGS CONFIG_COMPILER_DISABLE_GCC8_WARNINGS +CONFIG_NO_BLOBS CONFIG_APP_NO_BLOBS diff --git a/tools/ldgen/samples/sdkconfig b/tools/ldgen/samples/sdkconfig index 7fbb7b94be..a63cbf64be 100644 --- a/tools/ldgen/samples/sdkconfig +++ b/tools/ldgen/samples/sdkconfig @@ -158,23 +158,23 @@ CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT= CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT= CONFIG_ESP_SYSTEM_PANIC_GDBSTUB= -CONFIG_ESP32_DEBUG_OCDAWARE=y +CONFIG_ESP_DEBUG_OCDAWARE=y CONFIG_ESP_INT_WDT=y CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 CONFIG_ESP_TASK_WDT=y CONFIG_ESP_TASK_WDT_PANIC= CONFIG_ESP_TASK_WDT_TIMEOUT_S=5 CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y -CONFIG_ESP32_BROWNOUT_DET=y -CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_0=y -CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_1= -CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_2= -CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_3= -CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_4= -CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_5= -CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_6= -CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_7= -CONFIG_ESP32_BROWNOUT_DET_LVL=0 +CONFIG_ESP_BROWNOUT_DET=y +CONFIG_ESP_BROWNOUT_DET_LVL_SEL_0=y +CONFIG_ESP_BROWNOUT_DET_LVL_SEL_1= +CONFIG_ESP_BROWNOUT_DET_LVL_SEL_2= +CONFIG_ESP_BROWNOUT_DET_LVL_SEL_3= +CONFIG_ESP_BROWNOUT_DET_LVL_SEL_4= +CONFIG_ESP_BROWNOUT_DET_LVL_SEL_5= +CONFIG_ESP_BROWNOUT_DET_LVL_SEL_6= +CONFIG_ESP_BROWNOUT_DET_LVL_SEL_7= +CONFIG_ESP_BROWNOUT_DET_LVL=0 CONFIG_ESP32_TIME_SYSCALL_USE_RTC_HRT=y CONFIG_ESP32_TIME_SYSCALL_USE_RTC= CONFIG_ESP32_TIME_SYSCALL_USE_HRT= @@ -189,7 +189,6 @@ CONFIG_ESP32_XTAL_FREQ_26= CONFIG_ESP32_XTAL_FREQ_AUTO= CONFIG_ESP32_XTAL_FREQ=40 CONFIG_ESP32_DISABLE_BASIC_ROM_CONSOLE= -CONFIG_ESP32_NO_BLOBS= CONFIG_ESP_TIMER_PROFILING= CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS= CONFIG_ESP_ERR_TO_NAME_LOOKUP=y