Commit Graph

55402 Commits

Author SHA1 Message Date
Wang Meng Yang
62fe690ffd Merge branch 'bugfix/fix_pbac_pm_config' into 'master'
fix(bt/bluedroid): enable sniff power management for PBAP client

Closes BT-4500

See merge request espressif/esp-idf!52417
2026-09-14 08:16:50 +08:00
Wang Meng Yang
3d5e088811 Merge branch 'bugfix/msbc_oob_read' into 'master'
fix(bt/bluedroid): fixed OOB read dring mSBC sync word check

Closes BT-4505

See merge request espressif/esp-idf!52499
2026-09-14 08:07:07 +08:00
Mahavir Jain
0d1b945b16 Merge branch 'fix/fix_clk_tree_abba_deadlock' into 'master'
fix(esp32s31): break clk_tree and deadlock with PERIPH_RCC

Closes PM-871

See merge request espressif/esp-idf!52621
2026-09-13 16:40:51 +05:30
Mahavir Jain
4ce95a0296 Merge branch 'fix/esp_tls_cert_flags_on_handshake_failure' into 'master'
fix(esp-tls): report certificate flags when the handshake fails

Closes IDF-16151

See merge request espressif/esp-idf!52627
2026-09-13 16:22:44 +05:30
Rahul Tank
a1b76d3f45 Merge branch 'bugfix/nimble_gattc_write_long_zero_len' into 'master'
fix(nimble): Send Prepare Write Request before Execute Write in write long with zero-length data

Closes BLERP-2813

See merge request espressif/esp-idf!48832
2026-09-13 11:39:30 +05:30
Shreeyash Bhakare
8fd86fecde fix(nimble): Send Prepare Write Request before Execute Write with zero-length data 2026-09-13 09:12:59 +05:30
Roland Dobai
e3e95642e9 Merge branch 'feat/mcp_server_monitor' into 'master'
feat(tools): mcp-server added monitor-device tool

Closes IDFGH-17421 and IDFGH-17857

See merge request espressif/esp-idf!51734
2026-09-11 16:05:13 +02:00
Marek Fiala
d648b858bb feat(tools): adopt esp-pylib for mcp-server logging and ports
Migrate the MCP server extension to the shared esp-pylib library:
- replace raw stderr prints with esp_pylib.logger.log (note/err)
- route informational logs to stderr via set_info_stream so stdout
  stays reserved for the MCP JSON-RPC transport
- enumerate connected devices via esp_pylib.serial_ports.get_port_names
- stub the new imports in the mcp_ext unit tests

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-11 15:20:45 +02:00
Marek Fiala
3f005c8a4d feat(tools): mcp-server added monitor-device tool
Add a `monitor_device` MCP tool that lets an AI agent run a scripted,
non-interactive `esp-idf-monitor` session against a flashed device and
get back a short status plus a log file path, instead of raw serial
output inline.

Under the hood:

- The agent supplies a plain-text command body (expect/send/sleep/reset/
  exit/comments). `assemble_monitor_script_from_agent_commands()` frames
  it into a script the monitor's non-interactive command mode can
  consume via stdin: it appends `exit` if the agent didn't already end
  with one, and rewrites every bare `expect <regex>` into `expect
  --timeout <timeout_sec> <regex>` via `_monitor_normalize_expect_line()`
  (an already-bounded `expect --timeout ...` line is left untouched so
  the monitor itself reports a bad value). A leading `reset` is not
  prepended - the monitor already resets the chip when it opens the
  port - and any `reset` the agent wrote is left in place.
  `_monitor_parse_sleep_duration()` extracts each `sleep <n>` duration.
  The effective timeout is the sum of every bounded expect duration
  plus every sleep duration. Scripts whose sum exceeds
  `MONITOR_MAX_SCRIPT_SEC` are rejected. If the script has neither
  expect nor sleep (for example only `send`), `timeout_sec` is used so
  the process still has a kill bound.

- `monitor_device()` runs `python -m esp_idf_monitor` via
  `subprocess.run(..., input=script, timeout=2 * effective_timeout)`.
  `no_reset` is forwarded as `--no-reset` so the connection reset can be
  skipped; an explicit `-p` is forwarded when a port is given. Extra
  arguments match `idf.py monitor` where a build exists: baud (`baud`
  tool arg, else `monitor_baud` from `project_description.json`),
  toolchain prefix, `--target`/`--revision`, coredump/panic decode, and
  ELF files with the app ELF first. The 2x hard timeout is a safety net
  independent of the script's own `expect --timeout`/`exit` logic; on
  `TimeoutExpired` the process is killed but any output already captured
  is preserved and logged. `decode_stream()` normalizes that captured
  output, which can be `bytes` on the timeout path even though the
  process otherwise runs in text mode.

- The monitor's exit code drives the reported status via
  `_monitor_status()`, using `EXIT_EXPECT_TIMEOUT` and
  `EXIT_SCRIPT_ERROR` from `esp_idf_monitor.base.constants`: 0 is
  success, 110 means an `expect` pattern never showed up before its
  `--timeout` elapsed, 2 means the monitor rejected the script (bad
  syntax/timeout/regex), anything else is reported generically.

- Serial output and the monitor's own messages share one pipe
  (`stderr=STDOUT`) so decoded panic backtraces stay next to the lines
  that triggered them. `_save_monitor_output()` writes the full merge to
  `<tempdir>/esp_idf_mcp_log/action_monitor/monitor_<timestamp>.log` and
  reports a dedicated `Log file:` line. On non-zero exit or process
  kill, a short tail of that same merge is also returned inline so the
  agent has some failure context without a second file read. If the log
  file can't be written, it falls back to inlining a truncated tail.

Closes https://github.com/espressif/esp-idf/issues/18757
Closes https://github.com/espressif/esp-idf/pull/18385

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-11 15:20:45 +02:00
Island
5621e186dc Merge branch 'refactor/ble-log-lbm-overhaul' into 'master'
refactor: BLE Log LBM Overhaul

See merge request espressif/esp-idf!52299
2026-09-11 20:09:53 +08:00
Ivan Grokhotkov
3a20f7595f Merge branch 'feat/esp32s31_support_sta2eth' into 'master'
feat(examples): Add ESP32-S31 support to network/sta2eth example

See merge request espressif/esp-idf!49047
2026-09-11 13:05:02 +02:00
Ivan Grokhotkov
32cdd1d999 Merge branch 'refactor/usb_console_hal' into 'master'
refactor(console): Use esp_hal_usb APIs in USB console

Closes IDF-15755 and IDFGH-11591

See merge request espressif/esp-idf!51843
2026-09-11 13:04:53 +02:00
Ivan Grokhotkov
704fa1d8e2 Merge branch 'contrib/github_pr_18985' into 'master'
fix(usb): keep CDC ISR callbacks in IRAM (GitHub PR)

Closes IDFGH-18154 and IDFGH-17979

See merge request espressif/esp-idf!51990
2026-09-11 13:04:42 +02:00
Ivan Grokhotkov
b171649d67 Merge branch 'fix/usb_bbpll_light_sleep' into 'master'
fix(usb_phy): Fixed USB PHY clock during low-power modes

Closes IDFGH-14711

See merge request espressif/esp-idf!51822
2026-09-11 13:04:30 +02:00
Ivan Grokhotkov
10708d6ecd Merge branch 'feat/usb_fsls_only' into 'master'
feat(esp_hal_usb): Add option to run FS/LS only host on HS target

See merge request espressif/esp-idf!52184
2026-09-11 13:04:17 +02:00
Rahul Tank
7e5235a7a7 Merge branch 'bugfix/nimble_issues_08092026' into 'master'
fix(nimble): fix few nimble issues 08092026

Closes BLERP-3063

See merge request espressif/esp-idf!52593
2026-09-11 14:15:15 +05:30
Island
e871592435 Merge branch 'change/ble_update_lib_esp32h2_20260910' into 'master'
fix(bt): supported allocate memroy from spiram for ESP32-S31 and ESP32-H4

See merge request espressif/esp-idf!52707
2026-09-11 15:20:34 +08:00
Tomas Rezucha
e8032f6ff6 feat(esp_hal_usb): Add option to run FS/LS only host on HS target
Add function usb_dwc_hal_init_with_config() that takes a bitmap
of configuration flags.
Currently only FS/LS only flag is implemented, but the design
allows extension in the future.
2026-09-11 14:22:44 +08:00
Marius Vikhammer
deb69a8dfe Merge branch 'fix/adjtime-offset-truncation' into 'master'
fix(esp_libc): reject out-of-range adjtime() deltas instead of overflowing

Closes IDFGH-18241

See merge request espressif/esp-idf!52498
2026-09-11 14:13:42 +08:00
Ashish Sharma
8fbfc7fc5f fix(esp-tls): report certificate flags when the handshake fails 2026-09-11 13:46:42 +08:00
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
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
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
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
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
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
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