Commit Graph
294 Commits
Author SHA1 Message Date
Chen Jian Hua 00affe3251 feat(bt): Add Kconfig option to build the BT OSAL conditionally
(cherry picked from commit 0428ec41a529aa9c83240f40963114b36d80ab7c)

Co-authored-by: chenjianhua <chenjianhua@espressif.com>
2026-09-04 20:50:44 +08:00
liqigan ed836fa70b change(bt/bluedroid): Used dynamic osi event to reduce lock cost 2026-09-02 19:18:45 +08:00
zhanghaipeng 8643f157fc 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-08-27 17:21:35 +08:00
liqigan 94ecf32411 fix(bt/bluedroid): Fixed use after free issue on osi_event_delete 2026-08-24 14:19:05 +08:00
Wang Meng Yang a3e1f55f3e Merge branch 'feat/bt_in_psram_v5.4' into 'release/v5.4'
feat(bluedroid): Add config to place btu and hci task stack in psram (v5.4)

See merge request espressif/esp-idf!51493
2026-08-05 14:26:37 +08:00
Island 8c3500b917 Merge branch 'fix/ble_log_compression_add_local_header_file_v5.4' into 'release/v5.4'
feat(ble_log): mirror local compression headers (5.4)

See merge request espressif/esp-idf!50950
2026-08-05 10:06:54 +08:00
hejiaxin 7c48812de9 feat(bluedroid): Add config to place btu and hci task stack in psram
- Also adjust the osi_thread_stop implementation.
2026-08-04 14:56:04 +08:00
Luo Xu e2114de7b0 feat(ble_log): mirror local compression headers
(cherry picked from commit ee732a4591)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-08-04 11:53:15 +08:00
Island ccd00fb116 Merge branch 'fix/ble_log_compression_issue_on_windows_v5.4' into 'release/v5.4'
fix(bt): fix BLE log compression build on Windows (5.4)

See merge request espressif/esp-idf!51244
2026-08-03 11:31:06 +08:00
chenjianhua 87af736067 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-07-29 15:25:36 +08:00
Luo Xu c974c55606 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-07-28 13:43:35 +08:00
Island 69ae551ac6 Merge branch 'fix/ble_hidd_remove_ccc_gating_v5.4' into 'release/v5.4'
fix(esp_hid/bluedroid): remove app-layer CCC gating in HID device (5.4)

See merge request espressif/esp-idf!51005
2026-07-23 19:26:13 +08:00
Island b0e440355d Merge branch 'fix/ble_log_compression_safety_v5.4' into 'release/v5.4'
fix(ble_log): fix unaligned access and buffer safety in log compression (5.4)

See merge request espressif/esp-idf!47929
2026-07-23 14:26:51 +08:00
luoxu 1b4a951a83 fix(bt): reorder test imports to satisfy pre-commit 2026-07-21 21:44:26 +08:00
Zhou Xiao e6f43ca6c6 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:14 +08:00
luoxu 4cab74130e fix(ble_log): use typing.Optional/List for Python 3.9 compatibility 2026-07-21 14:12:42 +08:00
luoxu 0e2015cf8f fix(ble_log): fix size_info nibble misalignment for last odd-count arg 2026-07-21 14:12:42 +08:00
luoxu ad114e99ab fix(ble_log): fix unaligned access and buffer safety in log compression 2026-07-21 14:12:42 +08:00
Luo Xu be5454fe34 test(ble): add comprehensive test suite for log compression
(cherry picked from commit 58121d2540)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-21 14:12:42 +08:00
Luo Xu 738a99800b fix(ble): replace hardcoded tuple indices with FormatToken NamedTuple
(cherry picked from commit b7760a77e4)

Co-authored-by: luoxu <luoxu@espressif.com>
2026-07-21 14:12:42 +08:00
Zhang Hai Peng 0b76a22522 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:07 +08:00
Island 1d545e6618 Merge branch 'feat/ble_log_compression_module_cfg_update_v5.4' into 'release/v5.4'
Feat/ble log compression module cfg update (5.4)

See merge request espressif/esp-idf!49873
2026-07-20 21:37:56 +08:00
luoxu 80554da58c feat(ble): reorganize log compression Kconfig
Move log-compression Kconfig files to host/ and profile/mesh/ directories and update source paths.
2026-07-16 21:52:52 +08:00
Rahul Tank 82ae7e7f76 fix(nimble): Fix ECC HW byte-order and dropped SOC_ESP_NIMBLE_CONTROLLER 2026-07-16 16:39:52 +05:30
luoxu 0046fae26c feat(ble): split log compression Kconfig into separate mesh and host files 2026-07-16 11:50:02 +08:00
Luo Xu 638b809b78 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:50:02 +08:00
Zhi Wei Jian 95bd892dba 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:02 +08:00
Zhou Xiao 8db6befe08 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:55 +08:00
Guo Zifan a25fac6c71 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 11:25:26 +08:00
Zhi Wei Jian 0e6cb5b53e 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:53:49 +08:00
Island 8510e0a0c6 Merge branch 'feat/ble-log-iram-optim_v5.4' into 'release/v5.4'
opt(bt): Move SPI Tx Callback to Flash When SPI ISR IN IRAM Disabled (5.4)

See merge request espressif/esp-idf!48922
2026-06-05 15:50:57 +08:00
luoxu 8dd492fee0 fix(bt): Normalize source paths for log compression pattern matching 2026-06-04 11:11:54 +08:00
ShenWeilong a8b57a6be0 change(bt): Separated bt/cmakelist to bt/controller/cmakelist and bt/porting/cmakelist 2026-06-04 11:11:54 +08:00
Zhou Xiao e2e75cbbf4 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:17:30 +08:00
Rahul Tank 7c138d2c33 fix(nimble): Add support for shorter connection intervals 2026-05-28 15:55:38 +05:30
Mayank Tyagi 41c2a4909b feat(nimble): ADD BLE HCI logging support for ESP Insights 2026-05-20 13:40:00 +05:30
Zhang Hai Peng f038b47896 feat(ble): Support BLE critical logs
(cherry picked from commit 0af57d731c)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-05-14 14:23:40 +08:00
zhiweijian 9e16d6b72e fix(ble): Fixed AI review bugs in bt common 2026-05-12 12:17:05 +08:00
Zhang Hai Peng 4ce1ea8a15 feat(ble/blufi): Support setting BLE encryption for blufi
(cherry picked from commit 60a028fb17)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2026-05-12 12:14:36 +08:00
Rahul Tank c4a674d76c fix(nimble): cleanup: remove extraneous script file
Removed files that were unintentionally included in an earlier commit
2026-04-30 14:21:24 +05:30
Zhou Xiao 27107ffbe2 change(ble_log): update ble log version to 5 for esp ble controller log encoding indication 2026-04-29 12:14:51 +08:00
Sahil Yadav 80622c637a feat(nimble): Support NimBLE log compression and decompression over SPI 2026-04-24 13:48:57 +05:30
Rahul Tank e87804cbfd Merge branch 'bugfix/ai_fixes_common_components_v5.4' into 'release/v5.4'
Bugfix/ai fixes common components (v5.4)

See merge request espressif/esp-idf!47568
2026-04-24 10:54:19 +05:30
Rahul Tank a526bae727 fix(nimble): Address review fixes for tinycrypt / and blufi code 2026-04-20 22:04:15 +05:30
Zhou Xiao a5006e556f 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-20 19:30:42 +08:00
Zhou Xiao 3fd00cf581 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-20 19:30:38 +08:00
Zhou Xiao ec3685788a 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-20 19:30:33 +08:00
Zhou Xiao 144863f58f 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-20 19:30:28 +08:00
Zhou Xiao 76ff867959 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-20 19:30:23 +08:00
Island 6359809343 Merge branch 'dev/ble-log-202603_v5.4' into 'release/v5.4'
dev: BLE Log 202603 (5.4)

See merge request espressif/esp-idf!47275
2026-04-20 17:22:55 +08:00