Commit Graph

55512 Commits

Author SHA1 Message Date
Astha Verma
56f1ae2947 fix(nimble): Fix nimble HID service discovery 2026-09-11 11:16:03 +05:30
Rahul Tank
25c114e07a Merge branch 'bugfix/fix_compilation_issue' into 'master'
fix(nimble): Fixed compilation issues due to missing BLE_GATTS

See merge request espressif/esp-idf!52719
2026-09-11 10:37:49 +05:30
Harshal Patil
f386b718e1 fix(spi_flash): size the ROM mmap page table to the region the ROM searches
spi_flash_mmap_page_num_init() passed a literal 128 while the ROM searches
Cache_Get_DROM_MMU_End() / 4 entries -- 256 on esp32c5, c6, h2 and s3 -- so
its free-page scan ran off the array and judged entries from stale heap bytes.

The refcount bump on the commit path indexes the same way, so a mapping placed
above entry 127 also writes past the array and corrupts the heap behind it.

esp32c61 and esp32h21 have the ROM mmap but never program the size and have no
soc/mmu.h to read it from, so they keep 128.
2026-09-11 10:04:46 +05:30
Mahavir Jain
957618d083 Merge branch 'fix/buildv2_fault_assert_opt_check' into 'master'
fix(esp_security): use EXECUTABLE in fault_assert_opt_check

See merge request espressif/esp-idf!52640
2026-09-11 09:53:36 +05:30
Mahavir Jain
78dac3a276 Merge branch 'test/tee_sec_stg_aead_len_bounds' into 'master'
test(esp_tee): fix oversized AEAD test to exercise the length check

See merge request espressif/esp-idf!52684
2026-09-11 09:50:21 +05:30
Master
046e69d925 fix(ble_mesh): index last_param by inst_type, not controller inst_id
last_param[] is sized by BLE_MESH_ADV_INST_TYPES_NUM (the number of mesh
advertising instance types) but was indexed by inst_id, the controller
advertising instance id (Kconfig range 0-3). With multi-adv disabled the
type count is 1, so any non-zero CONFIG_BLE_MESH_ADV_INST_ID caused an
out-of-bounds access into last_param[].

Map inst_id to inst_type with the new bt_mesh_get_adv_inst_type_by_inst_id()
helper and index last_param by inst_type in both the nimble and bluedroid
host adapters. Add a bounds check at bt_le_ext_adv_start() entry to guard
against unmapped instance ids.
2026-09-11 12:05:21 +08:00
Marius Vikhammer
5f22e4390c Merge branch 'fix/console_stop_repl_join' into 'master'
fix(console): join the REPL task before esp_console_stop_repl frees it

See merge request espressif/esp-idf!52590
2026-09-11 11:11:34 +08:00
Jiang Jiang Jian
5755871cb4 Merge branch 'bugfix/idfci-13866' into 'master'
config wakeup gpio pin internal pullup to avoid input floating

Closes IDFCI-13866

See merge request espressif/esp-idf!52588
2026-09-11 10:47:04 +08:00
Jiang Jiang Jian
342dd1f9c4 Merge branch 'feat/esp_idf_h4_clk_tree_management' into 'master'
Feat/esp idf h4 h21 clk tree management

Closes PM-858 and PM-653

See merge request espressif/esp-idf!50653
2026-09-11 10:38:04 +08:00
Jiang Jiang Jian
57602151fa Merge branch 'fix/supplicant_checks' into 'master'
Fixed OOB read on short FT auth and RRM action frames

Closes SEC-766 and SEC-767

See merge request espressif/esp-idf!52683
2026-09-11 10:25:44 +08:00
Rahul Tank
1e07c30c9f fix(nimble): Fixed compilation issues due to missing BLE_GATTS 2026-09-11 07:29:56 +05:30
Marius Vikhammer
af1361497f Merge branch 'docs/api_ref_system_updates' into 'master'
docs(system): update API references for H4 and S31

See merge request espressif/esp-idf!52561
2026-09-11 09:53:01 +08:00
ShenWeilong
91234cb3f2 fix(bt): supported allocate memroy from spiram for ESP32-S31 and ESP32-H4 2026-09-10 20:53:10 +08:00
Jiang Jiang Jian
b50fc62d2f Merge branch 'bugfix/fix_example_power_save_build_fail_issue' into 'master'
fix(esp_timer): preserve timer_process_alarm symbol for ldgen

Closes WIFI-7625

See merge request espressif/esp-idf!52528
2026-09-10 20:45:17 +08:00
wanckl
e9483b09fd feat(driver_gpio): support hysterisys filer in rtcio mode 2026-09-10 20:33:28 +08:00
Jiang Jiang Jian
51a9b3acf8 Merge branch 'fix/wpa_supp_checks' into 'master'
fix(wifi) : Add length/NULL checks and some minor changes

Closes SEC-258, SEC-262, SEC-260, SEC-737, SEC-760, SEC-768, and SEC-744

See merge request espressif/esp-idf!51110
2026-09-10 20:06:36 +08:00
Rahul Tank
bbb5870da3 Merge branch 'bugfix/hardware_error_assert' into 'master'
fix(nimble): Add hardware error event handling as normal event

Closes BLERP-3096

See merge request espressif/esp-idf!52524
2026-09-10 17:08:32 +05:30
Island
24a32ed25e Merge branch 'change/ble_update_lib_20260904' into 'master'
change(ble): [AUTO_MR] 20260904 - Update ESP BLE Controller Lib

Closes BLERP-3068, BLERP-3084, BLERP-3087, and BLERP-3100

See merge request espressif/esp-idf!52434
2026-09-10 19:07:41 +08:00
morris
376a9780cc Merge branch 'test/touch_deep_sleep_wakeup' into 'master'
test(touch): Add touch sensor deep sleep wake-up ci test

Closes IDF-15439

See merge request espressif/esp-idf!52474
2026-09-10 18:51:12 +08:00
Yogesh Mantri
a287bbc25e fix(console): delete state_mux when REPL creation fails 2026-09-10 10:12:00 +00:00
Yogesh Mantri
4532e7e8c8 fix(console): join with an empty semaphore instead of a given mutex 2026-09-10 10:12:00 +00:00
Yogesh Mantri
cd1a5fc1f3 fix(console): join the REPL task before esp_console_stop_repl frees it 2026-09-10 10:12:00 +00:00
Marcelo Barros de Almeida
7c589cd5b1 feat(802.15.4): Add support for multiple console types in CLI
Refactored app_main to initialize the console REPL based on the selected configuration: UART, USB CDC, or USB Serial JTAG. This improves flexibility and allows the CLI to work with different hardware interfaces.
2026-09-10 17:51:37 +08:00
Rahul Tank
0a55d54683 fix(nimble): Add hardware error event handling as normal event 2026-09-10 17:32:41 +08:00
Roland Dobai
2e6d41c2e9 Merge branch 'task/buildv2_gdbinit_multi_exec' into 'master'
feat(cmakev2): parameterize gdbinit for multi-executable builds

Closes IDF-15860

See merge request espressif/esp-idf!51239
2026-09-10 10:59:42 +02:00
cnicc
c74ea1aca0 fix(openthread): restore ot_network_auto_start() call in ot_br example 2026-09-10 16:57:20 +08:00
Rahul Tank
97f81dd22b Merge branch 'feat/migrate_nimble_10' into 'master'
feat(nimble): Migrate to nimble-1.10.0

See merge request espressif/esp-idf!51858
2026-09-10 14:26:10 +05:30
Axymorrsen
c30626100e fix(usb): keep CDC ISR callbacks in IRAM 2026-09-10 16:24:19 +08:00
Sudeep Mohanty
0d07903639 Merge branch 'feat/ulp_kconfig_split' into 'feat/ulp_component_split'
refactor(ulp): move ULP program Kconfig options to its components

See merge request espressif/esp-idf!52580
2026-09-10 10:13:34 +02:00
linruihao
910cd35575 fix(bt/bluedroid): enable sniff power management for PBAP client 2026-09-10 15:48:29 +08:00
Marius Vikhammer
fec0755681 docs(system): update API references for H4 and S31
Add target-specific power-management frequencies and capability
conditions so later chips do not need chip-by-chip list updates.
2026-09-10 15:41:03 +08:00
guozifan
7a07b79fc6 fix(ble_log): extend snapshot accounting and correct pool flushing
Count successful frame bytes and share Global SN with snapshots.
Track snapshot attempts with a separate 24-bit anchor_count. Keep protocol v8.

Scan writer-held buffers during periodic flush and require a published FREE bit.
Keep UART0 periodic draining active when producers are disabled.
Document late pending-seal hints and update existing snapshot checks.
2026-09-10 15:39:56 +08:00
Zhou Xiao
e3e3ac6541 test(ble_log): soak the park/wake handshake and fix observer latching
- concurrent-writer integrity and park/wake soak cases: many writers
  across shared and reserve transports keep frames intact and SNs
  unique through continuous park/wake turnover;
- the deinit race case wakes parked writers before joining, so the
  join cannot deadlock on a task that must first observe the closed
  gate;
- the perf observer latches its final counters only from FLUSH
  snapshots: periodic frames arriving after the FLUSH snapshot carry
  interval counters that the flush reset, and must not overwrite the
  final result;
- README describes the timestamp prefix by writer path.
2026-09-10 15:39:56 +08:00
Zhou Xiao
22812d893a fix(ble_log): harden the pool waiter handshake and claim ordering
Consolidates the concurrency review fixes for the unified pool:

- the shared ESP Timer task never waits for a transport: its identity
  is checked on the would-wait path only, so its callbacks always
  return and dispatch can progress (this also bounds claim()'s
  backpressure);
- transports accepted from the FREE bitmap are ACQUIRE-loaded: the
  recycler publishes pos/pending_seal with a STORE_RELEASE(FREE)
  without holding the candidate lock, and the acceptance load pairs
  with that publication;
- a waiter whose scan bounced off a candidate lock is re-advertised:
  the releasing side re-checks availability after the lock release,
  inside the same seq_cst window as the waiter-count read, so a
  transport that became claimable while locked cannot strand its wake;
- waiters never self-wake on an unpublished FREE transport:
  notification for a FREE transport fires only when its free-bitmap
  hint is already published, so a registered waiter cannot mint and
  consume its own wake tokens in a self-sustaining spin;
- flush and deinit drains re-check writer references after observing a
  zero waiter count: a writer waking between the two loads re-acquires
  its reference before unregistering, and the seq_cst-fenced re-read
  must observe it before the drain concludes.
2026-09-10 15:39:56 +08:00
Zhou Xiao
2cf0638686 feat(ble_log): attribute compressed records with a task-id registry
Protocol v8: every ENCODE record carries the one-byte id of the task
that formatted it, replacing the incremental TASK_SWITCH marker scheme.
Attribution becomes a property of the record: the per-source CAS lock,
the last_task_handle writeback, and the try-lock contention drops are
deleted, so concurrent writers to one source can no longer lose records
to attribution races.

The registry is a self-contained module (ble_log_task_registry.c/h,
structured like the UART redirection writer): an append-only name-keyed
table shared by every ENCODE writer, 16 bytes of RAM per entry, sized by
CONFIG_BLE_LOG_TASK_ID_MAX. Word compares resolve ids lock-free on the
record path; the registration CAS serializes only the cold path (once
per task lifetime), and a record resolves its writer id after its claim
succeeds, so the claim's lifetime reference pins the registry epoch and
the id cannot cross an init/deinit boundary. A full registry or a
contended registration degrades that record to the unknown id (0xFF)
and still emits it. ISR callers stop at the lookup-miss branch before
registration mutates shared state.

Bindings are module-owned system output: every periodic snapshot window
broadcasts one INTERNAL frame packing one fixed-layout record per
registered entry on the registry's own dedicated transport, with a
sequence of its own (a gap counts a skipped broadcast window, never a
lost snapshot). A busy transport skips the window and the next one
rebroadcasts, so a receiver that joined late converges on the next
window.

BLE_LOG_VERSION is bumped to 8: old decoders must not parse the new
record layout. The compression encoders reject truncated NULL-buffer
records instead of committing partial payloads, and the test app enables
host compression with a 4-entry registry so the table-full path is
reachable on target.
2026-09-10 15:39:56 +08:00
Zhou Xiao
0b8368ee86 fix(ble_log): restore controller HCI capture without Host hooks
Keep Host capture for Bluedroid and legacy VHCI NimBLE while retaining controller HCI records for transports without Host capture. Respect the HCI logging switch and preserve controller source mapping and payloads.

Extend metadata regression coverage and document capture selection.
2026-09-10 15:39:56 +08:00
Zhou Xiao
278b0d9620 fix(ble_log): make yieldable public writes wait for a shared transport
The NON_YIELD flag in bit 7 of the frame source byte forced every
receiver to mask the byte before decoding the source, while carrying
little information beyond what the source ID already implies. Protocol
v7 is not released yet, so drop the flag instead of versioning it:
the source byte now carries the bare frozen ble_log_src_t value.

The internal pool reservation for non-yieldable contexts
(BLE_LOG_POOL_NON_YIELD_RESERVE_CNT) is untouched: it is memory
management, not wire format.

Update the golden bytes (source byte 0x87 -> 0x07, recomputed
checksum) and rename the critical-section frame capture test
accordingly; the walker structs lose the redundant source_meta
field.
2026-09-10 15:39:56 +08:00
Zhou Xiao
281ce584f3 refactor(ble_log): remove the dead legacy LBM module and tidy the v7 switch
ble_log_lbm.c/h were superseded by the v2 LBM (protocol v7) and are
not part of the build; the two files only referenced each other. The
deprecated Kconfig entries stay untouched - downstream test apps may
still pin the old symbols (e.g. BLE_LOG_LL_HCI_LOG_PAYLOAD_LEN_LIMIT).

Post-switch polish folded in: version info built in place inside lbm
init, pool-internal tidying, simplified runtime submit/defer paths,
per-snapshot clock sampling, shared waiter-count RMW in the acquire
path, and dropped zero-value transport field inits.
2026-09-10 15:39:56 +08:00
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
Harshal Patil
34bc734ea4 test(esp_tee): size the oversized-AEAD test buffer to the length it claims
The TEE checks REE buffer bounds before input length, so claiming 4097
bytes of a 31-byte buffer returned INVALID_ARG or INVALID_SIZE by layout.
2026-09-10 12:57:32 +05:30
tarun.kumar
0ba37921dd fix(wifi) : Fixed OOB read on short FT auth and RRM action frames 2026-09-10 12:36:27 +05:30
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