blob: 4d92bc8f37b647bb05344b873631e04f2c10ee36 [file] [log] [blame]
Shubham Kulkarnie16e6062020-08-11 11:19:27 +05301# Copyright 2020 Espressif Systems (Shanghai) PTE LTD
2
3menuconfig WIFI_ESP32
4 bool "ESP32 SoC WiFi support"
Kumar Gala25cb2bf2022-08-24 15:14:51 -05005 default y
6 depends on DT_HAS_ESPRESSIF_ESP32_WIFI_ENABLED
Felipe Nevesd1700792021-12-07 13:44:01 -03007 depends on !SMP
Shubham Kulkarnie16e6062020-08-11 11:19:27 +05308 select THREAD_CUSTOM_DATA
Sylvio Alves7d9edc82022-05-14 16:48:47 -03009 select NET_L2_WIFI_MGMT
Sylvio Alves20c32562022-05-13 08:18:42 -030010 select WIFI_USE_NATIVE_NETWORKING
Sylvio Alves7d9edc82022-05-14 16:48:47 -030011 select MBEDTLS
12 select MBEDTLS_ENTROPY_ENABLED
13 select MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
14 select MBEDTLS_ECP_ALL_ENABLED
Robert Lubosb76c35d2022-10-05 15:00:42 +020015 select MBEDTLS_ECDH_C
16 select MBEDTLS_ECDSA_C
17 select MBEDTLS_ECP_C
Shubham Kulkarnie16e6062020-08-11 11:19:27 +053018 help
Felipe Nevesd1700792021-12-07 13:44:01 -030019 Enable ESP32 SoC WiFi support. Only supported in single
20 core mode because the network stack is not aware of SMP
21 stuff.
Shubham Kulkarnie16e6062020-08-11 11:19:27 +053022
Shubham Kulkarnie16e6062020-08-11 11:19:27 +053023if WIFI_ESP32
24
Sylvio Alves41f16c32023-07-26 11:08:52 -030025config NET_TCP_WORKQ_STACK_SIZE
26 default 2048
27
28config NET_RX_STACK_SIZE
29 default 2048
30
31config NET_MGMT_EVENT_STACK_SIZE
32 default 2048
33
Sylvio Alvesa8cacfa2022-05-16 10:19:10 -030034config ESP32_WIFI_STA_AUTO_DHCPV4
35 bool "Automatically starts DHCP4 negotiation"
36 depends on NET_DHCPV4
37 depends on NET_IPV4
Shubham Kulkarnie16e6062020-08-11 11:19:27 +053038 help
Sylvio Alvesa8cacfa2022-05-16 10:19:10 -030039 WiFi driver will automatically initiate DHCPV4 negotiation when connected.
Shubham Kulkarnie16e6062020-08-11 11:19:27 +053040
41config ESP32_WIFI_STA_RECONNECT
42 bool "WiFi connection retry"
Shubham Kulkarnie16e6062020-08-11 11:19:27 +053043 help
44 Set auto WiFI reconnection when disconnected.
45
46config ESP32_WIFI_EVENT_TASK_STACK_SIZE
47 int "Event Task Stack Size"
48 default 4096
49
50config ESP32_WIFI_EVENT_TASK_PRIO
51 int "Event Task Priority"
52 default 4
53
54config ESP32_WIFI_STATIC_RX_BUFFER_NUM
55 int "Max number of WiFi static RX buffers"
56 range 2 25
57 default 10
58 help
59 Set the number of WiFi static RX buffers. Each buffer takes approximately
60 1.6KB of RAM. The static rx buffers are allocated when esp_wifi_init is
61 called, they are not freed until esp_wifi_deinit is called.
62
63 WiFi hardware use these buffers to receive all 802.11 frames. A higher
64 number may allow higher throughput but increases memory use.
65 If ESP32_WIFI_AMPDU_RX_ENABLED is enabled, this value is recommended to
66 set equal or bigger than ESP32_WIFI_RX_BA_WIN in order to achieve better
67 throughput and compatibility with both stations and APs.
68
69config ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM
70 int "Max number of WiFi dynamic RX buffers"
71 range 0 128
72 default 32
73 help
74 Set the number of WiFi dynamic RX buffers, 0 means unlimited RX buffers
75 will be allocated (provided sufficient free RAM). The size of each dynamic
76 RX buffer depends on the size of the received data frame.
77
78 For each received data frame, the WiFi driver makes a copy to an RX buffer
79 and then delivers it to the high layer TCP/IP stack. The dynamic RX buffer
80 is freed after the higher layer has successfully received the data frame.
81
82 For some applications, WiFi data frames may be received faster than the
83 application can process them. In these cases we may run out of memory if
84 RX buffer number is unlimited (0). If a dynamic RX buffer limit is set,
85 it should be at least the number of static RX buffers.
86
87choice ESP32_WIFI_TX_BUFFER
88 prompt "Type of WiFi TX buffers"
89 default ESP32_WIFI_DYNAMIC_TX_BUFFER
90 help
91 Select type of WiFi TX buffers:
92
93 If "Static" is selected, WiFi TX buffers are allocated when WiFi is
94 initialized and released when WiFi is de-initialized. The size of each
95 static TX buffer is fixed to about 1.6KB.
96
97 If "Dynamic" is selected, each WiFi TX buffer is allocated as needed
98 when a data frame is delivered to the Wifi driver from the TCP/IP stack.
99 The buffer is freed after the data frame has been sent by the WiFi driver.
100 The size of each dynamic TX buffer depends on the length of each data
101 frame sent by the TCP/IP layer.
102
103 If PSRAM is enabled, "Static" should be selected to guarantee enough
104 WiFi TX buffers. If PSRAM is disabled, "Dynamic" should be selected
105 to improve the utilization of RAM.
106
107 config ESP32_WIFI_STATIC_TX_BUFFER
108 bool "Static"
109 config ESP32_WIFI_DYNAMIC_TX_BUFFER
110 bool "Dynamic"
111endchoice
112
113config ESP32_WIFI_TX_BUFFER_TYPE
114 int
115 default 0 if ESP32_WIFI_STATIC_TX_BUFFER
116 default 1 if ESP32_WIFI_DYNAMIC_TX_BUFFER
117
118config ESP32_WIFI_STATIC_TX_BUFFER_NUM
119 int "Max number of WiFi static TX buffers"
120 depends on ESP32_WIFI_STATIC_TX_BUFFER
121 range 1 64
122 default 16
123 help
124 Set the number of WiFi static TX buffers. Each buffer takes approximately
125 1.6KB of RAM. The static RX buffers are allocated when esp_wifi_init() is
126 called, they are not released until esp_wifi_deinit() is called.
127
128 For each transmitted data frame from the higher layer TCP/IP stack,
129 the WiFi driver makes a copy of it in a TX buffer. For some applications
130 especially UDP applications, the upper layer can deliver frames faster
131 than WiFi layer can transmit.
132 In these cases, we may run out of TX buffers.
133
134config ESP32_WIFI_CACHE_TX_BUFFER_NUM
135 int "Max number of WiFi cache TX buffers"
136 range 16 128
137 default 32
138 help
139 Set the number of WiFi cache TX buffer number.
140
141 For each TX packet from uplayer, such as LWIP etc, WiFi driver needs to
142 allocate a static TX buffer and makes a copy of uplayer packet. If WiFi
143 driver fails to allocate the static TX buffer, it caches the uplayer
144 packets to a dedicated buffer queue, this option is used to configure the
145 size of the cached TX queue.
146
147config ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM
148 int "Max number of WiFi dynamic TX buffers"
149 depends on ESP32_WIFI_DYNAMIC_TX_BUFFER
150 range 1 128
151 default 32
152 help
153 Set the number of WiFi dynamic TX buffers. The size of each
154 dynamic TXbuffer is not fixed, it depends on the size of each
155 transmitted data frame.
156
157 For each transmitted frame from the higher layer TCP/IP stack,
158 the WiFi driver makes a copy of it in a TX buffer. For some applications,
159 especially UDP applications, the upper layer can deliver frames faster
160 than WiFi layer can transmit. In these cases, we may run out of TX
161 buffers.
162
163config ESP32_WIFI_CSI_ENABLED
164 bool "WiFi CSI(Channel State Information)"
165 help
166 Select this option to enable CSI(Channel State Information) feature.
167 CSI takes about CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM KB of RAM.
168 If CSI is not used, it is better to disable this feature in order
169 to save memory.
170
171config ESP32_WIFI_AMPDU_TX_ENABLED
172 bool "WiFi AMPDU TX"
173 default y
174 help
175 Select this option to enable AMPDU TX feature. It improves transmission
176 error checking and overall network performance with the cost of processing
177 speed. Helpful when the device is operating in crowded wireless area.
178
179config ESP32_WIFI_TX_BA_WIN
180 int "WiFi AMPDU TX BA window size"
181 depends on ESP32_WIFI_AMPDU_TX_ENABLED
182 range 2 32
183 default 6
184 help
185 Set the size of WiFi Block Ack TX window. Generally a bigger value means
186 higher throughput but more memory. Most of time we should NOT change the
187 default value unless special reason, e.g. test the maximum
188 UDP TX throughput with iperf etc. For iperf test in shieldbox,
189 the recommended value is 9~12.
190
191config ESP32_WIFI_AMPDU_RX_ENABLED
192 bool "WiFi AMPDU RX"
193 default y
194 help
195 Select this option to enable AMPDU RX feature. It improves transmission
196 error checking and overall network performance with the cost of processing
197 speed. Helpful when the device is operating in crowded wireless area.
198
199config ESP32_WIFI_RX_BA_WIN
200 int "WiFi AMPDU RX BA window size"
201 depends on ESP32_WIFI_AMPDU_RX_ENABLED
202 range 2 32
203 default 6
204 help
205 Set the size of WiFi Block Ack RX window. Generally a bigger value means
206 higher throughput and better compatibility but more memory. Most of time
207 we should NOT change the default value unless special reason,
208 e.g. test the maximum UDP RX throughput with iperf etc. For iperf test in
209 shieldbox, the recommended value is 9~12. If PSRAM is used and WiFi memory
Nazar Kazakov9713f0d2022-02-24 12:00:55 +0000210 is preferred to be allocated in PSRAM first, the default and minimum value
Shubham Kulkarnie16e6062020-08-11 11:19:27 +0530211 should be 16 to achieve better throughput and compatibility with both
212 stations and APs.
213
214choice ESP32_WIFI_TASK_CORE_ID
215 prompt "WiFi Task Core ID"
216 default ESP32_WIFI_TASK_PINNED_TO_CORE_0
217 help
218 Pinned WiFi task to core 0 (core 1 not supported yet)
219
220 config ESP32_WIFI_TASK_PINNED_TO_CORE_0
221 bool "Core 0"
222endchoice
223
Shubham Kulkarnie16e6062020-08-11 11:19:27 +0530224config ESP32_WIFI_SW_COEXIST_ENABLE
225 bool
226 help
227 Software controls WiFi/Bluetooth coexistence. Not supported yet.
228
Sylvio Alvesfe621f72021-04-23 13:27:25 -0300229config ESP32_WIFI_IRAM_OPT
230 bool "WiFi IRAM speed optimization"
Sylvio Alvesfe621f72021-04-23 13:27:25 -0300231 help
232 Select this option to place frequently called Wi-Fi library functions in IRAM.
233 When this option is disabled, more than 10Kbytes of IRAM memory will be saved
234 but Wi-Fi throughput will be reduced.
235
236config ESP32_WIFI_RX_IRAM_OPT
237 bool "WiFi RX IRAM speed optimization"
Sylvio Alvesfe621f72021-04-23 13:27:25 -0300238 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
Sylvio Alves41206012022-07-13 23:54:23 -0300243config ESP32_WIFI_NET_ALLOC_SPIRAM
244 bool "Allocate memory of WiFi and NET in SPIRAM"
245 depends on ESP_SPIRAM
246 help
247 Allocate memory of WiFi and NET stack in SPIRAM, increasing available RAM memory space
248 for application stack.
249
Sylvio Alvesf5dc2292022-10-31 14:11:08 -0300250config ESP_WIFI_SOFTAP_SUPPORT
251 bool
252 default y
253 help
254 Hidden option to enable Wi-Fi SoftAP functions in WPA supplicant and RF libraries.
255
Shubham Kulkarnie16e6062020-08-11 11:19:27 +0530256endif # WIFI_ESP32