- 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>
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>
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.
- 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)
- 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)
- 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)
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.
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>
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>
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.
(cherry picked from commit b5b886fd1e)
Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
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.
(cherry picked from commit 1cc66e3888)
Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>