Commit Graph
5473 Commits
Author SHA1 Message Date
Rahul Tank 0bba493ff5 Merge branch 'bugfix/fix_software_ecc_v5.5' into 'release/v5.5'
fix(nimble): Fix Software ecc issue in tinycrpyt (v5.5)

See merge request espressif/esp-idf!47733
2026-04-21 10:32:33 +05:30
Jiang Jiang Jian 2c7f5ace94 Merge branch 'bugfix/fix_some_bt_coex_bugs_v5.5' into 'release/v5.5'
fix(coex): fix some esp32 coexistence bugs (Backport v5.5)

See merge request espressif/esp-idf!47394
2026-04-20 18:23:22 +08:00
Rahul Tank b39aeb1b5a fix(nimble): Fix Software ecc issue in tinycrpyt 2026-04-20 14:05:54 +05:30
Island 2634d92de8 Merge branch 'change/ble_update_lib_20260409_v5.5' into 'release/v5.5'
change(ble): [AUTO_MR] 20260409 - Update ESP BLE Controller Lib (5.5)

See merge request espressif/esp-idf!47418
2026-04-20 14:22:31 +08:00
linruihao 3fdd5b25b4 fix(coex): fix some esp32 coexistence bugs
- fix ble scan may restart twice in coex scenarios
- fix bredr page/pscan coex request/release not match
- fix bredr incorrect inquiry length calculation
- update bredr page/inquiry pti
- add coex pti protection for entire page/inquiry event
2026-04-20 11:16:28 +08:00
Wang Meng Yang 1c8d6c3b1f Merge branch 'bugfix/oob_read_in_continue_packet_v5.5' into 'release/v5.5'
fix(bt/bluedroid): fix ACL reassembly dropping valid continuation fragments (v5.5)

See merge request espressif/esp-idf!47379
2026-04-20 09:28:52 +08:00
Zhao Wei Liang 909a89e33f feat(ble): add adv tx options on ESP32-C5
(cherry picked from commit d7bfbef862)

Co-authored-by: zhaoweiliang <zhaoweiliang@espressif.com>
2026-04-20 00:05:32 +08:00
Zhao Wei Liang 0e0c71b9a8 feat(ble): add adv tx options on ESP32-H2
(cherry picked from commit 8ef46541cd)

Co-authored-by: zhaoweiliang <zhaoweiliang@espressif.com>
2026-04-20 00:05:32 +08:00
Zhao Wei Liang 329d3a64e7 feat(ble): add adv tx options on ESP32-C6
(cherry picked from commit e85bb5cca8)

Co-authored-by: zhaoweiliang <zhaoweiliang@espressif.com>
2026-04-20 00:05:32 +08:00
Zhao Wei Liang 4e0cc17fba change(ble): [AUTO_MR] Update lib_esp32c6 to c9fbba6f
(cherry picked from commit 24d0f0fad1)

Co-authored-by: zhaoweiliang <zhaoweiliang@espressif.com>
2026-04-20 00:05:32 +08:00
Zhao Wei Liang 34eeeef53a change(ble): [AUTO_MR] Update lib_esp32c5 to c9fbba6f
(cherry picked from commit a23c9acab7)

Co-authored-by: zhaoweiliang <zhaoweiliang@espressif.com>
2026-04-20 00:05:32 +08:00
Zhao Wei Liang 438c5247e9 change(ble): [AUTO_MR] Update lib_esp32h2 to c9fbba6f
(cherry picked from commit 9bfcc76221)

Co-authored-by: zhaoweiliang <zhaoweiliang@espressif.com>
2026-04-20 00:05:32 +08:00
Rahul Tank 04312aab2c fix(nimble): Fixes for various CVEs
*CVE-2025-62235
   *CVE-2025-53477
   *CVE-2025-53470
2026-04-17 17:03:04 +05:30
Rahul Tank 6e51126e72 Merge branch 'feat/fsu_hci_cmd_evt_v5.5' into 'release/v5.5'
feat(nimble): Add support to 6.2 BLE HCI Command Event(FSU, UTP over OTA) (v5.5)

See merge request espressif/esp-idf!47638
2026-04-17 10:49:18 +05:30
Jiang Jiang Jian 1b6686550c Merge branch 'bugfix/ai_review_avrcp_v5.5' into 'release/v5.5'
fix(bt): fix AVRCP component issues reported by AI review (v5.5)

See merge request espressif/esp-idf!47677
2026-04-17 11:20:39 +08:00
Jiang Jiang Jian 587efe333e Merge branch 'feat/support_bleqabr25_1521_v5.5' into 'release/v5.5'
feat(ble/bluedroid): Add an API to resolve RPA (v5.5)

See merge request espressif/esp-idf!46501
2026-04-17 11:02:59 +08:00
yangfeng db64849624 fix(bt): fix AVRCP component issues reported by AI review 2026-04-16 17:12:38 +08:00
Jin Cheng bd5ed9375a fix(bt/bluedroid): moved L2CAP length check into start packets only 2026-04-15 19:50:48 +08:00
Jon Gilmore 96f092b66a fix(bt/bluedroid): fix ACL reassembly dropping valid continuation fragments
The minimum length check in `reassemble_and_dispatch()` applied the START packet minimum (`HCI_ACL_PREAMBLE_SIZE + L2CAP_LENGTH_SIZE` = 8 bytes) to **all** ACL packets, including continuation fragments. Continuation fragments only carry the 4-byte ACL preamble (handle + length) with no L2CAP header, so small but valid continuations (5-7 bytes) were incorrectly rejected as "too short."

This caused the first L2CAP PDU in a rapid burst of BLE GATT indications to be silently dropped. The partial reassembly was orphaned, then discarded when the next indication's START fragment arrived, producing:

```
E BT_HCI: ACL packet too short (len=5)
W BT_HCI: reassemble_and_dispatch found unfinished packet for handle with start packet. Dropping old.
```

Parse the ACL preamble first (requires only 4 bytes) to determine the boundary flag, then apply the L2CAP length check only to START packets. Continuation packets are now accepted with the correct minimum of `HCI_ACL_PREAMBLE_SIZE` (4 bytes).

- ESP32-S3 connected to a BLE peripheral that fragments indications at 40 bytes per L2CAP PDU
- Peripheral sends 8+ indications within ~200ms (burst of state changes)
- The final continuation fragment of the first indication is small (5-6 bytes after type stripping)
- 100% reproducible on every burst; confirmed on ESP-IDF 5.5.3, 5.5.4, and 6.0.0

Verified on ESP32-S3 with a Sub-Zero wall oven (SO3050PESP, firmware 8.5):
- **Before fix:** First indication in every burst lost (ACL reassembly failure)
- **After fix:** All indications in burst delivered correctly, including when the final continuation fragment is 5-6 bytes

Closes https://github.com/espressif/esp-idf/issues/18414
2026-04-15 19:50:48 +08:00
Sahil Yadav 7618624086 feat(nimble): Add support to 6.2 BLE HCI Command Event (FSU, UTP over OTA) 2026-04-15 15:13:12 +05:30
Rahul Tank 85bee88b27 fix(nimble): Address review comments for hidd / hidh code 2026-04-15 10:39:49 +05:30
Rahul Tank 176963d583 fix(nimble): Address review fixes for tinycrypt / and blufi code 2026-04-15 10:39:07 +05:30
Rahul Tank 2b4d2da3b1 Merge branch 'bugfix/proximity_example_issue_v5.5' into 'release/v5.5'
fix(nimble): Fix prox service to handle negative values (v5.5)

See merge request espressif/esp-idf!47537
2026-04-15 09:24:13 +05:30
Island 89ca3b8117 Merge branch 'fix/add-scheduler-suspended-check-in-ble-log_v5.5' into 'release/v5.5'
fix: BLE Log Module Issues 20260407 (5.5)

See merge request espressif/esp-idf!47559
2026-04-15 10:45:19 +08:00
Rahul Tank ea2b90f74e fix(nimble): Fix prox service to handle negative values 2026-04-14 16:14:14 +05:30
Zhou Xiao 31e0ef14a8 fix(ble_log): ensure BLE Log IRAM functions are placed in IRAM on ESP32C2
On ESP32C2 with BT_CTRL_RUN_IN_FLASH_ONLY, the bt_default linker scheme
routes .iram1 sections to flash_text, causing BLE_LOG_IRAM_ATTR functions
to end up in flash instead of IRAM. Define a dedicated .ble_log_iram1
section for ESP32C2 and route it to iram0_bt_text unconditionally.


(cherry picked from commit a9b93ca0e5)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2026-04-14 13:14:15 +08:00
Zhou Xiao eef3374d46 fix(ble_log): improve robustness with atomics, macro hygiene, and IRAM
- Use __atomic_fetch_add for stat_mgr counters to prevent lost updates
  under concurrent ISR/task access (H1)
- Use __atomic_load_n with ACQUIRE ordering for ref_count spin-loops (L1)
- Remove unnecessary BLE_LOG_IRAM_ATTR from ble_log_rt_task since it
  calls flash-resident functions and cannot run during flash ops (L3)
- Add parentheses to BLE_LOG_TRANS_FREE_SPACE and BLE_LOG_MAKE_FRAME_META
  macro parameters to prevent operator precedence bugs (M6)


(cherry picked from commit 59536316c9)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2026-04-14 13:14:14 +08:00
Zhou Xiao 79e119b6b4 fix(ble_log): fix deinit race and concurrent flush deadlock
- Reorder deinit: stop RT task before destroying peripheral driver to
  prevent sending transports to a NULL dev_handle on dual-core (H2)
- Drain remaining queue items in rt_deinit to clean up transport state
- Add atomic flush_in_progress guard to prevent two concurrent
  ble_log_flush() callers from deadlocking on ref_count spin-wait (H5)


(cherry picked from commit 1275b78ad6)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2026-04-14 13:14:14 +08:00
Zhou Xiao dbc2bb134d fix(ble_log): fix crash and resource issues in peripheral drivers
- Handle scheduler-suspended and ISR context in UART redirect path
  to prevent xSemaphoreTake crash during light sleep (C1)
- Check uart_driver_install return value before setting inited flag (M1)
- Always clean up SPI device handle in deinit even if acquire_bus fails (M4)


(cherry picked from commit 3f8cfc5b1d)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2026-04-14 13:14:13 +08:00
Zhou Xiao 17b9df24c0 fix(ble_log): handle scheduler-suspended state in ble_log_rt_queue_trans
During light sleep transitions, the FreeRTOS scheduler is suspended but
xPortInIsrContext() returns false, causing xQueueSend with portMAX_DELAY
to hit a configASSERT. Add a check for taskSCHEDULER_SUSPENDED and use
a non-blocking send with rollback on queue-full to avoid resource leaks.


(cherry picked from commit 92979706d7)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2026-04-14 13:14:13 +08:00
Rahul Tank 394a8b9b1d fix(nimble): Resolve host lock assert in DEBUG mode 2026-04-13 16:16:58 +05:30
Jiang Jiang Jian 42a045b2ff Merge branch 'bugfix/spp_deinit_v5.5' into 'release/v5.5'
fix(bt/bluedroid): flushed all the DM PM at the end of SPP deinit (v5.5)

See merge request espressif/esp-idf!47290
2026-04-09 12:26:26 +08:00
Luo Xu ebebba4823 feat(ble): update log compression for bluedroid
(cherry picked from commit 05783fafd7)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-04-08 16:53:04 +08:00
Luo Xu 4beb797190 feat(ble_mesh): enable log full compression function for bluedroid host
(cherry picked from commit 4cf88ce078)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-04-08 16:53:04 +08:00
Rahul Tank b3cbeb99ea Merge branch 'bugfix/fix_dtm_end_test_v5.5' into 'release/v5.5'
fix(nimble): Fix DTM test end packet count parsing (v5.5)

See merge request espressif/esp-idf!47332
2026-04-08 12:15:21 +05:30
Island bde0a7361d Merge branch 'dev/ble-log-202603_v5.5' into 'release/v5.5'
dev: BLE Log 202603 (5.5)

See merge request espressif/esp-idf!47276
2026-04-08 10:32:01 +08:00
Rahul Tank 3f859b880d fix(nimble): Fix DTM test end packet count parsing 2026-04-07 15:35:39 +05:30
Jiang Jiang Jian e46782886f Merge branch 'bugfix/btm_sec_free_dev_v5.5' into 'release/v5.5'
fix(bt): avoid deleting device record on partial transport cleanup (v5.5)

See merge request espressif/esp-idf!47295
2026-04-07 14:59:30 +08:00
Jiang Jiang Jian 828a353388 Merge branch 'bugfix/fix_ble_controller_emi_assert_v5.5' into 'release/v5.5'
fix(ble): Fixed BLE assert in "emi.c" when low memory (5.5)

See merge request espressif/esp-idf!46914
2026-04-07 14:55:44 +08:00
Jiang Jiang Jian ceb2aa15da Merge branch 'feat/add_bluedroid_cancel_open_api_v5.5' into 'release/v5.5'
feat(ble/bluedroid): Added cancel open function for bluedroid (5.5)

See merge request espressif/esp-idf!46901
2026-04-07 14:55:13 +08:00
Jiang Jiang Jian cfac6d548c Merge branch 'fix/ble_mesh_nimble_connection_failed_v5.5' into 'release/v5.5'
fix(ble_mesh):fixed nimble connection failed (v5.5)

See merge request espressif/esp-idf!46117
2026-04-07 14:46:14 +08:00
Zhou Xiao da680aa29a fix(ble_log_console): exclude from idf-ci pytest collection to fix CI
idf-ci discovers pyproject.toml pytest config and runs a separate
collection pass with --target all, which finds 0 target tests and
raises RuntimeError. Add to .idf_ci.toml exclude_dirs instead of
deleting tests. Restore all 227 unit tests with lint/mypy fixes.
2026-04-07 12:28:59 +08:00
Zhou Xiao 5288d2a246 docs(ble_log): update README for multi-buffer transport and removed modules
Reflect changes from dev/ble-log-202603: ping-pong to multi-buffer
transport (4 buffers/LBM), renamed Kconfig options (LBM_TRANS_SIZE →
LBM_TRANS_BUF_SIZE with new defaults), always-enabled checksum and
enhanced statistics, UART redirection support, UHCI Out removal,
SPI Out deprecation, and updated memory estimation.
2026-04-07 12:28:59 +08:00
Zhou Xiao 3b2852b9ee feat(bt): add BT_LOG_CRITICAL_ONLY bandwidth-optimized log mode
Add Kconfig options for bandwidth-optimized logging via the BLE Log
Async Output system. When enabled, controller log levels default to 2
and host/mesh log encoding is auto-selected.

- BT_LOG_CRITICAL_ONLY parent: selects BLE_LOG_ENABLED + compression
- BT_LOG_CRITICAL_ONLY_CTRL: supports both NimBLE and non-NimBLE (C3)
  controllers with default level override
- BT_LOG_CRITICAL_ONLY_HOST: host-agnostic, selects compressed log
  for Bluedroid conditionally
- BT_LOG_CRITICAL_ONLY_MESH: placeholder for mesh log encoding
- Guards against BT_STACK_NO_LOG conflict
2026-04-07 12:28:59 +08:00
Zhou Xiao 51c280d361 change(bt): consolidate BLE log Kconfig into common/Kconfig.in
Move per-chip BLE log Kconfig options (esp32c2/c5/c6/h2) into
components/bt/common/Kconfig.in for single-source-of-truth configuration.

Restructure menu as "BT Logs" with "Log Sources" sub-menu containing
controller log config options. Controller log output mode choice defaults
to BLE Log v2 when BLE_LOG_ENABLED, with legacy mode as deprecated
fallback. Migrate wrap_panic_handler and task_wdt_user_handler configs
as well since they depend on BT_LE_CONTROLLER_LOG_ENABLED.
2026-04-07 12:28:59 +08:00
Zhou Xiao 5484704db5 change(ble_log): update ble log module description 2026-04-07 12:28:59 +08:00
Zhou Xiao fd40b4c0b9 feat(bt/ble_log): add cross-pool buffer fallback in LBM acquire
Replace the two-step acquire() + get_trans() flow with a unified
acquire_trans() that iterates all candidate pools. When a pool's
buffers are exhausted, the lock is released and the next pool is
tried, enabling load balancing across pools instead of only
resolving lock contention.
2026-04-07 12:28:59 +08:00
Zhou Xiao 705b8a02b5 fix(bt/ble_log): use atomic_load for inflight_peak in buf_util report
Replace __atomic_exchange_n with __atomic_load_n in
ble_log_emit_buf_util() so inflight_peak reports the all-time peak
since init rather than resetting to zero after each report.
2026-04-07 12:28:59 +08:00
Zhou Xiao 8b4458342e feat(ble_log): migrate from ping-pong to multi-buffer transport
Migrate all LBM, RT, and peripheral backend code from 2-buffer
ping-pong to 4-buffer transport with bitmask index arithmetic.

LBM changes:
- Init sets owner on each transport buffer
- get_trans/flush/dump use (idx+1) & (cnt-1) instead of !idx
- get_trans/flush use __atomic_load_n(ACQUIRE) for prph_owned
- New ble_log_write_buf_util() emits BUF_UTIL telemetry frames,
  exchange peak with 0 to avoid stale baseline after bursts

RT changes:
- Queue depth uses unified BLE_LOG_TRANS_TOTAL_CNT
- rt_queue_trans uses __atomic_store_n for prph_owned, tracks
  per-LBM inflight count and peak via lock-free CAS
- ISR path captures pxHigherPriorityTaskWoken and yields

Peripheral changes:
- All tx_done callbacks: decrement inflight before releasing
  prph_owned with __atomic_store_n(RELEASE)
- SPI/UART send_trans error paths: decrement inflight and
  release prph_owned to allow retry on next get_trans pass
- Dummy send_trans: recycle buffer immediately (pos=0, decrement
  inflight, release prph_owned) since no DMA hardware to wait for
- Redir LBM upgraded to 4-buffer with owner and reset support
- All peripherals implement ble_log_prph_reset_util_counters()
2026-04-07 12:28:59 +08:00
Zhou Xiao ec30e32dd1 feat(ble_log): define multi-buffer transport types and Kconfig
Replace ping-pong (2-buffer) transport constants with configurable
multi-buffer (4-buffer) types. Add buffer utilization reporting types,
unified queue depth derivation macros, and compile-time guards.

Rename Kconfig options to total-per-LBM semantics:
- BLE_LOG_LBM_TRANS_SIZE (512) -> BLE_LOG_LBM_TRANS_BUF_SIZE (2048)
- BLE_LOG_LBM_LL_TRANS_SIZE (1024) -> BLE_LOG_LBM_LL_TRANS_BUF_SIZE (2048)

Key type changes:
- ble_log_prph_trans_t: volatile bool -> plain bool (atomic ops used),
  add void *owner back-reference
- ble_log_lbm_t: trans array sized to BLE_LOG_TRANS_BUF_CNT (4),
  add trans_inflight and trans_inflight_peak counters
- BLE_LOG_TRANS_BUF_CNT replaces BLE_LOG_TRANS_PING_PONG_BUF_CNT
- New ble_log_buf_util_t for buffer utilization telemetry
- _Static_assert guards for divisibility, power-of-2, index limits
2026-04-07 12:28:59 +08:00