mirror of
				https://github.com/espressif/esp-idf.git
				synced 2025-11-04 00:51:42 +01:00 
			
		
		
		
	esp32: make WiFi IRAM optimization configurable
With this feature, the WiFi IRAM optimization can be disabled/enabled via menuconfig.
This commit is contained in:
		@@ -72,6 +72,14 @@ else()
 | 
			
		||||
    register_component()
 | 
			
		||||
 | 
			
		||||
    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)
 | 
			
		||||
        target_link_libraries(esp32 coexist core espnow mesh net80211 phy pp rtc smartconfig wpa2 wpa wps)
 | 
			
		||||
    endif()
 | 
			
		||||
 
 | 
			
		||||
@@ -1152,7 +1152,14 @@ config ESP32_WIFI_SOFTAP_BEACON_MAX_LEN
 | 
			
		||||
        932 (752+36*5).
 | 
			
		||||
        
 | 
			
		||||
        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
 | 
			
		||||
 | 
			
		||||
menu PHY
 | 
			
		||||
 
 | 
			
		||||
@@ -18,6 +18,13 @@ endif
 | 
			
		||||
#specifies its own scripts.
 | 
			
		||||
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
 | 
			
		||||
LINKER_SCRIPTS += esp32.rom.libgcc.ld
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -159,6 +159,7 @@ SECTIONS
 | 
			
		||||
    *libheap.a:multi_heap_poisoning.*(.literal .text .literal.* .text.*)
 | 
			
		||||
    *libesp32.a:panic.*(.literal .text .literal.* .text.*)
 | 
			
		||||
    *libesp32.a:core_dump.*(.literal .text .literal.* .text.*)
 | 
			
		||||
    INCLUDE wifi_iram.ld
 | 
			
		||||
    *libapp_trace.a:(.literal .text .literal.* .text.*)
 | 
			
		||||
    *libxtensa-debug-module.a:eri.*(.literal .text .literal.* .text.*)
 | 
			
		||||
    *librtc.a:(.literal .text .literal.* .text.*)
 | 
			
		||||
@@ -326,6 +327,7 @@ SECTIONS
 | 
			
		||||
    _text_start = ABSOLUTE(.);
 | 
			
		||||
    *(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
 | 
			
		||||
    *(.irom0.text) /* catch stray ICACHE_RODATA_ATTR */
 | 
			
		||||
    *(.wifi0iram .wifi0iram.*) /* catch stray WIFI_IRAM_ATTR */
 | 
			
		||||
    *(.fini.literal)
 | 
			
		||||
    *(.fini)
 | 
			
		||||
    *(.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.*)
 | 
			
		||||
 Submodule components/esp32/lib updated: eb53491cf6...4a4b8089b3
									
								
							
		Reference in New Issue
	
	Block a user