Commit Graph

305 Commits

Author SHA1 Message Date
liqigan
822f1617bf change(bt/bluedroid): Used dynamic osi event to reduce lock cost 2026-09-04 09:41:19 +08:00
zhanghaipeng
ad5a7d778e fix(ble/bluedroid): allow osi_event re-post during POSTING window
Do not reject osi_thread_post_event() when only POSTING is set.
QUEUED already prevents double-queueing; rejecting POSTING caused
HCI downstream lost wakeup. Add generic osi_event and hci downstream
diagnostics for post failures.
2026-09-04 09:40:32 +08:00
liqigan
4412ff55b2 fix(bt/bluedroid): Fixed use after free issue on osi_event_delete 2026-09-04 09:40:29 +08:00
Rahul Tank
56fa9afcda fix(blufi): Fix BLUFI NimBLE deinit race due to disconnect callbacks 2026-09-03 21:27:16 +05:30
chenjianhua
9bd7168fa1 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

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-03 21:27:15 +05:30
hejiaxin
744c1b0474 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:54 +08:00
Island
41687f6c0f Merge branch 'fix/ble_hidd_remove_ccc_gating_v6.0' into 'release/v6.0'
fix(esp_hid/bluedroid): remove app-layer CCC gating in HID device (6.0)

See merge request espressif/esp-idf!51007
2026-07-23 19:25:57 +08:00
Island
ded793522b Merge branch 'fix/ble_log_compression_add_local_header_file_v6.0' into 'release/v6.0'
feat(ble_log): mirror local compression headers (6.0)

See merge request espressif/esp-idf!50952
2026-07-23 14:23:22 +08:00
Zhou Xiao
2bb70519ea 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:18 +08:00
Luo Xu
f871af7be8 feat(ble_log): mirror local compression headers
(cherry picked from commit ee732a4591)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-21 11:02:55 +08:00
Zhang Hai Peng
11149ca943 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:11 +08:00
Wang Meng Yang
27a5aba8e1 Merge branch 'feat/ble_log_compression_module_cfg_update_v6.0' into 'release/v6.0'
Feat/ble log compression module cfg update (6.0)

See merge request espressif/esp-idf!49875
2026-07-17 19:35:49 +08:00
luoxu
47e012a968 feat(ble): reorganize log compression Kconfig
Move log-compression Kconfig files to host/ and profile/mesh/ directories and update source paths.
2026-07-16 16:58:00 +08:00
Rahul Tank
bf03b83dfe fix(nimble): Fix ECC HW byte-order and dropped SOC_ESP_NIMBLE_CONTROLLER 2026-07-16 12:29:32 +05:30
luoxu
5f25d81bed feat(ble): split log compression Kconfig into separate mesh and host files 2026-07-16 11:24:47 +08:00
Luo Xu
2aba002266 fix(ble): fix Bluedroid log compression for newly added modules
(cherry picked from commit 8d4f1cb608)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-16 11:24:47 +08:00
Zhi Wei Jian
87d614ba91 feat(ble/bluedroid): Support bluedroid LE COC and EATT features
(cherry picked from commit 83f0831c53)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-07-14 11:56:06 +08:00
Zhou Xiao
c83fdad6dd fix(ble_log): use BIT64 over BIT to support 64-bit IO setup
(cherry picked from commit a2876d304e)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2026-07-03 12:04:59 +08:00
Rahul Tank
cd0ad239a6 Merge branch 'bugfix/nimble_issues_02062026_v6.0' into 'release/v6.0'
fix(nimble):  Fix few nimble issues 02062026 (v6.0)

See merge request espressif/esp-idf!49153
2026-06-29 21:52:48 +05:30
Island
6e73125228 Merge branch 'feat/spi_log_qa_frame_check_v6.0' into 'release/v6.0'
feat(ble_log): add FINAL_STAT session-end frame and flush hook before controller restart (6.0)

See merge request espressif/esp-idf!49958
2026-06-29 20:25:50 +08:00
Rahul Tank
b633c5e2a5 fix(nimble): Add support for shorter connection intervals 2026-06-29 15:25:37 +05:30
Mayank Tyagi
0a90976237 feat(nimble): ADD BLE HCI logging support for ESP Insights 2026-06-29 15:25:36 +05:30
Jiang Jiang Jian
c1aeac2888 Merge branch 'bugfix/fix_bluedroid_ai_review_bugs_20260427_v6.0' into 'release/v6.0'
Bugfix/fix bluedroid ai review bugs 20260427 (6.0)

See merge request espressif/esp-idf!49541
2026-06-29 15:39:47 +08:00
Guo Zifan
e3963cd433 feat(ble_log): Add frame check support for restart flow
(cherry picked from commit a81322a2ce)

Co-authored-by: guozifan <guozifan@espressif.com>
2026-06-24 15:32:33 +08:00
Zhi Wei Jian
b55f972546 fix(bt): fix BTC task and BLE mesh bluedroid adapter
(cherry picked from commit 678fb93245)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2026-06-10 19:54:01 +08:00
Zhou Xiao
48d6feb6ea change(ble_log): move spi tx callback to flash when spi isr in iram disabled
(cherry picked from commit 725e9ee162)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2026-06-03 15:38:32 +08:00
luoxu
3dd06b7abe fix(bt): Normalize source paths for log compression pattern matching 2026-05-26 13:34:43 +08:00
ShenWeilong
d8c912eb4d change(bt): Separated bt/cmakelist to bt/controller/cmakelist and bt/porting/cmakelist 2026-05-25 21:01:21 +08:00
Sahil Yadav
36f0fd3962 feat(nimble): Added NimBLE log compression scripts in v6.0 2026-05-15 12:16:25 +05:30
Zhang Hai Peng
e0eac2de6b feat(ble): Support BLE critical logs
(cherry picked from commit 0af57d731c)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-05-14 14:23:51 +08:00
zhiweijian
b788a733ad fix(ble): Fixed AI review bugs in bt common 2026-05-12 11:43:31 +08:00
Jiang Jiang Jian
ceb0c00dac Merge branch 'fix/ble_log_compression_safety_v6.0' into 'release/v6.0'
fix(ble_log): fix unaligned access and buffer safety in log compression (6.0)

See merge request espressif/esp-idf!47931
2026-05-11 10:59:27 +08:00
Rahul Tank
81476b116d fix(nimble): Address review fixes for tinycrypt / and blufi code 2026-05-08 14:23:48 +05:30
Island
7d11365a3c Merge branch 'fix/add-scheduler-suspended-check-in-ble-log_v6.0' into 'release/v6.0'
fix: BLE Log Module Issues 20260407 (6.0)

See merge request espressif/esp-idf!47560
2026-05-08 11:01:27 +08:00
luoxu
b372423d03 fix(ble_log): fix unaligned access and buffer safety in log compression 2026-05-07 12:11:09 +08:00
Luo Xu
e6d937890b test(ble): add comprehensive test suite for log compression
(cherry picked from commit 58121d2540)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-05-07 12:10:32 +08:00
Luo Xu
1a191068f7 fix(ble): replace hardcoded tuple indices with FormatToken NamedTuple
(cherry picked from commit b7760a77e4)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-05-07 12:10:32 +08:00
Rahul Tank
a47ea03266 feat(nimble): Support NimBLE log compression and decompression over SPI 2026-05-01 16:34:46 +05:30
Jiang Jiang Jian
2662c1ac0c Merge branch 'bugfix/fix_blufi_watchdog_v6.0' into 'release/v6.0'
fix(blufi): Support DH negotiation on SoCs without hardware MPI(v6.0)

See merge request espressif/esp-idf!47377
2026-04-30 16:29:28 +08:00
Zhou Xiao
70505621bf change(ble_log): update ble log version to 5 for esp ble controller log encoding indication 2026-04-29 12:11:58 +08:00
Island
f91a82a15c Merge branch 'feat/support_mbedtls_for_ble_hci_example_v6.0' into 'release/v6.0'
feat(ble): support mbedtls for ble controller encryption (6.0)

See merge request espressif/esp-idf!46908
2026-04-29 10:40:47 +08:00
Zhou Xiao
30fa84b0b0 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-28 13:29:15 +08:00
Zhou Xiao
b3dccba3ac 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-28 13:29:15 +08:00
Zhou Xiao
217d9b23f6 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-28 13:29:15 +08:00
Zhou Xiao
9c8090a5d4 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-28 13:29:15 +08:00
Zhou Xiao
ed097f942f 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-28 13:29:15 +08:00
Rahul Tank
af6ea89656 fix(blufi): support DH negotiation on SoCs without hardware MPI 2026-04-09 16:35:55 +05:30
Zhou Xiao
03a54ef8f9 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.


(cherry picked from commit 205bc49fd6)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2026-04-03 21:15:00 +08:00
Zhou Xiao
9a30fc326d 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.


(cherry picked from commit aec896b6b9)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2026-04-03 21:15:00 +08:00
Zhou Xiao
23d64937f3 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


(cherry picked from commit c223a3f835)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2026-04-03 21:14:59 +08:00