diff --git a/components/bt/controller/esp32c2/Kconfig.in b/components/bt/controller/esp32c2/Kconfig.in index 69623987e0..a2c55c3738 100644 --- a/components/bt/controller/esp32c2/Kconfig.in +++ b/components/bt/controller/esp32c2/Kconfig.in @@ -693,6 +693,7 @@ config BT_CTRL_RUN_IN_FLASH_ONLY - For HCI_LE_Extended_Create_Connection command, only 1M phy's connection parameters will be applied. Other phys' will be ignored. - For extended scanning, we may be unable to receive the extended adv with 300us MAFS. + - To match performance, phy needs to be reduced, you need to disable ESP_PHY_IRAM_OPT. config BT_LE_PLACE_CONN_RELATED_INTO_IRAM bool "Place the connection-related code into IRAM" diff --git a/components/esp_phy/Kconfig b/components/esp_phy/Kconfig index 75b5be45cd..9fabce3e9b 100644 --- a/components/esp_phy/Kconfig +++ b/components/esp_phy/Kconfig @@ -177,5 +177,14 @@ menu "PHY" default n help Select to support record and query phy used time. + + config ESP_PHY_IRAM_OPT + bool "PHY IRAM speed optimization" + default y + help + Select this option to place frequently called PHY library functions in IRAM. + When this option is disabled, more than 1.1Kbytes of IRAM memory will be saved, + but PHY performance will be reduced. This config only affect esp32c2 now. + endif endmenu # PHY diff --git a/components/esp_phy/lib b/components/esp_phy/lib index 5466bfa8fd..af5ba3d475 160000 --- a/components/esp_phy/lib +++ b/components/esp_phy/lib @@ -1 +1 @@ -Subproject commit 5466bfa8fde26f45cb1f7fb5dc864cbb7e50e139 +Subproject commit af5ba3d475bda69a8492830587c402a19e5ae9a4 diff --git a/components/esp_phy/linker.lf b/components/esp_phy/linker.lf index 5dc2f9f23b..4f79d1c357 100644 --- a/components/esp_phy/linker.lf +++ b/components/esp_phy/linker.lf @@ -10,12 +10,32 @@ if IDF_TARGET_ESP32 = y: entries: .phyiram+ +if IDF_TARGET_ESP32C2 = y: + [scheme:phy_iram] + entries: + if ESP_PHY_IRAM_OPT = y: + phy_iram -> iram0_text + else: + phy_iram -> flash_text + + [sections:phy_iram] + entries: + .phyiram+ + +[mapping:btbb] +archive: libbtbb.a +entries: + if IDF_TARGET_ESP32C2 = y: + * (phy_iram) + [mapping:phy] archive: libphy.a entries: * (noflash_data) if IDF_TARGET_ESP32 = y: * (phy_iram) + if IDF_TARGET_ESP32C2 = y: + * (phy_iram) [mapping:rtc] archive: librtc.a diff --git a/components/esp_wifi/Kconfig b/components/esp_wifi/Kconfig index 0793d53fdf..96ab678d40 100644 --- a/components/esp_wifi/Kconfig +++ b/components/esp_wifi/Kconfig @@ -345,6 +345,7 @@ menu "Wi-Fi" select PM_SLP_DEFAULT_PARAMS_OPT select PM_SLEEP_FUNC_IN_IRAM select ESP_PERIPH_CTRL_FUNC_IN_IRAM + select ESP_PHY_IRAM_OPT default y if SOC_WIFI_HE_SUPPORT help Select this option to place called Wi-Fi library TBTT process and receive beacon functions in IRAM. diff --git a/tools/test_apps/configs/sdkconfig.flash_auto_suspend_iram_reduction b/tools/test_apps/configs/sdkconfig.flash_auto_suspend_iram_reduction index 1dc627ce6c..d109712c02 100644 --- a/tools/test_apps/configs/sdkconfig.flash_auto_suspend_iram_reduction +++ b/tools/test_apps/configs/sdkconfig.flash_auto_suspend_iram_reduction @@ -60,7 +60,6 @@ CONFIG_LOG_IN_IRAM=n CONFIG_ESP_ROM_PRINT_IN_IRAM=n # Low power related options -CONFIG_ESP_WIFI_SLP_IRAM_OPT=n CONFIG_PM_SLEEP_FUNC_IN_IRAM=n CONFIG_PM_RTOS_IDLE_OPT=n CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=n @@ -70,6 +69,15 @@ CONFIG_ESP_REGI2C_CTRL_FUNC_IN_IRAM=n # System common CONFIG_ESP_PERIPH_CTRL_FUNC_IN_IRAM=n +# Phy related options +CONFIG_ESP_PHY_IRAM_OPT=n + +# WiFi related options +CONFIG_ESP_WIFI_SLP_IRAM_OPT=n +CONFIG_ESP_WIFI_IRAM_OPT=n +CONFIG_ESP_WIFI_EXTRA_IRAM_OPT=n +CONFIG_ESP_WIFI_RX_IRAM_OPT=n + ####################################################################################################################### # Options that will enable IRAM reduction option that are not necessarily safe for all use-cases #######################################################################################################################