Merge branch 'bugfix/tw28146_make_wifi_iram_optimization_configurable_v3.1' into 'release/v3.1'
esp32: make WiFi IRAM optimization configurable (backport v3.1) See merge request idf/esp-idf!4041
This commit is contained in:
commit
c6ee38eb69
7 changed files with 31 additions and 1 deletions
|
@ -69,6 +69,14 @@ else()
|
||||||
register_component()
|
register_component()
|
||||||
|
|
||||||
target_link_libraries(esp32 "-L ${CMAKE_CURRENT_SOURCE_DIR}/lib")
|
target_link_libraries(esp32 "-L ${CMAKE_CURRENT_SOURCE_DIR}/lib")
|
||||||
|
|
||||||
|
# Add a different linker search path depending on WiFi optimisations
|
||||||
|
if (CONFIG_ESP32_WIFI_IRAM_OPT)
|
||||||
|
target_link_libraries(esp32 "-L ${CMAKE_CURRENT_SOURCE_DIR}/ld/wifi_iram_opt")
|
||||||
|
else()
|
||||||
|
target_link_libraries(esp32 "-L ${CMAKE_CURRENT_SOURCE_DIR}/ld/wifi_iram_noopt")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(NOT CONFIG_NO_BLOBS)
|
if(NOT CONFIG_NO_BLOBS)
|
||||||
target_link_libraries(esp32 coexist core espnow mesh net80211 phy pp rtc smartconfig wpa2 wpa wps)
|
target_link_libraries(esp32 coexist core espnow mesh net80211 phy pp rtc smartconfig wpa2 wpa wps)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -1044,6 +1044,13 @@ config ESP32_WIFI_SOFTAP_BEACON_MAX_LEN
|
||||||
|
|
||||||
Setting a longer beacon length also assists with debugging as the conflicting root nodes can be identified more quickly.
|
Setting a longer beacon length also assists with debugging as the conflicting root nodes can be identified more quickly.
|
||||||
|
|
||||||
|
config ESP32_WIFI_IRAM_OPT
|
||||||
|
bool "WiFi IRAM speed optimization"
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
Select this option to place frequently called Wi-Fi library functions in IRAM. When this option is disabled,
|
||||||
|
more than 10Kbytes of IRAM memory will be saved but Wi-Fi throughput will be reduced.
|
||||||
|
|
||||||
endmenu # Wi-Fi
|
endmenu # Wi-Fi
|
||||||
|
|
||||||
menu PHY
|
menu PHY
|
||||||
|
|
|
@ -13,6 +13,13 @@ endif
|
||||||
#specifies its own scripts.
|
#specifies its own scripts.
|
||||||
LINKER_SCRIPTS += esp32.common.ld esp32.rom.ld esp32.peripherals.ld
|
LINKER_SCRIPTS += esp32.common.ld esp32.rom.ld esp32.peripherals.ld
|
||||||
|
|
||||||
|
# Add a different linker search path depending on WiFi optimisations
|
||||||
|
ifdef CONFIG_ESP32_WIFI_IRAM_OPT
|
||||||
|
COMPONENT_ADD_LDFLAGS += -L $(COMPONENT_PATH)/ld/wifi_iram_opt
|
||||||
|
else
|
||||||
|
COMPONENT_ADD_LDFLAGS += -L $(COMPONENT_PATH)/ld/wifi_iram_noopt
|
||||||
|
endif
|
||||||
|
|
||||||
#Force pure functions from libgcc.a to be linked from ROM
|
#Force pure functions from libgcc.a to be linked from ROM
|
||||||
LINKER_SCRIPTS += esp32.rom.libgcc.ld
|
LINKER_SCRIPTS += esp32.rom.libgcc.ld
|
||||||
|
|
||||||
|
|
|
@ -101,6 +101,7 @@ SECTIONS
|
||||||
*libheap.a:multi_heap_poisoning.*(.literal .text .literal.* .text.*)
|
*libheap.a:multi_heap_poisoning.*(.literal .text .literal.* .text.*)
|
||||||
*libesp32.a:panic.*(.literal .text .literal.* .text.*)
|
*libesp32.a:panic.*(.literal .text .literal.* .text.*)
|
||||||
*libesp32.a:core_dump.*(.literal .text .literal.* .text.*)
|
*libesp32.a:core_dump.*(.literal .text .literal.* .text.*)
|
||||||
|
INCLUDE wifi_iram.ld
|
||||||
*libapp_trace.a:(.literal .text .literal.* .text.*)
|
*libapp_trace.a:(.literal .text .literal.* .text.*)
|
||||||
*libxtensa-debug-module.a:eri.*(.literal .text .literal.* .text.*)
|
*libxtensa-debug-module.a:eri.*(.literal .text .literal.* .text.*)
|
||||||
*librtc.a:(.literal .text .literal.* .text.*)
|
*librtc.a:(.literal .text .literal.* .text.*)
|
||||||
|
@ -238,6 +239,7 @@ SECTIONS
|
||||||
_text_start = ABSOLUTE(.);
|
_text_start = ABSOLUTE(.);
|
||||||
*(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
|
*(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
|
||||||
*(.irom0.text) /* catch stray ICACHE_RODATA_ATTR */
|
*(.irom0.text) /* catch stray ICACHE_RODATA_ATTR */
|
||||||
|
*(.wifi0iram .wifi0iram.*) /* catch stray WIFI_IRAM_ATTR */
|
||||||
*(.fini.literal)
|
*(.fini.literal)
|
||||||
*(.fini)
|
*(.fini)
|
||||||
*(.gnu.version)
|
*(.gnu.version)
|
||||||
|
|
2
components/esp32/ld/wifi_iram_noopt/wifi_iram.ld
Normal file
2
components/esp32/ld/wifi_iram_noopt/wifi_iram.ld
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
/* This snippet does nothing, if WiFi IRAM optimisations
|
||||||
|
are disabled. */
|
4
components/esp32/ld/wifi_iram_opt/wifi_iram.ld
Normal file
4
components/esp32/ld/wifi_iram_opt/wifi_iram.ld
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
/* Link WiFi library .wifi0iram sections to IRAM
|
||||||
|
if this snippet is included */
|
||||||
|
*libnet80211.a:( .wifi0iram .wifi0iram.*)
|
||||||
|
*libpp.a:( .wifi0iram .wifi0iram.*)
|
|
@ -1 +1 @@
|
||||||
Subproject commit 2292ebcbc3047233252e6e9fd6a0fc1de72ee5de
|
Subproject commit 5108361b0fb6f7f4b36a00a912b537ac0c07b282
|
Loading…
Reference in a new issue