Commit Graph
5572 Commits
Author SHA1 Message Date
Island 70ddf98f50 Merge branch 'fix/add-scheduler-suspended-check-in-ble-log' into 'master'
fix: BLE Log Module Issues 20260407

See merge request espressif/esp-idf!47319
2026-04-14 10:52:17 +08:00
Rahul Tank 1d1f05bdbe Merge branch 'bugfix/fix_blufi_watchdog' into 'master'
fix(blufi): Support DH negotiation on SoCs without hardware MPI

See merge request espressif/esp-idf!47215
2026-04-13 14:09:34 +05:30
Rahul Tank fb4ba7c453 fix(blufi): support DH negotiation on SoCs without hardware MPI 2026-04-10 10:31:13 +05:30
zhaoweiliang d7bfbef862 feat(ble): add adv tx options on ESP32-C5 2026-04-09 11:11:52 +08:00
zhaoweiliang 8ef46541cd feat(ble): add adv tx options on ESP32-H2 2026-04-09 11:11:52 +08:00
zhaoweiliang e85bb5cca8 feat(ble): add adv tx options on ESP32-C6 2026-04-09 11:11:52 +08:00
zhaoweiliang 24d0f0fad1 change(ble): [AUTO_MR] Update lib_esp32c6 to c9fbba6f 2026-04-09 11:11:52 +08:00
zhaoweiliang a23c9acab7 change(ble): [AUTO_MR] Update lib_esp32c5 to c9fbba6f 2026-04-09 11:11:52 +08:00
zhaoweiliang 9bfcc76221 change(ble): [AUTO_MR] Update lib_esp32h2 to c9fbba6f 2026-04-09 11:11:52 +08:00
Jin Cheng 8999e14df8 fix(bt/bluedroid): moved L2CAP length check into start packets only 2026-04-08 20:13:37 +08:00
Jon Gilmore 25ddfaab1c 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-08 20:08:49 +08:00
Zhou Xiao a9b93ca0e5 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.
2026-04-07 19:02:14 +08:00
Rahul Tank b1050c5a9e fix(nimble): Fix DTM test end packet count parsing 2026-04-07 14:56:00 +05:30
Zhou Xiao 59536316c9 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)
2026-04-07 15:31:50 +08:00
Zhou Xiao 1275b78ad6 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)
2026-04-07 15:31:40 +08:00
Zhou Xiao 3f8cfc5b1d 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)
2026-04-07 15:31:32 +08:00
Zhou Xiao 92979706d7 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.
2026-04-07 15:15:31 +08:00
Island ac588e91b0 Merge branch 'ble_dev/esp32h4eco1_chip_20260403_iso' into 'master'
fix(ble): support ble iso for esp32h4 eco1

Closes IDF-12243 and IDF-12248

See merge request espressif/esp-idf!47260
2026-04-07 14:28:31 +08:00
ShenWeilong 583a8c441d fix(ble): fixed esp32h4 kconfig CI warning 2026-04-03 21:31:26 +08:00
Island d227dc7f23 Merge branch 'bugfix/fix_privacy_callback_trigger_multipe_times' into 'master'
Bugfix/fix privacy callback trigger multiple times

See merge request espressif/esp-idf!47205
2026-04-03 20:35:47 +08:00
Wang Meng Yang bb597ede48 Merge branch 'bugfix/btm_sec_free_dev' into 'master'
fix(bt): avoid deleting device record on partial transport cleanup

Closes BT-4248

See merge request espressif/esp-idf!45753
2026-04-03 19:18:13 +08:00
Island 51bbd5257a Merge branch 'dev/ble-log-202603' into 'master'
dev: BLE Log 202603

See merge request espressif/esp-idf!46934
2026-04-03 18:10:47 +08:00
wangjialiang ca8354932c fix(ble): support ble iso for esp32h4 eco1 2026-04-03 17:11:04 +08:00
Astha Verma 3b0cfa5970 fix(nimble): fix null dereference of ble_gatts_conn_aware_states after gatts stop 2026-04-03 10:14:03 +05:30
Island a6acf48f33 Merge branch 'ble_dev/esp32h4eco1_chip_20260326' into 'master'
feat(ble): added ble support for esp32h4 eco1

See merge request espressif/esp-idf!47100
2026-04-03 10:31:23 +08:00
Island 5ad07fe0f3 Merge branch 'bugfix/fix_ble_pair_fail' into 'master'
fix(bt/bluedroid): fix BLE SMP pairing failure on BLE-only devices when using defalut param

Closes BLERP-2672

See merge request espressif/esp-idf!47167
2026-04-02 15:49:37 +08:00
ShenWeilong 271ff9605a fix(bt): fixed some h4 issues reported by ci pipeline 2026-04-02 14:59:41 +08:00
ShenWeilong 6e359ad99e feat(ble): added ble support for esp32h4 eco1 2026-04-02 14:59:40 +08:00
Wang Meng Yang 8c9b3339b9 Merge branch 'bugfix/sbc_improvement' into 'master'
fix(bt/bluedroid): fixed multiple high-severity issues from AI code review in SBC

See merge request espressif/esp-idf!46944
2026-04-02 14:26:21 +08:00
Sumeet Singh d0326e3889 feat(nimble): Update blecent example README.md with EATT documentation 2026-04-02 06:52:22 +05:30
zhiweijian 5272b7e75b fix(ble/bluedroid): Fixed privacy callback triggering multiple times 2026-04-01 21:02:45 +08:00
Rahul Tank 49c770cf85 Merge branch 'bugfix/nimble_example_fixes' into 'master'
fix(nimble): Address nimble example issues

Closes BLERP-2628, BLERP-2631, BLERP-2635, and BLERP-2657

See merge request espressif/esp-idf!46697
2026-04-01 15:31:34 +05:30
zhanghaipeng 74a053bd4e fix(bt/bluedroid): fix BLE SMP pairing failure on BLE-only devices when using default param 2026-04-01 12:10:16 +08:00
yangfeng 0e9d642d74 fix(bt): avoid deleting device record on partial transport cleanup 2026-04-01 10:02:26 +08:00
Jin Cheng c9a11c1ff9 fix(bt/bluedroid): fixed multiple high-severity issues from AI code review in SBC 2026-04-01 09:42:51 +08:00
Island 582451a451 Merge branch 'fix/fix_add_char_value_failed_with_len_is_zero' into 'master'
fix(bt/bluedroid): Fixed AddCharacteristic failed when attr_len is zero for AUTO_RSP

See merge request espressif/esp-idf!47139
2026-03-31 13:24:03 +08:00
Wang Meng Yang 1ec13a92d2 Merge branch 'bugfix/spp_deinit' into 'master'
fix(bt/bluedroid): flushed all the DM PM at the end of SPP deinit

See merge request espressif/esp-idf!47065
2026-03-31 09:57:52 +08:00
Wang Meng Yang 4cac5e157a Merge branch 'bugfix/misc_improvement' into 'master'
fix(bt/bluedroid): fixed multiple high-severity issues from AI code review in Bluedroid

See merge request espressif/esp-idf!46833
2026-03-31 09:55:29 +08:00
Shen Wei Long 463fcc5e36 Merge branch 'feat/support_mbedtls_for_ble_hci_example' into 'master'
feat(ble): support mbedtls for ble controller encryption

See merge request espressif/esp-idf!46897
2026-03-30 12:29:30 +00:00
zhiweijian 0c41af54ba fix(bt/bluedroid): Fixed AddCharacteristic failed when attr_len is zero for AUTO_RSP 2026-03-30 15:41:42 +08:00
Jin Cheng 6702e66dd8 fix(bt/bluedroid): fixed multiple high-severity issues from AI code review in Bluedroid 2026-03-27 11:28:37 +08:00
Jin Cheng 42f3ed145d fix(bt/bluedroid): flushed all the DM PM at the end of SPP deinit 2026-03-27 11:20:54 +08:00
Wang Meng Yang d9a53ecebe Merge branch 'bugfix/spp_improvement' into 'master'
fix(bt/bluedroid): fixed multiple high-severity issues from AI code review in SPP

See merge request espressif/esp-idf!46803
2026-03-27 10:41:51 +08:00
Wang Meng Yang 904ba3909e Merge branch 'bugfix/hid_improvement' into 'master'
fix(bt/bluedroid): fixed multiple high-severity issues from AI code review in HID

See merge request espressif/esp-idf!46771
2026-03-27 10:32:41 +08:00
Island 6d8c904249 Merge branch 'feat/support_adv_monitor_for_bluedroid_host' into 'master'
feat(ble/bluedroid): support adv monitor feature

Closes BLERP-2648

See merge request espressif/esp-idf!46775
2026-03-26 16:08:59 +08:00
Island 360e45adc3 Merge branch 'feat/allow_creat_vendor_descriptor_by_service_table' into 'master'
feat(ble/bluedroid): Allow add vendor descriptor by service table create API

Closes BLERP-2647

See merge request espressif/esp-idf!46843
2026-03-26 16:06:07 +08:00
Rahul Tank d73e4c611b fix(nimble): Correct adv_list_init / deinit during nimble init / deinit 2026-03-26 10:55:43 +05:30
linruihao 647f0972ac 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-03-24 19:16:33 +08:00
Zhou Xiao 205bc49fd6 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-03-24 15:42:03 +08:00
Rahul Tank b7bff02998 Merge branch 'bugfix/send_conn_cancel_simul' into 'master'
fix(nimble): Issue connect cancel in case of outstanding master connection

See merge request espressif/esp-idf!46565
2026-03-24 12:34:03 +05:30