Commit Graph
38603 Commits
Author SHA1 Message Date
Zhao Wei Liang 347a5a14dd feat(ble): add adv tx options on ESP32-C6
(cherry picked from commit e85bb5cca8)

Co-authored-by: zhaoweiliang <zhaoweiliang@espressif.com>
2026-04-10 10:22:40 +08:00
Zhao Wei Liang 437a32c9b1 change(ble): [AUTO_MR] Update lib_esp32c6 to c9fbba6f
(cherry picked from commit 24d0f0fad1)

Co-authored-by: zhaoweiliang <zhaoweiliang@espressif.com>
2026-04-10 10:22:40 +08:00
Zhao Wei Liang 9540ae562c change(ble): [AUTO_MR] Update lib_esp32h2 to c9fbba6f
(cherry picked from commit 9bfcc76221)

Co-authored-by: zhaoweiliang <zhaoweiliang@espressif.com>
2026-04-10 10:22:40 +08:00
Jiang Jiang Jian 94ab2f9a69 Merge branch 'fix/ot_mbedtls_version_check_v5.2' into 'release/v5.2'
fix(openthread): update OT upstream to b1a37932b to fix mbedtls version check (v5.2)

See merge request espressif/esp-idf!47429
2026-04-10 10:11:45 +08:00
Tan Yan Quan 85f792f756 fix(openthread): update OT upstream to b1a37932b to fix mbedtls version check 2026-04-09 19:54:25 +08:00
morris 8f599c82f1 Merge branch 'fix/fix_mmu_dirom_reserve_search_logic_v5.2' into 'release/v5.2'
mmu: fixed drom/irom reservation bus cap search logic (v5.2)

See merge request espressif/esp-idf!47393
2026-04-09 15:23:26 +08:00
Jiang Jiang Jian 966e5b698c Merge branch 'bugfix/oob_read_in_continue_packet_v5.2' into 'release/v5.2'
fix(bt/bluedroid): fix ACL reassembly dropping valid continuation fragments (v5.2)

See merge request espressif/esp-idf!47382
2026-04-09 14:36:21 +08:00
Jiang Jiang Jian fae7503e65 Merge branch 'bugfix/fix_legacy_touch_driver_stuck_after_dsleep_v5.2' into 'release/v5.2'
fix(legacy_touch): fixed the read stuck issue after deep sleep (v5.2)

See merge request espressif/esp-idf!46013
2026-04-09 12:21:40 +08:00
Jiang Jiang Jian bceba82ae8 Merge branch 'feat/update_mbedtls_3_6_6_v5.2' into 'release/v5.2'
feat(mbedtls): Update to v3.6.6 (v5.2)

See merge request espressif/esp-idf!47299
2026-04-09 12:21:19 +08:00
Jiang Jiang Jian fc8ced73ee Merge branch 'fix/esp32_adc_continuous_loss_sample_v5.2' into 'release/v5.2'
Fix/esp32 adc continuous loss sample (v5.2)

See merge request espressif/esp-idf!42832
2026-04-09 12:21:11 +08:00
Jiang Jiang Jian 8b3f18cf04 Merge branch 'bugfix/fix_some_wifi_bugs_260407_v5.2' into 'release/v5.2'
fix(wifi): fix some wifi bugs 260407 v5.2(Backport v5.2)

See merge request espressif/esp-idf!47320
2026-04-09 12:09:32 +08:00
armando f322defb25 fix(mmu): fixed drom/irom reservation bus cap search logic 2026-04-09 11:05:24 +08:00
Shu Chen fbddafa2a0 Merge branch 'bugfix/fix_ot_ci_testcases_v5.2' into 'release/v5.2'
ci: improve BR host related test cases (v5.2)

See merge request espressif/esp-idf!47265
2026-04-09 02:36:26 +00:00
morris bdc4cb16f3 Merge branch 'fix/usb_iad_length_backport_v5.2' into 'release/v5.2'
fix(usb/host): Fix incorrect IAD descriptor length (backport v5.2)

See merge request espressif/esp-idf!47374
2026-04-08 21:21:45 +08:00
Jin Cheng 50e3d7e488 fix(bt/bluedroid): moved L2CAP length check into start packets only 2026-04-08 20:42:41 +08:00
Jon Gilmore 811d0f4876 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:42:41 +08:00
Tomas Rezucha ef29f49500 fix(usb/host): Fix incorrect IAD descriptor length 2026-04-08 12:58:40 +02:00
Rahul Tank bb79869454 Merge branch 'bugfix/fix_dtm_end_test_v5.2' into 'release/v5.2'
fix(nimble): Fix DTM test end packet count parsing (v5.2)

See merge request espressif/esp-idf!47335
2026-04-08 14:26:49 +05:30
Wang Meng Yang bc2a328c96 Merge branch 'bugfix/btm_sec_free_dev_v5.2' into 'release/v5.2'
fix(bt): avoid deleting device record on partial transport cleanup(v5.2)

See merge request espressif/esp-idf!47310
2026-04-08 14:52:03 +08:00
Shu Chen 3b33565e02 Merge branch 'feat/update_ot_jan2026_v5.2' into 'release/v5.2'
feat(openthread): update OT to 9b887f6bd (v5.2)

See merge request espressif/esp-idf!46762
2026-04-08 04:17:02 +00:00
Ashish Sharma ac0c138eb4 feat(mbedtls): update to version 3.6.6 2026-04-08 11:11:07 +08:00
morris de9d6cfcc0 Merge branch 'bugfix/fix_temp_sensor_affect_by_adc_v5.2' into 'release/v5.2'
Bugfix/fix temp sensor affect by adc v5.2

See merge request espressif/esp-idf!47031
2026-04-08 10:37:53 +08:00
Island d4ce96fa47 Merge branch 'dev/ble-log-202603_v5.2' into 'release/v5.2'
dev: BLE Log 202603 (5.2)

See merge request espressif/esp-idf!47273
2026-04-08 10:32:35 +08:00
muhaidong 2ef0257b0a fix(wifi): fix some wifi bugs 260407 v5.2
1. fix arp and dns affects signaling test issue
2. improve ap chnnel parameter documentation
3. fix set country change ap channel issue
4. fix beacon timeout too long issue
5. only unicast frames count as keep-alive
2026-04-08 10:28:03 +08:00
gaoxu 380627f5e2 fix(adc): fix ESP32 ADC continuous loss sample times 2026-04-08 10:00:05 +08:00
Rahul Tank 25cbc767e5 fix(nimble): Fix DTM test end packet count parsing 2026-04-07 15:47:06 +05:30
Chen Chen 41029ef278 ci(i2c): ignore known failure test case for legacy i2c driver 2026-04-07 16:06:27 +08:00
laokaiyao 50416e2161 fix(legacy_touch): fixed the read stuck issue after deep sleep 2026-04-07 16:03:02 +08:00
Jiang Jiang Jian 8602034bcf Merge branch 'bugfix/spp_deinit_v5.2' into 'release/v5.2'
fix(bt/bluedroid): flushed all the DM PM at the end of SPP deinit (v5.2)

See merge request espressif/esp-idf!47293
2026-04-07 14:34:37 +08:00
morris 291075ddf2 Merge branch 'fix/wrong_channel_gpio_num_on_p4_adc2_5.2' into 'release/v5.2'
feat(adc): add adc_continuous_parse_data api (v5.2)

See merge request espressif/esp-idf!46774
2026-04-07 14:17:51 +08:00
Jiang Jiang Jian ec287d2e79 Merge branch 'fix/wshadow_warning_on__atomic_test_and_set_v5.2' into 'release/v5.2'
fix(newlib): fix intended warning in case -Wshadow is enabled (v5.2)

See merge request espressif/esp-idf!47203
2026-04-07 14:16:16 +08:00
Jiang Jiang Jian 22c1e5fbf5 Merge branch 'refactor/spi_flash_private_v5.2' into 'release/v5.2'
fix(spi_flash): fixed overboundary check skipping of erase and write_encrypted (v5.2)

See merge request espressif/esp-idf!46971
2026-04-07 14:04:55 +08:00
Mahavir Jain cd17595138 Merge branch 'feat/update_cjson_master_v5.2' into 'release/v5.2'
feat(cjson): update to latest master (v5.2)

See merge request espressif/esp-idf!47303
2026-04-07 10:25:52 +05:30
Island 52ad38feef Merge branch 'feat/use_common_config_to_sel_crypt_lib_v5.2' into 'release/v5.2'
Feat/use common config to sel crypt lib (v5.2)

See merge request espressif/esp-idf!46404
2026-04-07 12:12:03 +08:00
yangfeng e7d5f1bbe8 fix(bt): avoid deleting device record on partial transport cleanup 2026-04-07 12:03:29 +08:00
Jiang Jiang Jian cec604236c Merge branch 'bugfix/ap_5g_phy_bw_v5.2' into 'release/v5.2'
fix(wifi): Update bss max idle timer and add other fixes

See merge request espressif/esp-idf!47279
2026-04-07 11:59:43 +08:00
Zhou Xiao da207b1706 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-04-07 11:52:43 +08:00
Zhou Xiao 019ec12398 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.
2026-04-07 11:51:09 +08:00
Zhou Xiao b5b54570b2 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
2026-04-07 11:51:03 +08:00
Zhou Xiao 243d5b82f1 docs(ble_log_console): update user guides for new features and run/build scripts
- Recommend run.sh/run.bat as primary launch method with Launch Screen description
- Add build.sh/build.bat section for standalone executable packaging
- Document buffer utilization screen (m key) and two-table stats layout (d key)
- Update menuconfig path, status panel format, and Kconfig option names
- Remove obsolete textual ModuleNotFoundError troubleshooting
- Simplify manual configuration to single toggle (defaults cover most cases)
- Fix ESP32 -> ESP chip in introduction
2026-04-07 11:50:56 +08:00
Zhou Xiao b03dce2530 change(bt): consolidate BLE log Kconfig into common/Kconfig.in
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.
2026-04-07 11:50:49 +08:00
Zhou Xiao 5dade89132 change(ble_log): update ble log module description 2026-04-07 11:50:32 +08:00
Zhou Xiao 718561462c feat(bt/ble_log): add cross-pool buffer fallback in LBM acquire
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.
2026-04-07 11:50:25 +08:00
Zhou Xiao 3236123cb4 feat(ble_log_console): add buffer utilization tracker and display
Add BufUtilTracker to record per-LBM inflight peak data, wire it
through StatsAccumulator and StatsUpdated message for thread-safe
delivery to the UI. Buffer utilization is displayed in a dedicated
BufUtilScreen accessible via the 'm' keybinding, separate from
the frame stats screen ('d').

Also reject false INIT_DONE frames with version==0 caused by
misaligned data during parser sync, preventing spurious stats resets.
2026-04-07 11:50:15 +08:00
Zhou Xiao a11bde6fd0 feat(ble_log_console): add BUF_UTIL internal frame decoding
Add BUF_UTIL=5 to InternalSource, BufUtilPool enum, BufUtilResult
TypedDict, BufUtilEntry dataclass, and name resolution helpers.
Add decode branch in internal_decoder with pool/index extraction
from the packed lbm_id field. Tests cover valid decode, pool/index
extraction, and truncated payload handling.
2026-04-07 11:50:09 +08:00
Zhou Xiao c00bead568 fix(bt/ble_log): use atomic_load for inflight_peak in buf_util report
Replace __atomic_exchange_n with __atomic_load_n in
ble_log_emit_buf_util() so inflight_peak reports the all-time peak
since init rather than resetting to zero after each report.
2026-04-07 11:49:58 +08:00
Zhou Xiao bf6577ccf1 feat(ble_log): migrate from ping-pong to multi-buffer transport
Migrate all LBM, RT, and peripheral backend code from 2-buffer
ping-pong to 4-buffer transport with bitmask index arithmetic.

LBM changes:
- Init sets owner on each transport buffer
- get_trans/flush/dump use (idx+1) & (cnt-1) instead of !idx
- get_trans/flush use __atomic_load_n(ACQUIRE) for prph_owned
- New ble_log_write_buf_util() emits BUF_UTIL telemetry frames,
  exchange peak with 0 to avoid stale baseline after bursts

RT changes:
- Queue depth uses unified BLE_LOG_TRANS_TOTAL_CNT
- rt_queue_trans uses __atomic_store_n for prph_owned, tracks
  per-LBM inflight count and peak via lock-free CAS
- ISR path captures pxHigherPriorityTaskWoken and yields

Peripheral changes:
- All tx_done callbacks: decrement inflight before releasing
  prph_owned with __atomic_store_n(RELEASE)
- SPI/UART send_trans error paths: decrement inflight and
  release prph_owned to allow retry on next get_trans pass
- Dummy send_trans: recycle buffer immediately (pos=0, decrement
  inflight, release prph_owned) since no DMA hardware to wait for
- Redir LBM upgraded to 4-buffer with owner and reset support
- All peripherals implement ble_log_prph_reset_util_counters()
2026-04-07 11:49:52 +08:00
Zhou Xiao fcb4e4f77d feat(ble_log): define multi-buffer transport types and Kconfig
Replace ping-pong (2-buffer) transport constants with configurable
multi-buffer (4-buffer) types. Add buffer utilization reporting types,
unified queue depth derivation macros, and compile-time guards.

Rename Kconfig options to total-per-LBM semantics:
- BLE_LOG_LBM_TRANS_SIZE (512) -> BLE_LOG_LBM_TRANS_BUF_SIZE (2048)
- BLE_LOG_LBM_LL_TRANS_SIZE (1024) -> BLE_LOG_LBM_LL_TRANS_BUF_SIZE (2048)

Key type changes:
- ble_log_prph_trans_t: volatile bool -> plain bool (atomic ops used),
  add void *owner back-reference
- ble_log_lbm_t: trans array sized to BLE_LOG_TRANS_BUF_CNT (4),
  add trans_inflight and trans_inflight_peak counters
- BLE_LOG_TRANS_BUF_CNT replaces BLE_LOG_TRANS_PING_PONG_BUF_CNT
- New ble_log_buf_util_t for buffer utilization telemetry
- _Static_assert guards for divisibility, power-of-2, index limits
2026-04-07 11:49:43 +08:00
Zhou Xiao adcf6cb75f feat(ble_log_console): add CLI entry point, build scripts, and docs
- Click-based CLI entry point (console.py) with --port, --baudrate,
  --log-dir options and interactive Launch Screen when --port omitted
- Deprecation warning for --output CLI flag
- 'ls' subcommand to list saved capture files
- PyInstaller build scripts (build.sh, build.bat, build_exe.py)
- Convenience run scripts (run.sh, run.bat)
- README rewrite with installation, usage, architecture docs, and
  troubleshooting guide
- User guides in English and Chinese
- Remove old single-file ble_log_console.py
- Register new scripts in executable-list.txt
2026-04-07 11:49:31 +08:00
Zhou Xiao e40fd6753d feat(ble_log_console): add Textual frontend and app wiring
TUI frontend built on Textual with thread-safe backend integration:

- Launch screen with port/baud/log-dir selection and auto-refresh
- Log view with scrollable RichLog and color-coded write methods;
  Rich markup escaped to prevent crash on bracket characters
- Stats screen split into two tables by time base:
  - Firmware Counters (since chip init): Written and Buffer Loss
  - Console Measurements (since console start): Average Throughput
    and Peak Write — each with separate frames and bytes sub-columns
  - Column widths constrained with min_width/max_width for stable layout
  - Division-by-zero guard when peak window is zero
- Shortcut screen overlay
- Status panel with sync state, checksum mode, and transport metrics;
  speed display uses named UART_BITS_PER_BYTE constant
- Main app wiring: UART reader thread with threading.Lock for serial
  access, frame parser pipeline, stats emission via StatsUpdated
  messages (including funnel snapshots via public accessor for
  thread-safe delivery), BackendStopped message for disconnect
- BackendStopped posted on open_serial failure (prevents stuck status)
- Select.BLANK guard for baud rate in launch screen
- Explicit None guards replace asserts in backend worker
- Wall-clock burst tracking for REDIR frames (no chip-side timestamp)
- SN gap alerts (FrameLossDetected) and traffic spike notifications
2026-04-07 11:44:55 +08:00