Kconfig 21 KB

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