1# Copyright 2020 Espressif Systems (Shanghai) PTE LTD 2 3menuconfig WIFI_ESP32 4 bool "ESP32 SoC WiFi support" 5 select THREAD_CUSTOM_DATA 6 help 7 Enable ESP32 SoC WiFi support. 8 9if WIFI_ESP32 10 11config ESP32_WIFI_SSID 12 string "SSID of WiFi network" 13 help 14 SSID (network name) for the application to connect to. 15 16config ESP32_WIFI_PASSWORD 17 string "Password (WPA or WPA2) of WiFi network" 18 help 19 WiFi password (WPA or WPA2) for the example to use. 20 21config ESP32_WIFI_STA_AUTO 22 bool "Automatically connect to configured WiFi SSID" 23 help 24 WiFi driver will automatically connect to SSID. 25 26config ESP32_WIFI_STA_RECONNECT 27 bool "WiFi connection retry" 28 default y 29 help 30 Set auto WiFI reconnection when disconnected. 31 32config ESP32_WIFI_EVENT_TASK_STACK_SIZE 33 int "Event Task Stack Size" 34 default 4096 35 36config ESP32_WIFI_EVENT_TASK_PRIO 37 int "Event Task Priority" 38 default 4 39 40config ESP32_WIFI_STATIC_RX_BUFFER_NUM 41 int "Max number of WiFi static RX buffers" 42 range 2 25 43 default 10 44 help 45 Set the number of WiFi static RX buffers. Each buffer takes approximately 46 1.6KB of RAM. The static rx buffers are allocated when esp_wifi_init is 47 called, they are not freed until esp_wifi_deinit is called. 48 49 WiFi hardware use these buffers to receive all 802.11 frames. A higher 50 number may allow higher throughput but increases memory use. 51 If ESP32_WIFI_AMPDU_RX_ENABLED is enabled, this value is recommended to 52 set equal or bigger than ESP32_WIFI_RX_BA_WIN in order to achieve better 53 throughput and compatibility with both stations and APs. 54 55config ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM 56 int "Max number of WiFi dynamic RX buffers" 57 range 0 128 58 default 32 59 help 60 Set the number of WiFi dynamic RX buffers, 0 means unlimited RX buffers 61 will be allocated (provided sufficient free RAM). The size of each dynamic 62 RX buffer depends on the size of the received data frame. 63 64 For each received data frame, the WiFi driver makes a copy to an RX buffer 65 and then delivers it to the high layer TCP/IP stack. The dynamic RX buffer 66 is freed after the higher layer has successfully received the data frame. 67 68 For some applications, WiFi data frames may be received faster than the 69 application can process them. In these cases we may run out of memory if 70 RX buffer number is unlimited (0). If a dynamic RX buffer limit is set, 71 it should be at least the number of static RX buffers. 72 73choice ESP32_WIFI_TX_BUFFER 74 prompt "Type of WiFi TX buffers" 75 default ESP32_WIFI_DYNAMIC_TX_BUFFER 76 help 77 Select type of WiFi TX buffers: 78 79 If "Static" is selected, WiFi TX buffers are allocated when WiFi is 80 initialized and released when WiFi is de-initialized. The size of each 81 static TX buffer is fixed to about 1.6KB. 82 83 If "Dynamic" is selected, each WiFi TX buffer is allocated as needed 84 when a data frame is delivered to the Wifi driver from the TCP/IP stack. 85 The buffer is freed after the data frame has been sent by the WiFi driver. 86 The size of each dynamic TX buffer depends on the length of each data 87 frame sent by the TCP/IP layer. 88 89 If PSRAM is enabled, "Static" should be selected to guarantee enough 90 WiFi TX buffers. If PSRAM is disabled, "Dynamic" should be selected 91 to improve the utilization of RAM. 92 93 config ESP32_WIFI_STATIC_TX_BUFFER 94 bool "Static" 95 config ESP32_WIFI_DYNAMIC_TX_BUFFER 96 bool "Dynamic" 97endchoice 98 99config ESP32_WIFI_TX_BUFFER_TYPE 100 int 101 default 0 if ESP32_WIFI_STATIC_TX_BUFFER 102 default 1 if ESP32_WIFI_DYNAMIC_TX_BUFFER 103 104config ESP32_WIFI_STATIC_TX_BUFFER_NUM 105 int "Max number of WiFi static TX buffers" 106 depends on ESP32_WIFI_STATIC_TX_BUFFER 107 range 1 64 108 default 16 109 help 110 Set the number of WiFi static TX buffers. Each buffer takes approximately 111 1.6KB of RAM. The static RX buffers are allocated when esp_wifi_init() is 112 called, they are not released until esp_wifi_deinit() is called. 113 114 For each transmitted data frame from the higher layer TCP/IP stack, 115 the WiFi driver makes a copy of it in a TX buffer. For some applications 116 especially UDP applications, the upper layer can deliver frames faster 117 than WiFi layer can transmit. 118 In these cases, we may run out of TX buffers. 119 120config ESP32_WIFI_CACHE_TX_BUFFER_NUM 121 int "Max number of WiFi cache TX buffers" 122 range 16 128 123 default 32 124 help 125 Set the number of WiFi cache TX buffer number. 126 127 For each TX packet from uplayer, such as LWIP etc, WiFi driver needs to 128 allocate a static TX buffer and makes a copy of uplayer packet. If WiFi 129 driver fails to allocate the static TX buffer, it caches the uplayer 130 packets to a dedicated buffer queue, this option is used to configure the 131 size of the cached TX queue. 132 133config ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM 134 int "Max number of WiFi dynamic TX buffers" 135 depends on ESP32_WIFI_DYNAMIC_TX_BUFFER 136 range 1 128 137 default 32 138 help 139 Set the number of WiFi dynamic TX buffers. The size of each 140 dynamic TXbuffer is not fixed, it depends on the size of each 141 transmitted data frame. 142 143 For each transmitted frame from the higher layer TCP/IP stack, 144 the WiFi driver makes a copy of it in a TX buffer. For some applications, 145 especially UDP applications, the upper layer can deliver frames faster 146 than WiFi layer can transmit. In these cases, we may run out of TX 147 buffers. 148 149config ESP32_WIFI_CSI_ENABLED 150 bool "WiFi CSI(Channel State Information)" 151 help 152 Select this option to enable CSI(Channel State Information) feature. 153 CSI takes about CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM KB of RAM. 154 If CSI is not used, it is better to disable this feature in order 155 to save memory. 156 157config ESP32_WIFI_AMPDU_TX_ENABLED 158 bool "WiFi AMPDU TX" 159 default y 160 help 161 Select this option to enable AMPDU TX feature. It improves transmission 162 error checking and overall network performance with the cost of processing 163 speed. Helpful when the device is operating in crowded wireless area. 164 165config ESP32_WIFI_TX_BA_WIN 166 int "WiFi AMPDU TX BA window size" 167 depends on ESP32_WIFI_AMPDU_TX_ENABLED 168 range 2 32 169 default 6 170 help 171 Set the size of WiFi Block Ack TX window. Generally a bigger value means 172 higher throughput but more memory. Most of time we should NOT change the 173 default value unless special reason, e.g. test the maximum 174 UDP TX throughput with iperf etc. For iperf test in shieldbox, 175 the recommended value is 9~12. 176 177config ESP32_WIFI_AMPDU_RX_ENABLED 178 bool "WiFi AMPDU RX" 179 default y 180 help 181 Select this option to enable AMPDU RX feature. It improves transmission 182 error checking and overall network performance with the cost of processing 183 speed. Helpful when the device is operating in crowded wireless area. 184 185config ESP32_WIFI_RX_BA_WIN 186 int "WiFi AMPDU RX BA window size" 187 depends on ESP32_WIFI_AMPDU_RX_ENABLED 188 range 2 32 189 default 6 190 help 191 Set the size of WiFi Block Ack RX window. Generally a bigger value means 192 higher throughput and better compatibility but more memory. Most of time 193 we should NOT change the default value unless special reason, 194 e.g. test the maximum UDP RX throughput with iperf etc. For iperf test in 195 shieldbox, the recommended value is 9~12. If PSRAM is used and WiFi memory 196 is preferred to allocat in PSRAM first, the default and minimum value 197 should be 16 to achieve better throughput and compatibility with both 198 stations and APs. 199 200choice ESP32_WIFI_TASK_CORE_ID 201 prompt "WiFi Task Core ID" 202 default ESP32_WIFI_TASK_PINNED_TO_CORE_0 203 help 204 Pinned WiFi task to core 0 (core 1 not supported yet) 205 206 config ESP32_WIFI_TASK_PINNED_TO_CORE_0 207 bool "Core 0" 208endchoice 209 210config ESP32_PHY_MAX_WIFI_TX_POWER 211 int "Max WiFi TX power (dBm)" 212 range 10 20 213 default 20 214 help 215 Set maximum transmit power for WiFi radio. Actual transmit power for high 216 data rates may be lower than this setting. 217 218config ESP32_PHY_MAX_TX_POWER 219 int 220 default ESP32_PHY_MAX_WIFI_TX_POWER 221 222config ESP32_WIFI_SW_COEXIST_ENABLE 223 bool 224 help 225 Software controls WiFi/Bluetooth coexistence. Not supported yet. 226 227config ESP32_WIFI_IRAM_OPT 228 bool "WiFi IRAM speed optimization" 229 default y 230 help 231 Select this option to place frequently called Wi-Fi library functions in IRAM. 232 When this option is disabled, more than 10Kbytes of IRAM memory will be saved 233 but Wi-Fi throughput will be reduced. 234 235config ESP32_WIFI_RX_IRAM_OPT 236 bool "WiFi RX IRAM speed optimization" 237 default y 238 help 239 Select this option to place frequently called Wi-Fi library RX functions in IRAM. 240 When this option is disabled, more than 17Kbytes of IRAM memory will be saved 241 but Wi-Fi performance will be reduced. 242 243endif # WIFI_ESP32 244