Commit Graph
6206 Commits
Author SHA1 Message Date
Zhou Xiao 7c2d698baa refactor(ble_log): extract the UART redirection stream writer
Move the stream write interface (redir_get_trans / redir_seal /
stream_write / stream_flush) out of ble_log_lbm_v2.c into a dedicated
ble_log_redir.c with its own internal header, matching the rt/ts
module layout. The pool keeps the recycle inflight hook and the flush
hooks.

The REDIR console stream keeps its own 24-bit frame sequence in
ble_log_redir_t: a raw console stream is not a log attempt, so it
never consumes the Global SN (which would fake loss gaps). g_frame_sn
stays TU-local to ble_log_lbm_v2.c, and the redundant modulo masks
are dropped: BLE_LOG_MAKE_FRAME_META enforces the 24-bit wire field at
the packing site, so BLE_LOG_SN_MODULO is removed.

REDIR payloads are a raw console stream with no timestamp prefix: a
per-frame ESP timer timestamp anchored at most ~1s of aggregated text,
cost a breaking wire change, and had no consumer on the receiver side.
Alignment with the core timeline uses receiver arrival time (bounded
by the periodic redirection flush).
2026-09-10 15:39:56 +08:00
Zhou Xiao 66d4715a73 feat(ble_log): write compressed logs directly into the pool
Compression encoders claim pool storage through the new
ble_log_claim/ble_log_commit interface and encode in place: the
per-channel static payload buffers and their CAS busy management go
away, and each record is one ENCODE frame. The timestamp and CAS
helper macros (and their lbm call sites) are capitalized to the
all-uppercase convention for function-like macros as part of the
rewrite.

Test coverage lands with the feature:

- ble_log_test: golden v7 wire bytes, snapshot layout, pool exhaustion
  and reserve use, claim/commit stale-handle rejection, periodic
  snapshot busy/loss, FLUSH reset semantics; the stale-claim
  assertions are sabotage-verified to fail when the state or
  generation check is deleted;
- ble_log_rt_test: runtime dispatch latency and batch drain, TS-valid
  snapshot cadence, deinit races across repeated init/deinit rounds
  (valid HCI macro inputs, corrected regression setup);
- ble_log_perf_test: per-writer throughput and cycle measurement
  against the unified pool with the shared/reserve split and paced
  no-loss profiles.
2026-09-10 15:39:56 +08:00
Zhou Xiao e801a4d509 feat(ble_log): switch to the unified transport pool
Replace the legacy multi-LBM transport layer with one shared pool:

- one bitmap-indexed pool of CONFIG_BLE_LOG_POOL_TRANS_CNT transports
  with a non-yield reserve for ISR and critical-section writers;
- per-transport state machine (FREE/OPEN/CLAIMED/SENDING) guarded by a
  per-transport CAS lock; bitmaps are only candidate hints;
- claim/commit interface for the compressed-log path; claim bookkeeping
  lives in the pool (ble_log_pool_claim_t), not in the peripheral
  transport;
- dedicated Internal Snapshot transport and fixed-layout snapshot
  record (reason flags, version block, lc/esp/os clock samples, pool
  state, compact core statistics);
- source-local 24-bit wire sequences and compact per-source counters;
- UART console redirection stream writer (ble_log_redir_t);
- CMakeLists compiles ble_log_lbm_v2.c instead of ble_log_lbm.c; the
  legacy ble_log_lbm.c/.h stay in-tree, out of the build, until their
  removal;
- the public ble_log_src_t ABI is restored and frozen; protocol v7
  wire source IDs are a separate internal enum (ble_log_wire_src_t)
  and the older BLE Stack sources map onto the v7 core sources
  (LL_TASK/LL_ISR -> LL, LL_HCI/HCI -> HCI, HOST -> CUSTOM);
  BLE_LOG_VERSION 7;
- Kconfig: pool sizing options replace the LBM options, whose names
  remain as hidden deprecated symbols for backward sdkconfig
  compatibility; BLE_LOG_HOST_SIDE_HCI_LOG_ENABLED becomes the single
  BLE_LOG_HCI_LOG_ENABLED switch for host and controller HCI traffic
  (Bluedroid and NimBLE host call sites follow the rename), enabled
  by default on all targets instead of only where
  BLE_LOG_IS_ESP_LEGACY_CONTROLLER; the old name keeps a deprecated
  promptless shim that selects the new symbol, so sdkconfig files
  still pinning it keep host HCI logging enabled;
- util: ble_log_cas_acquire/release become macros; multi-call-site
  pool helpers are no longer inline (IRAM);
- test app record structs gain a source_meta field for the v7 wire
  source byte;
- the Internal Snapshot no longer carries a schema_version: the record
  is self-identifying via int_src_code and the version block.
2026-09-10 15:39:55 +08:00
Zhou Xiao a1cbd92328 refactor(ble_log): preserve full HCI type byte in ble_log_write_hci
ble_log_write_hci encoded the direction in bit 7 of the caller's type
byte and then cleared that bit unconditionally after the write,
leaving the caller's buffer mutated. Save the complete type byte, set
bit 7 only around the synchronous copy, and restore it afterwards;
the direction argument is now treated as a boolean.

HCI H4 type bytes (0x01..0x04) always have bit 7 clear, so no legal
input observes a behavior change.
2026-09-10 15:39:23 +08:00
Island 22ade8b843 Merge branch 'bugfix/fix_iso_tx_power_update_fail' into 'master'
feat(iso): Support set ble iso tx power

See merge request espressif/esp-idf!52570
2026-09-09 15:05:44 +08:00
Island 4cf9d611e6 Merge branch 'idf/ble_audio_broadcast_assistant' into 'master'
feat(ble_audio): Add BAP Broadcast Assistant example

See merge request espressif/esp-idf!52480
2026-09-09 14:56:03 +08:00
Island 235fea6e60 Merge branch 'bugfix/fix_iso_data_len_get' into 'master'
fix(iso): correct ISO data length mask from 0x7fff to 0x3fff

See merge request espressif/esp-idf!51509
2026-09-09 14:38:27 +08:00
Island 5a2500deb9 Merge branch 'fix/esp32-ble-dtm-txbuf-leak' into 'master'
Fix DTM TX buffer leak in the BLE controller that could cause memory exhaustion and Interrupt WDT timeout during or after DTM TX tests.

Closes BLERP-3072 and BLERP-3097

See merge request espressif/esp-idf!52250
2026-09-09 14:37:42 +08:00
Island fbd01a4878 Merge branch 'feat/opt_prefer_bond_device_when_evicting_overflow_bonds' into 'master'
fix(bt/bluedroid): prefer disconnected peers when evicting overflow bonds

See merge request espressif/esp-idf!51883
2026-09-09 14:37:39 +08:00
Rahul Tank 752db18455 Merge branch 'bugfix/fix_coex_crash' into 'master'
fix(nimble): Prevent crash in deinit when host init was not completed

See merge request espressif/esp-idf!52104
2026-09-09 11:09:08 +05:30
morris 8284596d78 Merge branch 'feat/gdma_burst_size_fallback' into 'master'
fix(gdma): treat burst size 0 and 1 as burst disabled

See merge request espressif/esp-idf!52209
2026-09-09 11:05:33 +08:00
Island d82c0b546d Merge branch 'bugfix/fxied_btdm_mempool_compilation_issue' into 'master'
fix(ble): fixed porting_btdm compilation issue for esp32-s31/h4

See merge request espressif/esp-idf!52433
2026-09-09 11:01:14 +08:00
Liu Linyan 19b8637502 feat(ble_audio): Add BAP Broadcast Assistant example 2026-09-09 09:51:40 +08:00
morris f5afb99e3b fix(gdma): treat burst size 0 and 1 as burst disabled
The GDMA layer used `max_data_burst_size == 0` as the only way to disable the
data burst. That conflicts with the upstream drivers' convention where a zeroed
config struct means "unset", so users had no way to ask for the driver default
burst size.

GDMA now treats both 0 and 1 as "no data burst": a single-beat burst has no
benefit over the non-burst mode. The MSPI alignment constraint under Flash
Encryption / PSRAM ECC still takes precedence and is reported with a warning.

The upstream drivers using GDMA now apply their own default burst size (16
bytes) when the user leaves `dma_burst_size` as 0, following the UHCI driver:

- esp_async_crc (AHB / AXI GDMA backend)
- esp_async_memcpy (AHB / AXI / LP-AHB / DW_GDMA backend)

Callers that really want no burst can now set `dma_burst_size` to 1.
2026-09-08 23:29:14 +08:00
wangjialiang bfc81683e7 fix(iso): correct ISO data length mask from 0x7fff to 0x3fff 2026-09-08 19:47:58 +08:00
wangjialiang 2114bea2bc feat(iso): Support set ble iso tx power 2026-09-08 19:10:28 +08:00
Rahul Tank 9b60123e4f fix(nimble): Prevent crash in deinit when host init was not completed 2026-09-08 16:20:50 +05:30
Wang Meng Yang 18d728b755 Merge branch 'bugfix/wrong_bredr_tx_power_table' into 'master'
fix(bt): fixed use of wrong function to get BR/EDR power table on ESP32-S31

See merge request espressif/esp-idf!52481
2026-09-08 14:08:05 +08:00
Island 20049c62c0 Merge branch 'idf/ble_audio_lock_update' into 'master'
feat(ble_audio): Miscellaneous update for BLE ISO & BLE Audio safe calling

See merge request espressif/esp-idf!52346
2026-09-08 11:35:05 +08:00
zhanghaipeng b9b9b8633f fix(bt): remove noisy OSI event handler enter/exit debug logs
These per-event traces fire on every async dispatch and flood BT logs
without aiding diagnosis; higher-layer traces remain for debugging.
2026-09-07 20:31:31 +08:00
zhanghaipeng ab7bb35192 fix(bt): update ESP32 libbtdm_app.a to 919c7f4b
- fixed dtm tx buffer leak issue
2026-09-07 20:31:31 +08:00
Jiang Jiang Jian 4b62443e1e Merge branch 'bugfix/qos_not_reported' into 'master'
fix(bt/controller): update ESP32 libbtdm_app.a to fix missing QoS_Setup_Cmpl event

Closes BTQABR2023-901

See merge request espressif/esp-idf!52489
2026-09-07 20:12:47 +08:00
Rahul Tank 51d747b8d5 Merge branch 'bugfix/fix_null_proc_dereference' into 'master'
fix(nimble): Avoid NULL proc dereference in GATT client procedures

Closes BT-4476

See merge request espressif/esp-idf!52213
2026-09-07 10:54:44 +05:30
Jin Cheng 329731b91a fix(bt/controller): update ESP32 libbtdm_app.a to fix missing QoS_Setup_Cmpl event 2026-09-07 12:17:53 +08:00
Island 50135ffda2 Merge branch 'fix/fix_ble_retention_dependency_order' into 'master'
fix(ble): fix ble retention dependency order

See merge request espressif/esp-idf!52461
2026-09-07 11:56:46 +08:00
Island 9c84e44d2f Merge branch 'idf/ble_iso_cis_critical' into 'master'
fix(ble_iso): Avoid posting CIS events in critical section

See merge request espressif/esp-idf!52396
2026-09-07 10:37:08 +08:00
zhanghaipeng bf86892eef fix(bt/bluedroid): prefer disconnected peers when evicting overflow bonds
When the bond list is full, drop the oldest disconnected device instead
of the oldest NVS entry, and allow a per-bond except flag so selected
devices are never auto-removed.
2026-09-07 10:15:32 +08:00
Liu Linyan bb9390d2d0 feat(ble_audio): Miscellaneous update for BLE ISO & BLE Audio safe calling 2026-09-07 10:03:17 +08:00
Liu Linyan bd3a907c0e fix(ble_audio): Allow empty reading value for BLE Audio implementation 2026-09-07 10:03:17 +08:00
Wang Mengyang a8beda05c9 fix(bt): fixed use of wrong function to get BR/EDR power table on ESP32-S31
header file "btdm_user_cfg.h" is not included, which causes the undefined macro
"UC_BT_CTRL_BR_EDR_IS_ENABLE" in btdm_external.c. In this case, function
wr_btdm_external_bb_get_tx_pwr_table returns a wrong tx power table for BR/EDR
2026-09-06 11:51:04 +08:00
Island ece9103d83 Merge branch 'feat/bt_osal_build_configurable' into 'master'
feat(bt): Add Kconfig option to build the BT OSAL conditionally

See merge request espressif/esp-idf!51511
2026-09-04 20:47:20 +08:00
cjin 54efd4ccfd fix(ble): fix ble retention dependency order 2026-09-04 18:35:51 +08:00
Rahul Tank 2d0169ef41 fix(nimble): Avoid NULL proc dereference in GATT client procedures 2026-09-04 14:26:02 +05:30
Liu Linyan 4ce1f8edb5 fix(ble_iso): Avoid posting CIS events in critical section 2026-09-04 16:12:10 +08:00
ShenWeilong 55c650e1f6 fix(ble): fixed porting_btdm compilation issue for esp32-s31/h4 2026-09-04 15:59:07 +08:00
Rahul Tank 9f69bfdb4d Merge branch 'bugfix/fix_ble_pair_attack' into 'master'
fix(nimble): Fix for BLERP attack

See merge request espressif/esp-idf!51161
2026-09-04 12:53:02 +05:30
Island b3c069f960 Merge branch 'change/ble_update_lib_20260901' into 'master'
change(ble): [AUTO_MR] 20260901 - Update ESP BLE Controller Lib

Closes BLERP-3074, BLERP-3075, BLERP-3076, BLERP-3077, BLERP-3078, BLERP-3079, BLERP-3080, and BLERP-2565

See merge request espressif/esp-idf!52281
2026-09-04 10:53:24 +08:00
hejiaxin f772cd6d38 fix(bt_hfp): Fix macro definition 2026-09-03 17:30:32 +08:00
Rahul Tank 84f7125d1b fix(nimble): Fix for BLERP attack 2026-09-03 12:40:44 +05:30
Wang Meng Yang 7f1b8d002e Merge branch 'feature/hfp_lc3' into 'master'
Feature/hfp lc3

See merge request espressif/esp-idf!50037
2026-09-03 14:44:47 +08:00
Rahul Tank c71e574ebf Merge branch 'bugfix/fix_stale_conn_cccd' into 'master'
fix(nimble): fix crash on disconnect due to stale per-connection CCCD pool

Closes BLERP-3057, BLERP-3060, BLERP-3061, and BLERP-3062

See merge request espressif/esp-idf!51868
2026-09-03 12:01:32 +05:30
hejiaxin 25ca329650 fix(bt_hfp): Fix the solution of unknown AT command 2026-09-03 11:04:05 +08:00
hejiaxin 9f6cf1ac3c feat(bluedroid): Update LC3-SWB support in bluedroid
- Update LC3 in btc and bta, update AT
- Update LC3 in SCO frame transfer and examples
- improve lc3 transfer speed
- Fix some encoding and decoding bugs
- Rename the functions and macros to fit both msbc and lc3
- Add config dependency
- Add migration guides for bluetooth-classic
- change the statement of "Wide Band Speech" to "Wideband Speech" to fit HFPv1.10
2026-09-03 11:02:50 +08:00
Jiang Jiang Jian b91a486cc1 Merge branch 'bugfix/delete_unused_avrcp_rcb' into 'master'
fix(bt/bluedroid): delete the unused AVRCP acceptor RCB when A2DP open fails

Closes IDFGH-18197

See merge request espressif/esp-idf!52226
2026-09-03 11:02:05 +08:00
Island dd14ea0742 Merge branch 'bugfix/fixed_acl_timeout_issue' into 'master'
Bugfix/fixed acl timeout issue

Closes BTQABR2023-900

See merge request espressif/esp-idf!52255
2026-09-02 21:07:44 +08:00
Rahul Tank 657f80181b fix(nimble): fix crash on disconnect due to stale per-connection CCCD pool 2026-09-02 17:46:54 +05:30
Island c493c2a725 Merge branch 'feat/support_ble_esl_nimble' into 'master'
Feat/support ble esl nimble

See merge request espressif/esp-idf!51029
2026-09-02 19:51:35 +08:00
Island 26c58e6c46 Merge branch 'idf/ble_audio_cap_handover' into 'master'
feat(ble_audio): Add CAP Handover (U2B & B2U) example

See merge request espressif/esp-idf!52061
2026-09-02 19:35:13 +08:00
Wang Meng Yang eb90cd94b8 Merge branch 'bugfix/fix_osi_event_bug' into 'master'
Bugfix/fix osi event bug

See merge request espressif/esp-idf!51916
2026-09-02 17:47:06 +08:00
Liu Linyan bcc2981f25 feat(ble_audio): Add CAP Handover (U2B & B2U) example 2026-09-02 15:00:16 +08:00