Commit Graph

55323 Commits

Author SHA1 Message Date
Zhou Xiao
06478ec313 feat(ble_log): make TS sync unconditional with toggle-IO-only Kconfig
TS sync now always runs: the periodic tick (TS sample, OPEN transport
flush, internal snapshot) exists in every build, so the unified periodic
output no longer depends on BLE_LOG_TS_ENABLED and idle systems without
dispatch activity still flush every second.

- New BLE_LOG_TS_SYNC_TOGGLE_IO_ENABLED gates only the analyzer toggle
  IO (GPIO config, level writes, reset); with it unset, TS snapshots
  still sample the clocks and carry io_level = 0. BLE_LOG_TS_ENABLED
  keeps its prompt as a deprecated compatibility entry that selects
  BLE_LOG_TS_SYNC_TOGGLE_IO_ENABLED, so existing projects keep the old
  toggle behavior, and the TS trigger entries drop their dependency on
  it.
- ble_log_ts is no longer a separate module: its 95-line shell (clock
  sampling, toggle IO management) joins ble_log_rt.c, the only runtime
  that drives it. ble_log_ts_info_t moves to ble_log_lbm_v2.h (the
  snapshot interface that consumes it), the BLE_LOG_GET_LC_TS chip
  table moves next to its single caller, the init/deinit folds into
  ble_log_rt_init/deinit, the reset folds into ble_log_sync_enable, and
  the sampler becomes a void static now that its failure paths are gone.
- The runtime hook is gone: with the tick always present, its throttled
  defer-callback fallback for runtime-disabled sync served no one. The
  TS tick is the only periodic output source; ble_log_sync_enable(false)
  now means full periodic silence, and ble_log_rt_dispatch loses its
  return value. The version-info regression now arms the tick instead
  of the hook.
- BLE_LOG_GET_LC_TS branches on CONFIG_BT_DUAL_MODE_ARCH: the
  dual-mode-arch controllers (ESP32-H4, ESP32-S31) expose their link
  layer timer as r_sched_timer_getCurrentTimeU32, but the symbol is
  obfuscated in the current prebuilt libraries, so those targets report
  lc_ts = 0 for now; call the accessor once the libraries export it.
  The Gen 2 branch keeps r_ble_lll_timer_current_tick_get (defined by
  every C5/C6/C61/H2/H21 library, verified by nm and by linking
  ble_log_test for ESP32-C6); ESP32-H4 and ESP32-S31 fall out of it.
- ble_log_ts_info_update's old shape is gone entirely: the heap-allocated
  global ts_info and its critical section memcpy were leftovers from the
  pointer-return API; the sampler writes the caller object in place and
  keeps only the toggle IO phase as cross-call state. int_src_code is
  filled outside the critical section; the phase toggle stays inside to
  exclude the write in ble_log_sync_enable.

Idle systems no longer touch the controller clock: the legacy
accessors dereference controller state and INIT precedes controller
initialization, so the sampler returns lc_ts = 0 while the controller
is idle instead of reading it. The deferred dispatch callback drains
only the queue depth observed at entry and re-arms itself for arrivals
left behind, so it cannot monopolize the shared ESP timer task.
2026-09-10 15:39:56 +08:00
Zhou Xiao
fdf4942485 feat(ble_log): add periodic auto flush with pending-seal handoff
Partially-filled OPEN transports previously waited for a capacity seal
or an explicit ble_log_flush(); an app that never calls flush loses the
parked frames at test end. Three triggers now cover the gap:

- The periodic output tick (the TS trigger, or the runtime hook when
  TS is disabled) flushes OPEN transports ahead of the periodic
  snapshot. The flusher never waits for a lock: a transport whose lock
  is held is left a pending-seal marker instead.
- The next claim that takes the transport lock sees the marker and
  seals the buffered frames before scanning on for another transport;
  if no writer ever returns, the next periodic pass seals the
  transport uncontended.
- ble_log_deinit() drains the remaining OPEN transports after the
  writer gate closes and before the runtime queue is destroyed; the
  peripheral deinit wait completes the delivery.

The marker is cleared by seal_and_send (the choke point of every seal
path), by the direct FREE return in ble_log_commit's error path, and on
recycle, so it never survives a transport lifecycle. The full-barrier
ble_log_flush() semantics are unchanged.

Tests cover the pending-seal handoff (claim-locked flush hook), the deinit drain of a parked sub-capacity burst, and the real ble_log_deinit() path through the auto-recycle hook.
2026-09-10 15:39:56 +08:00
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
Armando (Dou Yiwen)
496c0b6377 Merge branch 'refactor/flash_refactor' into 'master'
spi_flash: split driver and os driver into `spi_flash` and `esp_mspi` components

Closes IDF-15210

See merge request espressif/esp-idf!45409
2026-09-10 07:29:01 +00:00
morris
a07ebb7ad8 Merge branch 'docs/improve_uart_doc' into 'master'
docs(uart): clarify example pins need a USB-to-UART bridge

See merge request espressif/esp-idf!51448
2026-09-10 14:50:43 +08:00
Mo Fei Fei
bb2c545085 docs(uart): clarify example pins need a USB-to-UART bridge 2026-09-10 14:50:43 +08:00
Kapil Gupta
05c44bcb8e Merge branch 'fix/btm_query_reason' into 'master'
Send Low RSSI reason in BTM Query for roaming

Closes WIFIBUG-2120

See merge request espressif/esp-idf!52106
2026-09-10 12:13:40 +05:30
Kapil Gupta
a7cb4cc709 Merge branch 'fix/blacklist_roaming_issue' into 'master'
Preserve SSID and authmode across disconnect for blacklist recovery

Closes WIFIBUG-2168

See merge request espressif/esp-idf!52643
2026-09-10 11:13:58 +05:30
Kapil Gupta
4c9ffea8dd Merge branch 'fix/roam_init_deinit_issue' into 'master'
Roam handle unregister issue

Closes WIFIBUG-2079

See merge request espressif/esp-idf!52312
2026-09-10 11:13:19 +05:30
tarun.kumar
ce30446c3d fix(wifi): Send Low RSSI reason in BTM Query for roaming
Roaming previously used REASON_RSSI (5), which APs decode as Load
Balancing. Send Low RSSI (16) from RoamingApp and the example
without changing the public btm_query_reason enum.
2026-09-10 11:52:25 +08:00
morris
764a0c442e Merge branch 'refactor/pmu_efuse_ll' into 'master'
refactor(pmu): move PMU calibration efuse getters from efuse_ll to pmu_ll

See merge request espressif/esp-idf!52660
2026-09-10 11:47:28 +08:00
Shu Chen
2dc25a7bbe Merge branch 'fix/openthread-udp-host-interface' into 'master'
fix(openthread): preserve host interface on UDP receive

See merge request espressif/esp-idf!52388
2026-09-10 02:57:18 +00:00
morris
0f977dfc9c Merge branch 'feat/spi_add_data_output_inversion' into 'master'
feat(spi): support data output inversion

Closes IDF-15546

See merge request espressif/esp-idf!52529
2026-09-10 10:48:40 +08:00
morris
43e45bc73c Merge branch 'ci/fix_precommit' into 'master'
ci(pre-commit): add esp-pylib dep to soc-caps-kconfig check

See merge request espressif/esp-idf!52673
2026-09-10 10:10:58 +08:00
morris
c9e370efcf ci(pre-commit): add esp-pylib dep to soc-caps-kconfig check
commit d6771a0608 made gen_soc_caps_kconfig.py import esp_pylib, but the
check-generated-soc-caps-kconfig hook never listed it in additional_dependencies.
Since the hook uses language: python (isolated env), the import failed with
ModuleNotFoundError. Add esp-pylib to match the other scripts that depend on it.
2026-09-10 09:56:14 +08:00
morris
a0772ce93a refactor(pmu): move PMU calibration efuse getters from efuse_ll.h to pmu_ll.h
Move the PMU internal voltage calibration related efuse read LL
functions
from efuse_ll.h into pmu_ll.h, renaming them with the pmu_ll prefix.
efuse_ll.h should only contain efuse controller or system-global
functions;
other modules' private efuse bits belong to their own LL layer.

Affected chips: esp32c5, esp32c6, esp32c61, esp32h2, esp32h4, esp32p4.

Moved functions (renamed efuse_ll_get_* -> pmu_ll_get_*):
- get_active_hp_dbias, get_active_lp_dbias
- get_dbias_vol_gap
- get_lslp_dbg, get_dslp_dbg (where present)
- get_lslp_hp_dbias, get_dslp_lp_dbias (where present)
- get_dslp_dbias (esp32h2)
2026-09-10 09:53:06 +08:00
Steven (Yang Minghui)
782574ee7d feat(spi): support data output inversion 2026-09-09 22:35:03 +08:00
Roland Dobai
e9362463b4 Merge branch 'feat/pylib_standalone_scripts' into 'master'
Adopted esp-pylib for various standalone scripts

See merge request espressif/esp-idf!49944
2026-09-09 15:24:05 +02:00
Marius Vikhammer
ae943a62f0 Merge branch 'fix/lp_core_rc_fast_delay_freq' into 'master'
fix(ulp): hardcode LP core RC_FAST frequency per target

Closes IDFCI-6493

See merge request espressif/esp-idf!51933
2026-09-09 20:46:06 +08:00
Marius Vikhammer
f5e06de75f Merge branch 'bugfix/h4_touch_caps' into 'master'
fix(soc): use standard touch wakeup cap name on ESP32-H4

See merge request espressif/esp-idf!52093
2026-09-09 20:43:42 +08:00
Marius Vikhammer
9db46b1314 Merge branch 'test/esp_timer_api_coverage' into 'master'
test(esp_timer): cover unused public query and absolute-alarm APIs

See merge request espressif/esp-idf!52442
2026-09-09 20:40:12 +08:00
Alexey Gerenkov
2210471aba Merge branch 'fix/gdbstub_xtensa_pie_registers_first_write' into 'master'
fix(gdbstub): xtensa: persist FPU writes before first coproc use

Closes IDF-15054

See merge request espressif/esp-idf!52248
2026-09-09 16:33:46 +08:00
Roland Dobai
f20a9211af Merge branch 'docs/idf-monitor-fast-reflash' into 'master'
docs: Update idf-monitor fast reflash shortcut documentation

See merge request espressif/esp-idf!51445
2026-09-09 10:17:46 +02:00
morris
fd163d917c Merge branch 'refactor/i2s_pcm_player' into 'master'
refactor(i2s): replace i2s_es8311 example with wav_player

See merge request espressif/esp-idf!52486
2026-09-09 16:10:51 +08:00
morris
da3e20988f Merge branch 'ci/reenable_h4_eco2_target_test' into 'master'
feat(esp32h4): remove the support of esp32h4 rev0

Closes IDF-16110

See merge request espressif/esp-idf!52538
2026-09-09 16:03:35 +08:00
Jakub Kocka
d6771a0608 change(tools): Unified outputs of various standalone scripts (esp-pylib) 2026-09-09 09:43:59 +02:00
tarun.kumar
602a9dc9e8 fix(wifi) : Preserve SSID and authmode across disconnect for blacklist recovery 2026-09-09 12:51:14 +05:30
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
Marius Vikhammer
86837ab6fc Merge branch 'feat/hwloop_esp32p4_v3_0' into 'master'
fix(freertos): update HWLP state bug condition for ESP32P4 revision checks

See merge request espressif/esp-idf!52569
2026-09-09 15:01:01 +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
Armando (Dou Yiwen)
99b6f5dcd8 test(spi_flash): verify partition protection callback registration 2026-09-09 14:17:00 +08:00
Armando (Dou Yiwen)
5e181236b7 refactor(mspi): move esp_mspi_align and mspi_mem_barrier to esp_mspi 2026-09-09 14:17:00 +08:00
armando
90dd358dcb feat(mspi): added mspi flash error (aligned with rom) 2026-09-09 14:17:00 +08:00
armando
77807bfe6e fix(esp_mspi): remove not used cmake variable 2026-09-09 14:17:00 +08:00
armando
2cacb0bd56 change(flash): deprecate bootloader_flash_priv.h 2026-09-09 14:17:00 +08:00
armando
6e3abd12a1 refactor(spi_flash): move os layer to esp_mspi and chip configs to spi_flash
Also fixes the implicit dependency on esp_partition.
2026-09-09 14:17:00 +08:00
Mahavir Jain
71c93b10b9 Merge branch 'test/s3_memprot_dram_exec_xfail' into 'master'
test(panic): apply the ESP32-S2 memprot expected failures to ESP32-S3

Closes IDFCI-13868

See merge request espressif/esp-idf!52444
2026-09-09 11:42:35 +05:30
Jiang Jiang Jian
716e9e5121 Merge branch 'fix/fix_cryto_module_locked_after_pd_top_lslp' into 'master'
fix(esp_hw_support): fix cryto module locked after pd_top lightsleep

Closes WIFIBUG-2126 and PM-861

See merge request espressif/esp-idf!52460
2026-09-09 13:59:46 +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
c565262ded Merge branch 'bugfix/ppa_srm_stuck_on_dma_2' into 'master'
fix(ppa): fix for SRM operation potential block if do 90/270 degree rotation

Closes IDFGH-18204 and IDFGH-17870

See merge request espressif/esp-idf!49657
2026-09-09 11:55:27 +08:00
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
Ashish Sharma
5286f60b26 Merge branch 'test/esp_http_client_characterization' into 'master'
test(esp_http_client): add mock transport and basic characterization tests

See merge request espressif/esp-idf!52212
2026-09-09 11:04:25 +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