Kconfig.in 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  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
  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_ACL_BUF_COUNT
  182. int "ACL Buffer count"
  183. default 10
  184. help
  185. The number of ACL data buffers.
  186. config BT_LE_ACL_BUF_SIZE
  187. int "ACL Buffer size"
  188. default 517
  189. help
  190. This is the maximum size of the data portion of HCI ACL data packets.
  191. It does not include the HCI data header (of 4 bytes)
  192. config BT_LE_HCI_EVT_BUF_SIZE
  193. int "HCI Event Buffer size"
  194. default 257 if BT_LE_EXT_ADV
  195. default 70
  196. help
  197. This is the size of each HCI event buffer in bytes. In case of
  198. extended advertising, packets can be fragmented. 257 bytes is the
  199. maximum size of a packet.
  200. config BT_LE_HCI_EVT_HI_BUF_COUNT
  201. int "High Priority HCI Event Buffer count"
  202. default 30
  203. help
  204. This is the high priority HCI events' buffer size. High-priority
  205. event buffers are for everything except advertising reports. If there
  206. are no free high-priority event buffers then host will try to allocate a
  207. low-priority buffer instead
  208. config BT_LE_HCI_EVT_LO_BUF_COUNT
  209. int "Low Priority HCI Event Buffer count"
  210. default 8
  211. help
  212. This is the low priority HCI events' buffer size. Low-priority event
  213. buffers are only used for advertising reports. If there are no free
  214. low-priority event buffers, then an incoming advertising report will
  215. get dropped
  216. endmenu
  217. config BT_LE_CONTROLLER_TASK_STACK_SIZE
  218. int "Controller task stack size"
  219. default 5120 if BLE_MESH
  220. default 4096
  221. help
  222. This configures stack size of NimBLE controller task
  223. config BT_LE_CONTROLLER_LOG_ENABLED
  224. bool "Controller log enable"
  225. default n
  226. help
  227. Enable controller log
  228. config BT_LE_CONTROLLER_LOG_CTRL_ENABLED
  229. bool "enable controller log module"
  230. depends on BT_LE_CONTROLLER_LOG_ENABLED
  231. default y
  232. help
  233. Enable controller log module
  234. config BT_LE_CONTROLLER_LOG_HCI_ENABLED
  235. bool "enable HCI log module"
  236. depends on BT_LE_CONTROLLER_LOG_ENABLED
  237. default y
  238. help
  239. Enable hci log module
  240. config BT_LE_CONTROLLER_LOG_DUMP_ONLY
  241. bool "Controller log dump mode only"
  242. depends on BT_LE_CONTROLLER_LOG_ENABLED
  243. default y
  244. help
  245. Only operate in dump mode
  246. config BT_LE_LL_RESOLV_LIST_SIZE
  247. int "BLE LL Resolving list size"
  248. range 1 5
  249. default 4
  250. help
  251. Configure the size of resolving list used in link layer.
  252. menuconfig BT_LE_SECURITY_ENABLE
  253. bool "Enable BLE SM feature"
  254. depends on !BT_NIMBLE_ENABLED
  255. default y
  256. help
  257. Enable BLE sm feature
  258. config BT_LE_SM_LEGACY
  259. bool "Security manager legacy pairing"
  260. depends on BT_LE_SECURITY_ENABLE
  261. default y
  262. help
  263. Enable security manager legacy pairing
  264. config BT_LE_SM_SC
  265. bool "Security manager secure connections (4.2)"
  266. depends on BT_LE_SECURITY_ENABLE
  267. default y
  268. help
  269. Enable security manager secure connections
  270. config BT_LE_SM_SC_DEBUG_KEYS
  271. bool "Use predefined public-private key pair"
  272. default n
  273. depends on BT_LE_SECURITY_ENABLE && BT_LE_SM_SC
  274. help
  275. If this option is enabled, SM uses predefined DH key pair as described
  276. in Core Specification, Vol. 3, Part H, 2.3.5.6.1. This allows to
  277. decrypt air traffic easily and thus should only be used for debugging.
  278. config BT_LE_LL_CFG_FEAT_LE_ENCRYPTION
  279. bool "Enable LE encryption"
  280. depends on BT_LE_SECURITY_ENABLE
  281. default y
  282. help
  283. Enable encryption connection
  284. config BT_LE_CRYPTO_STACK_MBEDTLS
  285. bool "Override TinyCrypt with mbedTLS for crypto computations"
  286. default y
  287. depends on !BT_NIMBLE_ENABLED
  288. select MBEDTLS_ECP_RESTARTABLE
  289. select MBEDTLS_CMAC_C
  290. help
  291. Enable this option to choose mbedTLS instead of TinyCrypt for crypto
  292. computations.
  293. config BT_LE_WHITELIST_SIZE
  294. int "BLE white list size"
  295. range 1 15
  296. default 12
  297. depends on !BT_NIMBLE_ENABLED
  298. help
  299. BLE list size
  300. config BT_LE_LL_DUP_SCAN_LIST_COUNT
  301. int "BLE duplicate scan list count"
  302. range 1 100
  303. default 20
  304. help
  305. config the max count of duplicate scan list
  306. config BT_LE_LL_SCA
  307. int "BLE Sleep clock accuracy"
  308. range 0 500
  309. default 60
  310. help
  311. Sleep clock accuracy of our device (in ppm)
  312. config BT_LE_MAX_CONNECTIONS
  313. int "Maximum number of concurrent connections"
  314. depends on !BT_NIMBLE_ENABLED
  315. range 1 35
  316. default 3
  317. help
  318. Defines maximum number of concurrent BLE connections. For ESP32, user
  319. is expected to configure BTDM_CTRL_BLE_MAX_CONN from controller menu
  320. along with this option. Similarly for ESP32-C3 or ESP32-S3, user is expected to
  321. configure BT_CTRL_BLE_MAX_ACT from controller menu.
  322. Each connection will take about 1k DRAM.
  323. choice BT_LE_COEX_PHY_CODED_TX_RX_TLIM
  324. prompt "Coexistence: limit on MAX Tx/Rx time for coded-PHY connection"
  325. default BT_LE_COEX_PHY_CODED_TX_RX_TLIM_DIS
  326. depends on ESP_COEX_SW_COEXIST_ENABLE
  327. help
  328. When using PHY-Coded in BLE connection, limitation on max tx/rx time can be applied to
  329. better avoid dramatic performance deterioration of Wi-Fi.
  330. config BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EN
  331. bool "Force Enable"
  332. help
  333. Always enable the limitation on max tx/rx time for Coded-PHY connection
  334. config BT_LE_COEX_PHY_CODED_TX_RX_TLIM_DIS
  335. bool "Force Disable"
  336. help
  337. Disable the limitation on max tx/rx time for Coded-PHY connection
  338. endchoice
  339. config BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF
  340. int
  341. default 0 if !ESP_COEX_SW_COEXIST_ENABLE
  342. default 1 if BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EN
  343. default 0 if BT_LE_COEX_PHY_CODED_TX_RX_TLIM_DIS
  344. config BT_LE_SLEEP_ENABLE
  345. bool "Enable BLE sleep"
  346. default n
  347. help
  348. Enable BLE sleep
  349. choice BT_LE_LP_CLK_SRC
  350. prompt "BLE low power clock source"
  351. default BT_LE_LP_CLK_SRC_MAIN_XTAL
  352. config BT_LE_LP_CLK_SRC_MAIN_XTAL
  353. bool "Use main XTAL as RTC clock source"
  354. help
  355. User main XTAL as RTC clock source.
  356. This option is recommended if external 32.768k XTAL is not available.
  357. Using the external 32.768 kHz XTAL will have lower current consumption
  358. in light sleep compared to using the main XTAL.
  359. config BT_LE_LP_CLK_SRC_DEFAULT
  360. bool "Use system RTC slow clock source"
  361. help
  362. Use the same slow clock source as system RTC
  363. Using any clock source other than external 32.768 kHz XTAL supports only
  364. legacy ADV and SCAN due to low clock accuracy.
  365. endchoice
  366. config BT_LE_USE_ESP_TIMER
  367. bool "Enable Esp Timer for Callout"
  368. depends on !BT_NIMBLE_ENABLED
  369. default y
  370. help
  371. Set this option to use Esp Timer which has higher priority timer
  372. instead of FreeRTOS timer
  373. config BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP
  374. bool "BLE adv report flow control supported"
  375. default y
  376. help
  377. The function is mainly used to enable flow control for advertising reports. When it is enabled,
  378. advertising reports will be discarded by the controller if the number of unprocessed advertising
  379. reports exceeds the size of BLE adv report flow control.
  380. config BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM
  381. int "BLE adv report flow control number"
  382. depends on BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP
  383. range 50 1000
  384. default 100
  385. help
  386. The number of unprocessed advertising report that bluetooth host can save.If you set
  387. `BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM` to a small value, this may cause adv packets lost.
  388. If you set `BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM` to a large value, bluetooth host may cache a
  389. lot of adv packets and this may cause system memory run out. For example, if you set
  390. it to 50, the maximum memory consumed by host is 35 * 50 bytes. Please set
  391. `BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM` according to your system free memory and handle adv
  392. packets as fast as possible, otherwise it will cause adv packets lost.
  393. config BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD
  394. int "BLE adv lost event threshold value"
  395. depends on BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP
  396. range 1 1000
  397. default 20
  398. help
  399. When adv report flow control is enabled, The ADV lost event will be generated when the number
  400. of ADV packets lost in the controller reaches this threshold. It is better to set a larger value.
  401. If you set `BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD` to a small value or printf every adv lost event, it
  402. may cause adv packets lost more.
  403. config BT_LE_SCAN_DUPL
  404. bool "BLE Scan Duplicate Options"
  405. default y
  406. help
  407. This select enables parameters setting of BLE scan duplicate.
  408. choice BT_LE_SCAN_DUPL_TYPE
  409. prompt "Scan Duplicate Type"
  410. default BT_LE_SCAN_DUPL_TYPE_DEVICE
  411. depends on BT_LE_SCAN_DUPL
  412. help
  413. Scan duplicate have three ways. one is "Scan Duplicate By Device Address", This way is to use
  414. advertiser address filtering. The adv packet of the same address is only allowed to be reported once.
  415. Another way is "Scan Duplicate By Device Address And Advertising Data". This way is to use advertising
  416. data and device address filtering. All different adv packets with the same address are allowed to be
  417. reported. The last way is "Scan Duplicate By Advertising Data". This way is to use advertising data
  418. filtering. All same advertising data only allow to be reported once even though they are from
  419. different devices.
  420. config BT_LE_SCAN_DUPL_TYPE_DEVICE
  421. bool "Scan Duplicate By Device Address"
  422. help
  423. This way is to use advertiser address filtering. The adv packet of the same address is only
  424. allowed to be reported once
  425. config BT_LE_SCAN_DUPL_TYPE_DATA
  426. bool "Scan Duplicate By Advertising Data"
  427. help
  428. This way is to use advertising data filtering. All same advertising data only allow to be reported
  429. once even though they are from different devices.
  430. config BT_LE_SCAN_DUPL_TYPE_DATA_DEVICE
  431. bool "Scan Duplicate By Device Address And Advertising Data"
  432. help
  433. This way is to use advertising data and device address filtering. All different adv packets with
  434. the same address are allowed to be reported.
  435. endchoice
  436. config BT_LE_SCAN_DUPL_TYPE
  437. int
  438. depends on BT_LE_SCAN_DUPL
  439. default 0 if BT_LE_SCAN_DUPL_TYPE_DEVICE
  440. default 1 if BT_LE_SCAN_DUPL_TYPE_DATA
  441. default 2 if BT_LE_SCAN_DUPL_TYPE_DATA_DEVICE
  442. default 0
  443. config BT_LE_SCAN_DUPL_CACHE_SIZE
  444. int "Maximum number of devices in scan duplicate filter"
  445. depends on BT_LE_SCAN_DUPL
  446. range 10 1000
  447. default 100
  448. help
  449. Maximum number of devices which can be recorded in scan duplicate filter.
  450. When the maximum amount of device in the filter is reached, the cache will be refreshed.
  451. config BT_LE_SCAN_DUPL_CACHE_REFRESH_PERIOD
  452. int "Duplicate scan list refresh period (seconds)"
  453. depends on BT_LE_SCAN_DUPL
  454. range 0 1000
  455. default 0
  456. help
  457. If the period value is non-zero, the controller will periodically clear the device information
  458. stored in the scan duuplicate filter. If it is 0, the scan duuplicate filter will not be cleared
  459. until the scanning is disabled. Duplicate advertisements for this period should not be sent to the
  460. Host in advertising report events.
  461. There are two scenarios where the ADV packet will be repeatedly reported:
  462. 1. The duplicate scan cache is full, the controller will delete the oldest device information and
  463. add new device information.
  464. 2. When the refresh period is up, the controller will clear all device information and start filtering
  465. again.
  466. config BT_LE_MSYS_INIT_IN_CONTROLLER
  467. bool
  468. default y