Commit Graph
6117 Commits
Author SHA1 Message Date
Wang Meng Yang 4e8e22ac63 Merge branch 'feat/bt_in_psram_v6.1' into 'release/v6.1'
feat(bluedroid): Add config to place btu and hci task stack in psram (v6.1)

See merge request espressif/esp-idf!51489
2026-08-27 17:38:13 +08:00
Rahul Tank 81e47e108b fix(nimble): bound PAwR synced connect retries in the example 2026-08-27 13:59:05 +05:30
Astha Verma d221815295 fix(nimble): Fixed gatt caching crash on disconnect 2026-08-27 13:54:02 +05:30
Rahul Tank 841cf8fab0 fix(nimble): Fix unpair_oldest_peer deleting wrong device
Sort bond entries by bond_count after in-place updates to maintain correct
eviction order, and log IRK resolving-list failures instead of failing the bond.
2026-08-27 13:54:02 +05:30
Rahul Tank 0cb936f5f4 fix(nimble): Add separate helper functions to register notification/indication 2026-08-27 13:54:02 +05:30
Rahul Tank ecd57b6bd3 fix(nimble): Add fix to handle service reset during server start 2026-08-27 13:54:02 +05:30
Rahul Tank b1b49057a3 fix(nimble): Fix adding device to resolving list when defer connection 2026-08-27 13:54:02 +05:30
Rahul Tank e98e1f72af fix(nimble): Added change to stop adv before starting new adv 2026-08-27 13:54:02 +05:30
Rahul Tank e485c6afbd fix(nimble): Remove extra free to avoid double free 2026-08-27 13:54:02 +05:30
Rahul Tank 6c4edb1ceb fix(nimble): Fixes for various NimBLE CVEs 2026-08-27 13:54:02 +05:30
Rahul Tank a60e3528c5 fix(nimble): Deliver PAwR peripheral CONNECT via sync callback 2026-08-27 13:54:02 +05:30
Rahul Tank 4e7ff99606 fix(nimble): update sbom file with cve details 2026-08-27 13:54:01 +05:30
Jan BeranandCursor a76891bd16 fix(kconfig): use 'n' instead of '0'/'false' for bool defaults
Bool symbols in nimble, BTDM, and two examples used invalid default
literals. The parser already falls back to 'n'; set that explicitly.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-27 14:22:22 +08:00
chenjianhua 59f6ca221b feat(bt): Add host-agnostic BT OSAL and shared BLE profile task
- Add bt_osal: event queues, mutexes, semaphores, callouts, etc.
- Add the shared BLE profile task and event queue
- Bring both up and tear them down in the host init/deinit paths
- Add unit tests for the OSAL and the profile task
2026-08-27 11:33:57 +05:30
Shreeyash Bhakare c0168e59bf fix(nimble): Added security related fixes 2026-08-27 11:33:56 +05:30
Astha Verma d8cd1f7ef7 fix(nimble): Handle Read Remote Supported Features failure correctly 2026-08-27 11:33:56 +05:30
Sumeet Singh 1edb1a58b5 fix(nimble): Add option to disable IEEE and UDI Characteristic in DIS 2026-08-27 11:33:56 +05:30
Rahul Tank 01a4bf4374 fix(nimble): Fix bond-store overflow when IRK is enabled 2026-08-27 11:33:56 +05:30
Rahul Tank 4b4b7a22a1 fix(nimble): Fixes for AI reported issues 2026-08-27 11:33:56 +05:30
Rahul Tank 03599155dc fix(nimble): Defer Events / ATT related information from stack
Defer Events/ ATT related GAP events from stack until connection
 event is sent to GAP layer
2026-08-27 11:33:56 +05:30
Rahul Tank 17c167767a fix(nimble): Add npl locks to avoid race condition 2026-08-27 11:33:56 +05:30
Astha Verma 1265a63943 fix(nimble): Added l2cap_coc throughput examples 2026-08-27 11:33:56 +05:30
Rahul Tank a41a481fdc fix(nimble): Gaurd ble_hs_log_mbuf/flat_buf against non-DEBUG log level 2026-08-27 11:33:56 +05:30
yangfeng 3ae8c79ac3 fix(bt): Fix the issue of AVRCP version compatibility 2026-08-26 15:55:34 +08:00
Zhang Hai Peng 82a626220e fix(ble/bluedroid): restore find info PDU stop on UUID format mismatch
Restore GATT_NO_RESOURCES when sequential attributes have differing UUID
sizes so gatts_process_find_info() stops building the response PDU.


(cherry picked from commit 196cb39545)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-08-26 14:43:57 +08:00
Jin Cheng 8ef2345e67 fix(bt): update ESP32 libbtdm_app.a to fix several issues
- fixed IntegerDividedByZero during Qos negotiation.
  Closes https://github.com/espressif/esp-idf/issues/18951
- ignored the check for bandwidth and retransmission effort when Host
  accepts the SCO connection request.
2026-08-26 08:52:09 +08:00
yangfeng 7d07ad44cd fix(bt): Fix compatibility with A2DP API legacy usage methods
- Modify the timing of API calls in the A2DP example
- Add a2dp_stream_aac test case
- Closes https://github.com/espressif/esp-idf/issues/18786
2026-08-25 18:47:29 +08:00
Jin Cheng 3b266e017a fix(bt/bluedroid): fixed BTA event dispatch race during module disable
- Gate bta_sys_event() on both 'is_reg' and 'reg[id]' to prevent
  stale event delivery.
- Defer bta_sys_deregister() to the end of profile disable handlers
  to ensure pending DISABLE events are processed.
- Add disabling flag to HFP AG for tracking asynchronous teardown.
2026-08-24 10:41:38 +08:00
hejiaxin f9b088749b fix(bt_pbap): Fix some bugs in bluedroid PBAP
- Add sdp_seq to avoid p_ccb being free during sdp
- Changed some BTA_Pba functions to return non-void value
- Improve error catching and report
- Refactor bta_pba_client_response to avoid UAF problem
- Rearrange btc_pba_client init flag to avoid some disturbing bug
2026-08-20 16:35:59 +08:00
yangfeng 5ef217c63a fix(bluedroid): Fix the compilation issue of BCM_STRNCPY_S 2026-08-13 19:15:56 +08:00
hejiaxin 0515e0da6b feat(bluedroid): Add config to place btu and hci task stack in psram
- Also adjust the osi_thread_stop implementation.
2026-08-04 14:55:27 +08:00
Luo Xu 47665f9b0a fix(bt): fix BLE log compression build on Windows
The BLE log compression feature (CONFIG_BT_LOG_CRITICAL_ONLY ->
BLE_COMPRESSED_LOG_ENABLE) failed to build on Windows while working
correctly on Linux, due to two shell/platform-specific issues in the
compression script.

1. Module/source argument quoting. CMakeLists.txt passes the
   semicolon-separated module and source lists wrapped in single quotes
   ("'${MODULES}'") to protect ';' from POSIX shells, which strip them.
   cmd.exe does not treat single quotes as quoting characters, so on
   Windows the quotes reached the script literally and
   args.module.split(';') produced "'BLE_MESH" / "BLE_HOST'" instead of
   the clean names. These never matched the YAML module keys, every
   module was skipped ("Skipping module ... - config not found"), the
   compressed sources were never generated, and the build failed. Strip
   surrounding quote characters before splitting; this is a no-op on
   Linux/macOS where the shell already removed them.

2. CRLF line endings. With core.autocrlf=true the IDF sources are
   checked out as CRLF on Windows. The generated *_log_index.h macros
   use backslash-newline line-continuation; a backslash followed by
   '\r\n' is not a valid continuation in C, producing floods of syntax
   errors when the header is compiled. Write generated headers with
   newline='' to force LF, and normalize source content to LF right
   after reading so '\r' embedded inside multi-line argument expressions
   is also handled. Byte offsets stay consistent because both tree-sitter
   parsing and tag replacement operate on the normalized content.

Verified by full clean builds of examples/bluetooth/esp_ble_mesh/
vendor_models/vendor_client (esp32c6, bluedroid + mesh) from both
cmd.exe and PowerShell; both produce an identical vendor_client.bin.


(cherry picked from commit aa9b565a6d)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-08-04 12:23:34 +08:00
Luo Xu 6332384065 fix(ble_mesh): align GATTS read/write response handling with ATT
bt_mesh_bta_gatts_cb did not always answer ATT Read/Write Requests:
- READ: on a callback error it only logged a warning and sent nothing; a
  0-byte read (Read Blob at an offset equal to the value length) also sent
  nothing, although it is a successful empty read.
- WRITE: on a callback error it sent nothing, and a partial/zero write was
  treated as success.
- Both: when the handle was not found or the attribute had no read/write
  callback, the request was silently dropped.

An ATT Request must always be answered:

- READ: len >= 0 is success -> Read Response (a 0-byte read yields an empty
  value); len < 0 -> ATT Error Response carrying the callback's error code
  (-len, since BLE_MESH_GATT_ERR(x) == -x). The copy length is clamped to
  the source buffer size as a defensive bound. If the handle is unknown or
  the attribute has no read callback, respond with INVALID_HANDLE /
  READ_NOT_PERMITTED.
- WRITE: when need_rsp is set, always reply. len == write length -> Write
  Response; otherwise (negative ATT error, partial write, or 0) -> ATT
  Error Response (the negative code, or UNLIKELY for partial/0). If the
  handle is unknown or the attribute has no write callback, respond with
  INVALID_HANDLE / WRITE_NOT_PERMITTED. Write Without Response still sends
  no response.

A non-success status passed to BTA_GATTS_SendRsp is turned into an ATT
Error Response by the GATT layer (gatt_sr_process_app_rsp ->
gatt_send_error_rsp).


(cherry picked from commit ed1f4de3a3)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-08-03 21:43:53 +08:00
Jiang Jiang Jian 6a9c44fe7e Merge branch 'fix/ble_log_compression_add_local_header_file_v6.1' into 'release/v6.1'
feat(ble_log): mirror local compression headers (6.1)

See merge request espressif/esp-idf!50953
2026-08-03 10:48:09 +08:00
Jiang Jiang Jian d52ecaa3ea Merge branch 'bugfix/low_spp_throughput_v6.1' into 'release/v6.1'
change(bt/bluedroid): increased port low watermark of RFCOMM (v6.1)

See merge request espressif/esp-idf!51083
2026-07-31 19:35:19 +08:00
Wang Mengyang 481b244fe8 fix(bt): Fixed blocking during LMP packet type negotiation on ESP32-S31
In the Bluetooth connections with some smartphones, communication can possibly be blocked
during packet type negotation, when ESP32-S31 attempts to finalize the ACL-U transmission
and waits for the last Tx ACL-U packet to be transmitted, but peer device rejects the
packet with FLOW=STOP in its packet, thus causing a deadlock.

Closes https://github.com/espressif/esp-idf/issues/18797

This MR also provide with some optimizations and fixes
2026-07-31 14:06:02 +08:00
Jiang Jiang Jian fdf5ee1e93 Merge branch 'feat/optimize_for_esp32h4_light_sleep_ble_current_v6.1_new_chip_only' into 'release/v6.1'
Feat/optimize for esp32h4 light sleep ble current v6.1 new chip only

See merge request espressif/esp-idf!51302
2026-07-31 11:32:41 +08:00
cjin 54b357e089 fix(bt): fix deselect slow clk missing on ESP32-C5 2026-07-30 10:38:54 +08:00
Jin Chen d956326a93 fix: fix on bt slow clk src unable to reset on esp32-h4 and esp32-s31
(cherry picked from commit 287b7c72cd)

Co-authored-by: cjin <jinchen@espressif.com>
2026-07-30 09:05:49 +08:00
cjin bfb9a07dbb feat(ble): supported placing bt function in iram on esp32-h4 and esp32-s31 2026-07-30 08:17:26 +08:00
Jin Cheng b5d3256213 fix(bt/bluedroid): fixed incorrect eSCO packet type validation under secure connection mode in BlueDroid 2026-07-29 17:30:20 +08:00
hejiaxin bb47816fb1 fix(bt): Fix some bug in stm_sco.c
- Memory safety
- State machine & logic integrity
- Resource leaks
- Edge cases check
2026-07-29 17:30:20 +08:00
luoxu 0bff830e79 feat(ble_mesh): update lib to 79e3fee04e 2026-07-28 11:48:33 +08:00
Luo Xu dbe3c9d442 feat(ble_mesh): supported get lib version
(cherry picked from commit 56f78da32c)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-27 10:03:21 +08:00
Jin Cheng 44d2861950 change(bt/bluedroid): increased port low watermark of RFCOMM
When PORT_RX_BUF_LOW_WM is too low, RFCOMM replenishes credits only
after receiving a relatively large number of packets, which may cause
the peer to exhaust its credits and enter a stop-and-wait state.
Increase the low watermark to replenish credits more promptly and
reduce the likelihood of the peer stalling while waiting for additional
credits.
2026-07-23 08:07:38 +08:00
Jin Cheng a16219df1c fix(bt/bluedroid): fixed issues from AI review in GAP, SPP, HID, L2CAP and HCI 2026-07-23 07:41:31 +08:00
Zhou Xiao a3e5f62bd4 fix(bt): keep BLE log ISR state in internal RAM
(cherry picked from commit 2fa434eb50)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2026-07-21 19:44:26 +08:00
Zhang Hai Peng b3c4cfb0fb fix(ble/bluedroid): track ext scan state for rand addr check
Update inq_var.state only after btsnd_hcic_ble_ext_scan_enable succeeds.
Clear BTM_BLE_SCANNING on explicit stop and controller scan timeout.


(cherry picked from commit 23519567e4)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-07-21 10:53:28 +08:00
Zhang Hai Peng df7a8ae1e4 change(ble/bluedroid): disable host trace logs when BLE Log host is off
Default all Bluedroid layer trace levels to NONE when BLE async log
is enabled without BLE_LOG_HOST_LOG.


(cherry picked from commit 1f8f935e3f)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-07-21 10:44:12 +08:00
Luo Xu 52169ecdd8 feat(ble): reorganize log compression Kconfig and add ISO
Move sub-Kconfig files into categorized directories (profile/mesh/,
host/, iso/audio/) and create the missing ISO/Audio compression
Kconfig with COMPRESSION + PRESERVE pairs for all 4 log levels,
matching the existing cmake tag definitions.


(cherry picked from commit c0286b25fa)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-20 22:35:14 +08:00