1
2menu "Wi-Fi"
3
4    config ESP32_WIFI_SW_COEXIST_ENABLE
5        bool "Software controls WiFi/Bluetooth coexistence"
6        depends on BT_ENABLED
7        default y
8        help
9            If enabled, WiFi & Bluetooth coexistence is controlled by software rather than hardware.
10            Recommended for heavy traffic scenarios. Both coexistence configuration options are
11            automatically managed, no user intervention is required.
12            If only Bluetooth is used, it is recommended to disable this option to reduce binary file
13            size.
14
15    config ESP32_WIFI_STATIC_RX_BUFFER_NUM
16        int "Max number of WiFi static RX buffers"
17        range 2 25
18        default 10 if !SPIRAM_TRY_ALLOCATE_WIFI_LWIP
19        default 16 if SPIRAM_TRY_ALLOCATE_WIFI_LWIP
20        help
21            Set the number of WiFi static RX buffers. Each buffer takes approximately 1.6KB of RAM.
22            The static rx buffers are allocated when esp_wifi_init is called, they are not freed
23            until esp_wifi_deinit is called.
24
25            WiFi hardware use these buffers to receive all 802.11 frames.
26            A higher number may allow higher throughput but increases memory use. If ESP32_WIFI_AMPDU_RX_ENABLED
27            is enabled, this value is recommended to set equal or bigger than ESP32_WIFI_RX_BA_WIN in order to
28            achieve better throughput and compatibility with both stations and APs.
29
30    config ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM
31        int "Max number of WiFi dynamic RX buffers"
32        range 0 128 if !LWIP_WND_SCALE
33        range 0 1024 if LWIP_WND_SCALE
34        default 32
35        help
36            Set the number of WiFi dynamic RX buffers, 0 means unlimited RX buffers will be allocated
37            (provided sufficient free RAM). The size of each dynamic RX buffer depends on the size of
38            the received data frame.
39
40            For each received data frame, the WiFi driver makes a copy to an RX buffer and then delivers
41            it to the high layer TCP/IP stack. The dynamic RX buffer is freed after the higher layer has
42            successfully received the data frame.
43
44            For some applications, WiFi data frames may be received faster than the application can
45            process them. In these cases we may run out of memory if RX buffer number is unlimited (0).
46
47            If a dynamic RX buffer limit is set, it should be at least the number of static RX buffers.
48
49    choice ESP32_WIFI_TX_BUFFER
50        prompt "Type of WiFi TX buffers"
51        default ESP32_WIFI_DYNAMIC_TX_BUFFER
52        help
53            Select type of WiFi TX buffers:
54
55            If "Static" is selected, WiFi TX buffers are allocated when WiFi is initialized and released
56            when WiFi is de-initialized. The size of each static TX buffer is fixed to about 1.6KB.
57
58            If "Dynamic" is selected, each WiFi TX buffer is allocated as needed when a data frame is
59            delivered to the Wifi driver from the TCP/IP stack. The buffer is freed after the data frame
60            has been sent by the WiFi driver. The size of each dynamic TX buffer depends on the length
61            of each data frame sent by the TCP/IP layer.
62
63            If PSRAM is enabled, "Static" should be selected to guarantee enough WiFi TX buffers.
64            If PSRAM is disabled, "Dynamic" should be selected to improve the utilization of RAM.
65
66        config ESP32_WIFI_STATIC_TX_BUFFER
67            bool "Static"
68        config ESP32_WIFI_DYNAMIC_TX_BUFFER
69            bool "Dynamic"
70            depends on !SPIRAM_USE_MALLOC
71    endchoice
72
73    config ESP32_WIFI_TX_BUFFER_TYPE
74        int
75        default 0 if ESP32_WIFI_STATIC_TX_BUFFER
76        default 1 if ESP32_WIFI_DYNAMIC_TX_BUFFER
77
78    config ESP32_WIFI_STATIC_TX_BUFFER_NUM
79        int "Max number of WiFi static TX buffers"
80        depends on ESP32_WIFI_STATIC_TX_BUFFER
81        range 1 64
82        default 16
83        help
84            Set the number of WiFi static TX buffers. Each buffer takes approximately 1.6KB of RAM.
85            The static RX buffers are allocated when esp_wifi_init() is called, they are not released
86            until esp_wifi_deinit() is called.
87
88            For each transmitted data frame from the higher layer TCP/IP stack, the WiFi driver makes a
89            copy of it in a TX buffer.  For some applications especially UDP applications, the upper
90            layer can deliver frames faster than WiFi layer can transmit. In these cases, we may run out
91            of TX buffers.
92
93    config ESP32_WIFI_CACHE_TX_BUFFER_NUM
94        int "Max number of WiFi cache TX buffers"
95        depends on (ESP32_SPIRAM_SUPPORT || ESP32S2_SPIRAM_SUPPORT || ESP32S3_SPIRAM_SUPPORT)
96        range 16 128
97        default 32
98        help
99            Set the number of WiFi cache TX buffer number.
100
101            For each TX packet from uplayer, such as LWIP etc, WiFi driver needs to allocate a static TX
102            buffer and makes a copy of uplayer packet. If WiFi driver fails to allocate the static TX buffer,
103            it caches the uplayer packets to a dedicated buffer queue, this option is used to configure the
104            size of the cached TX queue.
105
106    config ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM
107        int "Max number of WiFi dynamic TX buffers"
108        depends on ESP32_WIFI_DYNAMIC_TX_BUFFER
109        range 1 128
110        default 32
111        help
112            Set the number of WiFi dynamic TX buffers. The size of each dynamic TX buffer is not fixed,
113            it depends on the size of each transmitted data frame.
114
115            For each transmitted frame from the higher layer TCP/IP stack, the WiFi driver makes a copy
116            of it in a TX buffer. For some applications, especially UDP applications, the upper layer
117            can deliver frames faster than WiFi layer can transmit. In these cases, we may run out of TX
118            buffers.
119
120    config ESP32_WIFI_CSI_ENABLED
121        bool "WiFi CSI(Channel State Information)"
122        default n
123        help
124            Select this option to enable CSI(Channel State Information) feature. CSI takes about
125            CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM KB of RAM. If CSI is not used, it is better to disable
126            this feature in order to save memory.
127
128    config ESP32_WIFI_AMPDU_TX_ENABLED
129        bool "WiFi AMPDU TX"
130        default y
131        help
132            Select this option to enable AMPDU TX feature
133
134
135    config ESP32_WIFI_TX_BA_WIN
136        int "WiFi AMPDU TX BA window size"
137        depends on ESP32_WIFI_AMPDU_TX_ENABLED
138        range 2 32
139        default 6
140        help
141            Set the size of WiFi Block Ack TX window. Generally a bigger value means higher throughput but
142            more memory. Most of time we should NOT change the default value unless special reason, e.g.
143            test the maximum UDP TX throughput with iperf etc. For iperf test in shieldbox, the recommended
144            value is 9~12.
145
146    config ESP32_WIFI_AMPDU_RX_ENABLED
147        bool "WiFi AMPDU RX"
148        default y
149        help
150            Select this option to enable AMPDU RX feature
151
152    config ESP32_WIFI_RX_BA_WIN
153        int "WiFi AMPDU RX BA window size"
154        depends on ESP32_WIFI_AMPDU_RX_ENABLED
155        range 2 32
156        default 6 if !SPIRAM_TRY_ALLOCATE_WIFI_LWIP
157        default 16 if SPIRAM_TRY_ALLOCATE_WIFI_LWIP
158        help
159            Set the size of WiFi Block Ack RX window. Generally a bigger value means higher throughput and better
160            compatibility but more memory. Most of time we should NOT change the default value unless special
161            reason, e.g. test the maximum UDP RX throughput with iperf etc. For iperf test in shieldbox, the
162            recommended value is 9~12. If PSRAM is used and WiFi memory is prefered to allocat in PSRAM first,
163            the default and minimum value should be 16 to achieve better throughput and compatibility with both
164            stations and APs.
165
166    config ESP32_WIFI_AMSDU_TX_ENABLED
167        bool "WiFi AMSDU TX"
168        depends on (ESP32_SPIRAM_SUPPORT || ESP32S2_SPIRAM_SUPPORT || ESP32S3_SPIRAM_SUPPORT)
169        default n
170        help
171            Select this option to enable AMSDU TX feature
172
173    config ESP32_WIFI_NVS_ENABLED
174        bool "WiFi NVS flash"
175        default y
176        help
177            Select this option to enable WiFi NVS flash
178
179    choice ESP32_WIFI_TASK_CORE_ID
180        depends on !FREERTOS_UNICORE
181        prompt "WiFi Task Core ID"
182        default ESP32_WIFI_TASK_PINNED_TO_CORE_0
183        help
184            Pinned WiFi task to core 0 or core 1.
185
186        config ESP32_WIFI_TASK_PINNED_TO_CORE_0
187            bool "Core 0"
188        config ESP32_WIFI_TASK_PINNED_TO_CORE_1
189            bool "Core 1"
190    endchoice
191
192    config ESP32_WIFI_SOFTAP_BEACON_MAX_LEN
193        int "Max length of WiFi SoftAP Beacon"
194        range 752 1256
195        default 752
196        help
197            ESP-MESH utilizes beacon frames to detect and resolve root node conflicts (see documentation). However the
198            default length of a beacon frame can simultaneously hold only five root node identifier structures,
199            meaning that a root node conflict of up to five nodes can be detected at one time. In the occurence of
200            more root nodes conflict involving more than five root nodes, the conflict resolution process will detect
201            five of the root nodes, resolve the conflict, and re-detect more root nodes. This process will repeat
202            until all root node conflicts are resolved. However this process can generally take a very long time.
203
204            To counter this situation, the beacon frame length can be increased such that more root nodes can be
205            detected simultaneously. Each additional root node will require 36 bytes and should be added ontop of the
206            default beacon frame length of
207            752 bytes. For example, if you want to detect 10 root nodes simultaneously, you need to set the beacon
208            frame length as
209            932 (752+36*5).
210
211            Setting a longer beacon length also assists with debugging as the conflicting root nodes can be identified
212            more quickly.
213
214    config ESP32_WIFI_MGMT_SBUF_NUM
215        int "WiFi mgmt short buffer number"
216        range 6 32
217        default 32
218        help
219            Set the number of WiFi management short buffer.
220
221    config ESP32_WIFI_DEBUG_LOG_ENABLE
222        bool "Enable WiFi debug log"
223        default n
224        help
225            Select this option to enable WiFi debug log
226
227    choice ESP32_WIFI_DEBUG_LOG_LEVEL
228        depends on ESP32_WIFI_DEBUG_LOG_ENABLE
229        prompt "WiFi debug log level"
230        default ESP32_WIFI_DEBUG_LOG_DEBUG
231        help
232            The WiFi log is divided into the following levels: ERROR,WARNING,INFO,DEBUG,VERBOSE.
233            The ERROR,WARNING,INFO levels are enabled by default, and the DEBUG,VERBOSE levels can be enabled here.
234
235        config ESP32_WIFI_DEBUG_LOG_DEBUG
236            bool "WiFi Debug Log Debug"
237        config ESP32_WIFI_DEBUG_LOG_VERBOSE
238            bool "WiFi Debug Log Verbose"
239    endchoice
240
241    choice ESP32_WIFI_DEBUG_LOG_MODULE
242        depends on ESP32_WIFI_DEBUG_LOG_ENABLE
243        prompt "WiFi debug log module"
244        default ESP32_WIFI_DEBUG_LOG_MODULE_WIFI
245        help
246            The WiFi log module contains three parts: WIFI,COEX,MESH. The WIFI module indicates the logs related to
247            WiFi, the COEX module indicates the logs related to WiFi and BT(or BLE) coexist, the MESH module indicates
248            the logs related to Mesh. When ESP32_WIFI_LOG_MODULE_ALL is enabled, all modules are selected.
249
250        config ESP32_WIFI_DEBUG_LOG_MODULE_ALL
251            bool "WiFi Debug Log Module All"
252        config ESP32_WIFI_DEBUG_LOG_MODULE_WIFI
253            bool "WiFi Debug Log Module WiFi"
254        config ESP32_WIFI_DEBUG_LOG_MODULE_COEX
255            bool "WiFi Debug Log Module Coex"
256        config ESP32_WIFI_DEBUG_LOG_MODULE_MESH
257            bool "WiFi Debug Log Module Mesh"
258    endchoice
259
260    config ESP32_WIFI_DEBUG_LOG_SUBMODULE
261        depends on ESP32_WIFI_DEBUG_LOG_ENABLE
262        bool "WiFi debug log submodule"
263        default n
264        help
265            Enable this option to set the WiFi debug log submodule.
266            Currently the log submodule contains the following parts: INIT,IOCTL,CONN,SCAN.
267            The INIT submodule indicates the initialization process.The IOCTL submodule indicates the API calling
268            process.
269            The CONN submodule indicates the connecting process.The SCAN submodule indicates the scaning process.
270
271    config ESP32_WIFI_DEBUG_LOG_SUBMODULE_ALL
272        depends on ESP32_WIFI_DEBUG_LOG_SUBMODULE
273        bool "WiFi Debug Log Submodule All"
274        default n
275        help
276            When this option is enabled, all debug submodules are selected.
277
278    config ESP32_WIFI_DEBUG_LOG_SUBMODULE_INIT
279        depends on ESP32_WIFI_DEBUG_LOG_SUBMODULE && (!ESP32_WIFI_DEBUG_LOG_SUBMODULE_ALL)
280        bool "WiFi Debug Log Submodule Init"
281        default n
282
283    config ESP32_WIFI_DEBUG_LOG_SUBMODULE_IOCTL
284        depends on ESP32_WIFI_DEBUG_LOG_SUBMODULE && (!ESP32_WIFI_DEBUG_LOG_SUBMODULE_ALL)
285        bool "WiFi Debug Log Submodule Ioctl"
286        default n
287
288    config ESP32_WIFI_DEBUG_LOG_SUBMODULE_CONN
289        depends on ESP32_WIFI_DEBUG_LOG_SUBMODULE && (!ESP32_WIFI_DEBUG_LOG_SUBMODULE_ALL)
290        bool "WiFi Debug Log Submodule Conn"
291        default n
292
293    config ESP32_WIFI_DEBUG_LOG_SUBMODULE_SCAN
294        depends on ESP32_WIFI_DEBUG_LOG_SUBMODULE && (!ESP32_WIFI_DEBUG_LOG_SUBMODULE_ALL)
295        bool "WiFi Debug Log Submodule Scan"
296        default n
297
298    config ESP32_WIFI_IRAM_OPT
299        bool "WiFi IRAM speed optimization"
300        default n if (BT_ENABLED && ESP32_SPIRAM_SUPPORT)
301        default y
302        help
303            Select this option to place frequently called Wi-Fi library functions in IRAM.
304            When this option is disabled, more than 10Kbytes of IRAM memory will be saved
305            but Wi-Fi throughput will be reduced.
306
307    config ESP32_WIFI_RX_IRAM_OPT
308        bool "WiFi RX IRAM speed optimization"
309        default n if (BT_ENABLED && ESP32_SPIRAM_SUPPORT)
310        default y
311        help
312            Select this option to place frequently called Wi-Fi library RX functions in IRAM.
313            When this option is disabled, more than 17Kbytes of IRAM memory will be saved
314            but Wi-Fi performance will be reduced.
315
316    config ESP32_WIFI_ENABLE_WPA3_SAE
317        bool "Enable WPA3-Personal"
318        default y
319        help
320            Select this option to allow the device to establish a WPA3-Personal connection with eligible AP's.
321            PMF (Protected Management Frames) is a prerequisite feature for a WPA3 connection, it needs to be
322            explicitly configured before attempting connection. Please refer to the Wi-Fi Driver API Guide for details.
323
324    config ESP_WIFI_SLP_IRAM_OPT
325        bool "WiFi SLP IRAM speed optimization"
326        depends on FREERTOS_USE_TICKLESS_IDLE
327        select PM_SLP_DEFAULT_PARAMS_OPT
328        help
329            Select this option to place called Wi-Fi library TBTT process and receive beacon functions in IRAM.
330            Some functions can be put in IRAM either by ESP32_WIFI_IRAM_OPT and ESP32_WIFI_RX_IRAM_OPT, or this one.
331            If already enabled ESP32_WIFI_IRAM_OPT, the other 7.3KB IRAM memory would be taken by this option.
332            If already enabled ESP32_WIFI_RX_IRAM_OPT, the other 1.3KB IRAM memory would be taken by this option.
333            If neither of them are enabled, the other 7.4KB IRAM memory would be taken by this option.
334            Wi-Fi power-save mode average current would be reduced if this option is enabled.
335
336    config ESP_WIFI_SLP_DEFAULT_MIN_ACTIVE_TIME
337        int "Minimum active time"
338        range 8 60
339        default 8
340        depends on ESP_WIFI_SLP_IRAM_OPT
341        help
342            The minimum timeout for waiting to receive data, unit: milliseconds.
343
344    config ESP_WIFI_SLP_DEFAULT_MAX_ACTIVE_TIME
345        int "Maximum keep alive time"
346        range 10 60
347        default 60
348        depends on ESP_WIFI_SLP_IRAM_OPT
349        help
350            The maximum time that wifi keep alive, unit: seconds.
351
352    config ESP_WIFI_FTM_ENABLE
353        bool "WiFi FTM"
354        default n
355        depends on (IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3)
356        help
357            Enable feature Fine Timing Measurement for calculating WiFi Round-Trip-Time (RTT).
358
359    config ESP_WIFI_FTM_INITIATOR_SUPPORT
360        bool "FTM Initiator support"
361        default y
362        depends on ESP_WIFI_FTM_ENABLE
363
364    config ESP_WIFI_FTM_RESPONDER_SUPPORT
365        bool "FTM Responder support"
366        default y
367        depends on ESP_WIFI_FTM_ENABLE
368
369    config ESP_WIFI_STA_DISCONNECTED_PM_ENABLE
370        bool "Power Management for station at disconnected"
371        help
372            Select this option to enable power_management for station when disconnected.
373            Chip will do modem-sleep when rf module is not in use any more.
374
375endmenu  # Wi-Fi
376
377menu "PHY"
378
379    config ESP32_PHY_CALIBRATION_AND_DATA_STORAGE
380        # ToDo: remove target dependency once NVS and PHY partial calibration are supported
381        # also re-enable the <RF_calibration> entry in docs/../api-guides/index.rst
382        depends on IDF_TARGET_ESP32
383        bool "Store phy calibration data in NVS"
384        default y
385        help
386            If this option is enabled, NVS will be initialized and calibration data will be loaded from there.
387            PHY calibration will be skipped on deep sleep wakeup. If calibration data is not found, full calibration
388            will be performed and stored in NVS. Normally, only partial calibration will be performed.
389            If this option is disabled, full calibration will be performed.
390
391            If it's easy that your board calibrate bad data, choose 'n'.
392            Two cases for example, you should choose 'n':
393            1.If your board is easy to be booted up with antenna disconnected.
394            2.Because of your board design, each time when you do calibration, the result are too unstable.
395            If unsure, choose 'y'.
396
397    menuconfig ESP32_PHY_INIT_DATA_IN_PARTITION
398        bool "Use a partition to store PHY init data"
399        default n
400        help
401            If enabled, PHY init data will be loaded from a partition.
402            When using a custom partition table, make sure that PHY data
403            partition is included (type: 'data', subtype: 'phy').
404            With default partition tables, this is done automatically.
405            If PHY init data is stored in a partition, it has to be flashed there,
406            otherwise runtime error will occur.
407
408            If this option is not enabled, PHY init data will be embedded
409            into the application binary.
410
411            If unsure, choose 'n'.
412
413    if ESP32_PHY_INIT_DATA_IN_PARTITION
414        config ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN
415            bool "Support multiple PHY init data bin"
416            depends on ESP32_PHY_INIT_DATA_IN_PARTITION
417            default n
418            help
419                If enabled, the corresponding PHY init data type can be automatically switched
420                according to the country code. China's PHY init data bin is used by default.
421                Can be modified by country information in API esp_wifi_set_country().
422                The priority of switching the PHY init data type is:
423                1. Country configured by API esp_wifi_set_country()
424                and the parameter policy is WIFI_COUNTRY_POLICY_MANUAL.
425                2. Country notified by the connected AP.
426                3. Country configured by API esp_wifi_set_country()
427                and the parameter policy is WIFI_COUNTRY_POLICY_AUTO.
428
429        config ESP32_PHY_INIT_DATA_ERROR
430            bool "Terminate operation when PHY init data error"
431            depends on ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN
432            default n
433            help
434                If enabled, when an error occurs while the PHY init data is updated,
435                the program will terminate and restart.
436                If not enabled, the PHY init data will not be updated when an error occurs.
437    endif
438
439    config ESP32_PHY_MAX_WIFI_TX_POWER
440        int "Max WiFi TX power (dBm)"
441        range 10 20
442        default 20
443        help
444            Set maximum transmit power for WiFi radio. Actual transmit power for high
445            data rates may be lower than this setting.
446
447    config ESP32_PHY_MAX_TX_POWER
448        int
449        default ESP32_PHY_MAX_WIFI_TX_POWER
450
451    config ESP32_PHY_MAC_BB_PD
452        bool "Power down MAC and baseband of Wi-Fi and Bluetooth when PHY is disabled"
453        depends on (IDF_TARGET_ESP32C3 && FREERTOS_USE_TICKLESS_IDLE)
454        default n
455        help
456            If enabled, the MAC and baseband of Wi-Fi and Bluetooth will be powered
457            down when PHY is disabled. Enabling this setting reduces power consumption
458            by a small amount but increases RAM use by approximately 4 KB(Wi-Fi only),
459            2 KB(Bluetooth only) or 5.3 KB(Wi-Fi + Bluetooth).
460
461endmenu  # PHY
462