Kconfig.in 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552
  1. menu "HCI Config"
  2. choice BT_LE_HCI_INTERFACE
  3. prompt "Select HCI interface"
  4. default BT_LE_HCI_INTERFACE_USE_RAM
  5. config BT_LE_HCI_INTERFACE_USE_RAM
  6. bool "ram"
  7. help
  8. Use RAM as HCI interface
  9. config BT_LE_HCI_INTERFACE_USE_UART
  10. bool "uart"
  11. help
  12. Use UART as HCI interface
  13. endchoice
  14. config BT_LE_HCI_UART_PORT
  15. int "HCI UART port"
  16. depends on BT_LE_HCI_INTERFACE_USE_UART
  17. default 1
  18. help
  19. Set the port number of HCI UART
  20. config BT_LE_HCI_UART_FLOWCTRL
  21. bool "HCI uart Hardware Flow ctrl"
  22. depends on BT_LE_HCI_INTERFACE_USE_UART
  23. default n
  24. config BT_LE_HCI_UART_TX_PIN
  25. int "HCI uart Tx gpio"
  26. depends on BT_LE_HCI_INTERFACE_USE_UART
  27. default 19
  28. config BT_LE_HCI_UART_RX_PIN
  29. int "HCI uart Rx gpio"
  30. depends on BT_LE_HCI_INTERFACE_USE_UART
  31. default 10
  32. config BT_LE_HCI_UART_RTS_PIN
  33. int "HCI uart RTS gpio"
  34. depends on BT_LE_HCI_UART_FLOWCTRL
  35. default 4
  36. config BT_LE_HCI_UART_CTS_PIN
  37. int "HCI uart CTS gpio"
  38. depends on BT_LE_HCI_UART_FLOWCTRL
  39. default 5
  40. config BT_LE_HCI_UART_BAUD
  41. int "HCI uart baudrate"
  42. depends on BT_LE_HCI_INTERFACE_USE_UART
  43. default 921600
  44. help
  45. HCI uart baud rate 115200 ~ 1000000
  46. choice BT_LE_HCI_UART_PARITY
  47. prompt "select uart parity"
  48. depends on BT_LE_HCI_INTERFACE_USE_UART
  49. default BT_LE_HCI_UART_UART_PARITY_DISABLE
  50. config BT_LE_HCI_UART_UART_PARITY_DISABLE
  51. bool "PARITY_DISABLE"
  52. help
  53. UART_PARITY_DISABLE
  54. config BT_LE_HCI_UART_UART_PARITY_EVEN
  55. bool "PARITY_EVEN"
  56. help
  57. UART_PARITY_EVEN
  58. config BT_LE_HCI_UART_UART_PARITY_ODD
  59. bool "PARITY_ODD"
  60. help
  61. UART_PARITY_ODD
  62. endchoice
  63. config BT_LE_HCI_UART_TASK_STACK_SIZE
  64. int "HCI uart task stack size"
  65. depends on BT_LE_HCI_INTERFACE_USE_UART
  66. default 1000
  67. help
  68. Set the size of uart task stack
  69. endmenu
  70. config BT_LE_CONTROLLER_NPL_OS_PORTING_SUPPORT
  71. bool
  72. default y
  73. help
  74. Enable NPL porting for controller.
  75. menuconfig BT_LE_50_FEATURE_SUPPORT
  76. bool "Enable BLE 5 feature"
  77. depends on !BT_NIMBLE_ENABLED
  78. default y
  79. help
  80. Enable BLE 5 feature
  81. config BT_LE_LL_CFG_FEAT_LE_2M_PHY
  82. bool "Enable 2M Phy"
  83. depends on BT_LE_50_FEATURE_SUPPORT
  84. default y
  85. help
  86. Enable 2M-PHY
  87. config BT_LE_LL_CFG_FEAT_LE_CODED_PHY
  88. bool "Enable coded Phy"
  89. depends on BT_LE_50_FEATURE_SUPPORT
  90. default y
  91. help
  92. Enable coded-PHY
  93. config BT_LE_EXT_ADV
  94. bool "Enable extended advertising"
  95. depends on BT_LE_50_FEATURE_SUPPORT
  96. default y
  97. help
  98. Enable this option to do extended advertising. Extended advertising
  99. will be supported from BLE 5.0 onwards.
  100. if BT_LE_EXT_ADV
  101. config BT_LE_MAX_EXT_ADV_INSTANCES
  102. int "Maximum number of extended advertising instances."
  103. range 0 4
  104. default 1
  105. depends on BT_LE_EXT_ADV
  106. help
  107. Change this option to set maximum number of extended advertising
  108. instances. Minimum there is always one instance of
  109. advertising. Enter how many more advertising instances you
  110. want.
  111. Each extended advertising instance will take about 0.5k DRAM.
  112. config BT_LE_EXT_ADV_MAX_SIZE
  113. int "Maximum length of the advertising data."
  114. range 0 1650
  115. default 1650
  116. depends on BT_LE_EXT_ADV
  117. help
  118. Defines the length of the extended adv data. The value should not
  119. exceed 1650.
  120. config BT_LE_ENABLE_PERIODIC_ADV
  121. bool "Enable periodic advertisement."
  122. default y
  123. depends on BT_LE_EXT_ADV
  124. help
  125. Enable this option to start periodic advertisement.
  126. config BT_LE_PERIODIC_ADV_SYNC_TRANSFER
  127. bool "Enable Transer Sync Events"
  128. depends on BT_LE_ENABLE_PERIODIC_ADV
  129. default y
  130. help
  131. This enables controller transfer periodic sync events to host
  132. endif
  133. config BT_LE_MAX_PERIODIC_SYNCS
  134. int "Maximum number of periodic advertising syncs"
  135. depends on BT_LE_50_FEATURE_SUPPORT && !BT_NIMBLE_ENABLED
  136. range 0 8
  137. default 1 if BT_LE_ENABLE_PERIODIC_ADV
  138. default 0
  139. help
  140. Set this option to set the upper limit for number of periodic sync
  141. connections. This should be less than maximum connections allowed by
  142. controller.
  143. config BT_LE_MAX_PERIODIC_ADVERTISER_LIST
  144. int "Maximum number of periodic advertiser list"
  145. depends on BT_LE_50_FEATURE_SUPPORT && !BT_NIMBLE_ENABLED
  146. range 1 5
  147. default 5
  148. help
  149. Set this option to set the upper limit for number of periodic advertiser list.
  150. config BT_LE_POWER_CONTROL_ENABLED
  151. bool "Enable controller support for BLE Power Control"
  152. depends on BT_LE_50_FEATURE_SUPPORT && !BT_NIMBLE_ENABLED && IDF_TARGET_ESP32C6
  153. default n
  154. help
  155. Set this option to enable the Power Control feature on controller
  156. menu "Memory Settings"
  157. depends on !BT_NIMBLE_ENABLED
  158. config BT_LE_MSYS_1_BLOCK_COUNT
  159. int "MSYS_1 Block Count"
  160. default 12
  161. help
  162. MSYS is a system level mbuf registry. For prepare write & prepare
  163. responses MBUFs are allocated out of msys_1 pool. For NIMBLE_MESH
  164. enabled cases, this block count is increased by 8 than user defined
  165. count.
  166. config BT_LE_MSYS_1_BLOCK_SIZE
  167. int "MSYS_1 Block Size"
  168. default 256
  169. help
  170. Dynamic memory size of block 1
  171. config BT_LE_MSYS_2_BLOCK_COUNT
  172. int "MSYS_2 Block Count"
  173. default 24
  174. help
  175. Dynamic memory count
  176. config BT_LE_MSYS_2_BLOCK_SIZE
  177. int "MSYS_2 Block Size"
  178. default 320
  179. help
  180. Dynamic memory size of block 2
  181. config BT_LE_MSYS_BUF_FROM_HEAP
  182. bool "Get Msys Mbuf from heap"
  183. default y
  184. depends on BT_LE_MSYS_INIT_IN_CONTROLLER
  185. help
  186. This option sets the source of the shared msys mbuf memory between
  187. the Host and the Controller. Allocate the memory from the heap if
  188. this option is sets, from the mempool otherwise.
  189. config BT_LE_ACL_BUF_COUNT
  190. int "ACL Buffer count"
  191. default 10
  192. help
  193. The number of ACL data buffers.
  194. config BT_LE_ACL_BUF_SIZE
  195. int "ACL Buffer size"
  196. default 517
  197. help
  198. This is the maximum size of the data portion of HCI ACL data packets.
  199. It does not include the HCI data header (of 4 bytes)
  200. config BT_LE_HCI_EVT_BUF_SIZE
  201. int "HCI Event Buffer size"
  202. default 257 if BT_LE_EXT_ADV
  203. default 70
  204. help
  205. This is the size of each HCI event buffer in bytes. In case of
  206. extended advertising, packets can be fragmented. 257 bytes is the
  207. maximum size of a packet.
  208. config BT_LE_HCI_EVT_HI_BUF_COUNT
  209. int "High Priority HCI Event Buffer count"
  210. default 30
  211. help
  212. This is the high priority HCI events' buffer size. High-priority
  213. event buffers are for everything except advertising reports. If there
  214. are no free high-priority event buffers then host will try to allocate a
  215. low-priority buffer instead
  216. config BT_LE_HCI_EVT_LO_BUF_COUNT
  217. int "Low Priority HCI Event Buffer count"
  218. default 8
  219. help
  220. This is the low priority HCI events' buffer size. Low-priority event
  221. buffers are only used for advertising reports. If there are no free
  222. low-priority event buffers, then an incoming advertising report will
  223. get dropped
  224. endmenu
  225. config BT_LE_CONTROLLER_TASK_STACK_SIZE
  226. int "Controller task stack size"
  227. default 5120 if BLE_MESH
  228. default 4096
  229. help
  230. This configures stack size of NimBLE controller task
  231. config BT_LE_CONTROLLER_LOG_ENABLED
  232. bool "Controller log enable"
  233. default n
  234. help
  235. Enable controller log
  236. config BT_LE_CONTROLLER_LOG_CTRL_ENABLED
  237. bool "enable controller log module"
  238. depends on BT_LE_CONTROLLER_LOG_ENABLED
  239. default y
  240. help
  241. Enable controller log module
  242. config BT_LE_CONTROLLER_LOG_HCI_ENABLED
  243. bool "enable HCI log module"
  244. depends on BT_LE_CONTROLLER_LOG_ENABLED
  245. default y
  246. help
  247. Enable hci log module
  248. config BT_LE_CONTROLLER_LOG_DUMP_ONLY
  249. bool "Controller log dump mode only"
  250. depends on BT_LE_CONTROLLER_LOG_ENABLED
  251. default y
  252. help
  253. Only operate in dump mode
  254. config BT_LE_LL_RESOLV_LIST_SIZE
  255. int "BLE LL Resolving list size"
  256. range 1 5
  257. default 4
  258. help
  259. Configure the size of resolving list used in link layer.
  260. menuconfig BT_LE_SECURITY_ENABLE
  261. bool "Enable BLE SM feature"
  262. depends on !BT_NIMBLE_ENABLED
  263. default y
  264. help
  265. Enable BLE sm feature
  266. config BT_LE_SM_LEGACY
  267. bool "Security manager legacy pairing"
  268. depends on BT_LE_SECURITY_ENABLE
  269. default y
  270. help
  271. Enable security manager legacy pairing
  272. config BT_LE_SM_SC
  273. bool "Security manager secure connections (4.2)"
  274. depends on BT_LE_SECURITY_ENABLE
  275. default y
  276. help
  277. Enable security manager secure connections
  278. config BT_LE_SM_SC_DEBUG_KEYS
  279. bool "Use predefined public-private key pair"
  280. default n
  281. depends on BT_LE_SECURITY_ENABLE && BT_LE_SM_SC
  282. help
  283. If this option is enabled, SM uses predefined DH key pair as described
  284. in Core Specification, Vol. 3, Part H, 2.3.5.6.1. This allows to
  285. decrypt air traffic easily and thus should only be used for debugging.
  286. config BT_LE_LL_CFG_FEAT_LE_ENCRYPTION
  287. bool "Enable LE encryption"
  288. depends on BT_LE_SECURITY_ENABLE
  289. default y
  290. help
  291. Enable encryption connection
  292. config BT_LE_CRYPTO_STACK_MBEDTLS
  293. bool "Override TinyCrypt with mbedTLS for crypto computations"
  294. default y
  295. depends on !BT_NIMBLE_ENABLED
  296. select MBEDTLS_ECP_RESTARTABLE
  297. select MBEDTLS_CMAC_C
  298. help
  299. Enable this option to choose mbedTLS instead of TinyCrypt for crypto
  300. computations.
  301. config BT_LE_WHITELIST_SIZE
  302. int "BLE white list size"
  303. range 1 15
  304. default 12
  305. depends on !BT_NIMBLE_ENABLED
  306. help
  307. BLE list size
  308. config BT_LE_LL_DUP_SCAN_LIST_COUNT
  309. int "BLE duplicate scan list count"
  310. range 1 100
  311. default 20
  312. help
  313. config the max count of duplicate scan list
  314. config BT_LE_LL_SCA
  315. int "BLE Sleep clock accuracy"
  316. range 0 500
  317. default 60
  318. help
  319. Sleep clock accuracy of our device (in ppm)
  320. config BT_LE_MAX_CONNECTIONS
  321. int "Maximum number of concurrent connections"
  322. depends on !BT_NIMBLE_ENABLED
  323. range 1 70
  324. default 3
  325. help
  326. Defines maximum number of concurrent BLE connections. For ESP32, user
  327. is expected to configure BTDM_CTRL_BLE_MAX_CONN from controller menu
  328. along with this option. Similarly for ESP32-C3 or ESP32-S3, user is expected to
  329. configure BT_CTRL_BLE_MAX_ACT from controller menu.
  330. Each connection will take about 1k DRAM.
  331. choice BT_LE_COEX_PHY_CODED_TX_RX_TLIM
  332. prompt "Coexistence: limit on MAX Tx/Rx time for coded-PHY connection"
  333. default BT_LE_COEX_PHY_CODED_TX_RX_TLIM_DIS
  334. depends on ESP_COEX_SW_COEXIST_ENABLE
  335. help
  336. When using PHY-Coded in BLE connection, limitation on max tx/rx time can be applied to
  337. better avoid dramatic performance deterioration of Wi-Fi.
  338. config BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EN
  339. bool "Force Enable"
  340. help
  341. Always enable the limitation on max tx/rx time for Coded-PHY connection
  342. config BT_LE_COEX_PHY_CODED_TX_RX_TLIM_DIS
  343. bool "Force Disable"
  344. help
  345. Disable the limitation on max tx/rx time for Coded-PHY connection
  346. endchoice
  347. config BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF
  348. int
  349. default 0 if !ESP_COEX_SW_COEXIST_ENABLE
  350. default 1 if BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EN
  351. default 0 if BT_LE_COEX_PHY_CODED_TX_RX_TLIM_DIS
  352. config BT_LE_SLEEP_ENABLE
  353. bool "Enable BLE sleep"
  354. default n
  355. help
  356. Enable BLE sleep
  357. choice BT_LE_LP_CLK_SRC
  358. prompt "BLE low power clock source"
  359. default BT_LE_LP_CLK_SRC_MAIN_XTAL
  360. config BT_LE_LP_CLK_SRC_MAIN_XTAL
  361. bool "Use main XTAL as RTC clock source"
  362. help
  363. User main XTAL as RTC clock source.
  364. This option is recommended if external 32.768k XTAL is not available.
  365. Using the external 32.768 kHz XTAL will have lower current consumption
  366. in light sleep compared to using the main XTAL.
  367. config BT_LE_LP_CLK_SRC_DEFAULT
  368. bool "Use system RTC slow clock source"
  369. help
  370. Use the same slow clock source as system RTC
  371. Using any clock source other than external 32.768 kHz XTAL supports only
  372. legacy ADV and SCAN due to low clock accuracy.
  373. endchoice
  374. config BT_LE_USE_ESP_TIMER
  375. bool "Enable Esp Timer for Callout"
  376. depends on !BT_NIMBLE_ENABLED
  377. default y
  378. help
  379. Set this option to use Esp Timer which has higher priority timer
  380. instead of FreeRTOS timer
  381. config BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP
  382. bool "BLE adv report flow control supported"
  383. default y
  384. help
  385. The function is mainly used to enable flow control for advertising reports. When it is enabled,
  386. advertising reports will be discarded by the controller if the number of unprocessed advertising
  387. reports exceeds the size of BLE adv report flow control.
  388. config BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM
  389. int "BLE adv report flow control number"
  390. depends on BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP
  391. range 50 1000
  392. default 100
  393. help
  394. The number of unprocessed advertising report that bluetooth host can save.If you set
  395. `BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM` to a small value, this may cause adv packets lost.
  396. If you set `BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM` to a large value, bluetooth host may cache a
  397. lot of adv packets and this may cause system memory run out. For example, if you set
  398. it to 50, the maximum memory consumed by host is 35 * 50 bytes. Please set
  399. `BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM` according to your system free memory and handle adv
  400. packets as fast as possible, otherwise it will cause adv packets lost.
  401. config BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD
  402. int "BLE adv lost event threshold value"
  403. depends on BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP
  404. range 1 1000
  405. default 20
  406. help
  407. When adv report flow control is enabled, The ADV lost event will be generated when the number
  408. of ADV packets lost in the controller reaches this threshold. It is better to set a larger value.
  409. If you set `BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD` to a small value or printf every adv lost event, it
  410. may cause adv packets lost more.
  411. config BT_LE_SCAN_DUPL
  412. bool "BLE Scan Duplicate Options"
  413. default y
  414. help
  415. This select enables parameters setting of BLE scan duplicate.
  416. choice BT_LE_SCAN_DUPL_TYPE
  417. prompt "Scan Duplicate Type"
  418. default BT_LE_SCAN_DUPL_TYPE_DEVICE
  419. depends on BT_LE_SCAN_DUPL
  420. help
  421. Scan duplicate have three ways. one is "Scan Duplicate By Device Address", This way is to use
  422. advertiser address filtering. The adv packet of the same address is only allowed to be reported once.
  423. Another way is "Scan Duplicate By Device Address And Advertising Data". This way is to use advertising
  424. data and device address filtering. All different adv packets with the same address are allowed to be
  425. reported. The last way is "Scan Duplicate By Advertising Data". This way is to use advertising data
  426. filtering. All same advertising data only allow to be reported once even though they are from
  427. different devices.
  428. config BT_LE_SCAN_DUPL_TYPE_DEVICE
  429. bool "Scan Duplicate By Device Address"
  430. help
  431. This way is to use advertiser address filtering. The adv packet of the same address is only
  432. allowed to be reported once
  433. config BT_LE_SCAN_DUPL_TYPE_DATA
  434. bool "Scan Duplicate By Advertising Data"
  435. help
  436. This way is to use advertising data filtering. All same advertising data only allow to be reported
  437. once even though they are from different devices.
  438. config BT_LE_SCAN_DUPL_TYPE_DATA_DEVICE
  439. bool "Scan Duplicate By Device Address And Advertising Data"
  440. help
  441. This way is to use advertising data and device address filtering. All different adv packets with
  442. the same address are allowed to be reported.
  443. endchoice
  444. config BT_LE_SCAN_DUPL_TYPE
  445. int
  446. depends on BT_LE_SCAN_DUPL
  447. default 0 if BT_LE_SCAN_DUPL_TYPE_DEVICE
  448. default 1 if BT_LE_SCAN_DUPL_TYPE_DATA
  449. default 2 if BT_LE_SCAN_DUPL_TYPE_DATA_DEVICE
  450. default 0
  451. config BT_LE_SCAN_DUPL_CACHE_SIZE
  452. int "Maximum number of devices in scan duplicate filter"
  453. depends on BT_LE_SCAN_DUPL
  454. range 10 1000
  455. default 100
  456. help
  457. Maximum number of devices which can be recorded in scan duplicate filter.
  458. When the maximum amount of device in the filter is reached, the cache will be refreshed.
  459. config BT_LE_SCAN_DUPL_CACHE_REFRESH_PERIOD
  460. int "Duplicate scan list refresh period (seconds)"
  461. depends on BT_LE_SCAN_DUPL
  462. range 0 1000
  463. default 0
  464. help
  465. If the period value is non-zero, the controller will periodically clear the device information
  466. stored in the scan duuplicate filter. If it is 0, the scan duuplicate filter will not be cleared
  467. until the scanning is disabled. Duplicate advertisements for this period should not be sent to the
  468. Host in advertising report events.
  469. There are two scenarios where the ADV packet will be repeatedly reported:
  470. 1. The duplicate scan cache is full, the controller will delete the oldest device information and
  471. add new device information.
  472. 2. When the refresh period is up, the controller will clear all device information and start filtering
  473. again.
  474. config BT_LE_MSYS_INIT_IN_CONTROLLER
  475. bool "Msys Mbuf Init in Controller"
  476. default y