Skip to content

Commit 3035667

Browse files
feat(phy): add config for esp32c2 move iram func to flash
1 parent 4312734 commit 3035667

File tree

6 files changed

+41
-2
lines changed

6 files changed

+41
-2
lines changed

components/bt/controller/esp32c2/Kconfig.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,7 @@ config BT_CTRL_RUN_IN_FLASH_ONLY
693693
- For HCI_LE_Extended_Create_Connection command, only 1M phy's connection parameters will be applied.
694694
Other phys' will be ignored.
695695
- For extended scanning, we may be unable to receive the extended adv with 300us MAFS.
696+
- To match performance, phy needs to be reduced, you need to disable ESP_PHY_IRAM_OPT.
696697

697698
config BT_LE_PLACE_CONN_RELATED_INTO_IRAM
698699
bool "Place the connection-related code into IRAM"

components/esp_phy/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,5 +177,14 @@ menu "PHY"
177177
default n
178178
help
179179
Select to support record and query phy used time.
180+
181+
config ESP_PHY_IRAM_OPT
182+
bool "PHY IRAM speed optimization"
183+
default y
184+
help
185+
Select this option to place frequently called PHY library functions in IRAM.
186+
When this option is disabled, more than 1.1Kbytes of IRAM memory will be saved,
187+
but PHY performance will be reduced. This config only affect esp32c2 now.
188+
180189
endif
181190
endmenu # PHY

components/esp_phy/linker.lf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,32 @@ if IDF_TARGET_ESP32 = y:
1010
entries:
1111
.phyiram+
1212

13+
if IDF_TARGET_ESP32C2 = y:
14+
[scheme:phy_iram]
15+
entries:
16+
if ESP_PHY_IRAM_OPT = y:
17+
phy_iram -> iram0_text
18+
else:
19+
phy_iram -> flash_text
20+
21+
[sections:phy_iram]
22+
entries:
23+
.phyiram+
24+
25+
[mapping:btbb]
26+
archive: libbtbb.a
27+
entries:
28+
if IDF_TARGET_ESP32C2 = y:
29+
* (phy_iram)
30+
1331
[mapping:phy]
1432
archive: libphy.a
1533
entries:
1634
* (noflash_data)
1735
if IDF_TARGET_ESP32 = y:
1836
* (phy_iram)
37+
if IDF_TARGET_ESP32C2 = y:
38+
* (phy_iram)
1939

2040
[mapping:rtc]
2141
archive: librtc.a

components/esp_wifi/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ menu "Wi-Fi"
345345
select PM_SLP_DEFAULT_PARAMS_OPT
346346
select PM_SLEEP_FUNC_IN_IRAM
347347
select ESP_PERIPH_CTRL_FUNC_IN_IRAM
348+
select ESP_PHY_IRAM_OPT
348349
default y if SOC_WIFI_HE_SUPPORT
349350
help
350351
Select this option to place called Wi-Fi library TBTT process and receive beacon functions in IRAM.

tools/test_apps/configs/sdkconfig.flash_auto_suspend_iram_reduction

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ CONFIG_LOG_IN_IRAM=n
6060
CONFIG_ESP_ROM_PRINT_IN_IRAM=n
6161

6262
# Low power related options
63-
CONFIG_ESP_WIFI_SLP_IRAM_OPT=n
6463
CONFIG_PM_SLEEP_FUNC_IN_IRAM=n
6564
CONFIG_PM_RTOS_IDLE_OPT=n
6665
CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=n
@@ -70,6 +69,15 @@ CONFIG_ESP_REGI2C_CTRL_FUNC_IN_IRAM=n
7069
# System common
7170
CONFIG_ESP_PERIPH_CTRL_FUNC_IN_IRAM=n
7271

72+
# Phy related options
73+
CONFIG_ESP_PHY_IRAM_OPT=n
74+
75+
# WiFi related options
76+
CONFIG_ESP_WIFI_SLP_IRAM_OPT=n
77+
CONFIG_ESP_WIFI_IRAM_OPT=n
78+
CONFIG_ESP_WIFI_EXTRA_IRAM_OPT=n
79+
CONFIG_ESP_WIFI_RX_IRAM_OPT=n
80+
7381
#######################################################################################################################
7482
# Options that will enable IRAM reduction option that are not necessarily safe for all use-cases
7583
#######################################################################################################################

0 commit comments

Comments
 (0)