10 Commits

Author SHA1 Message Date
9810d35637 Remove esp_binary_optimize tool
No real esptool operation backs "optimize firmware binary". Size
optimization happens at compile-time via ESP-IDF menuconfig, not as
a post-processing step on a .bin file. The analysis use case is
already covered by esp_firmware_analyze.
2026-01-30 21:38:14 -07:00
f2f2dbd5eb Fix eFuse summary parser for espefuse v5.x output format
The R/W permission field uses 'R/W' not just 'R' at end of line,
and values can be 'False', '0', hex, or binary representations.
2026-01-30 20:52:09 -07:00
945939bdad Implement security manager, diagnostics, and partition manager
Security manager: eFuse read/burn via espefuse, security audit
combining chip-id + get-security-info + eFuse summary, flash
encryption status checking.

Diagnostics: memory dump with hex formatting via dump-mem,
performance profiling by timing esptool operations, diagnostic
report combining chip-id + read-mac + flash-id.

Partition manager: OTA partition table generation with auto-layout,
custom partition table from config dict with validation, binary
partition table parsing from flash reads at 0x8000.
2026-01-30 20:32:48 -07:00
9fe57005c3 Remove --no-stub from flash operations for faster transfers
The ROM bootloader (--no-stub) runs at ~62 kbit/s which causes
timeouts on large images. The stub flasher is dramatically faster
and works correctly over QEMU socket connections.
2026-01-30 11:40:54 -07:00
609928ff6e Implement flash manager operations (write, read, erase, backup)
Replace stub implementations with real esptool subprocess calls.
Each operation runs esptool as an async subprocess with timeout,
matching the chip_control pattern. All four tools now work with
both physical ports and QEMU socket:// URIs.
2026-01-29 16:33:25 -07:00
3818599b94 Fix port allocation to ignore stopped instances
Port allocator was counting stopped QEMU instances as occupying ports,
preventing new starts after stop-all. Only running instances now block
port reuse. Stopped instances with flash images on disk are preserved
for esp_qemu_flash; truly stale entries are purged.
2026-01-29 16:23:36 -07:00
ff138c492e Fix QEMU version detection and remove unsupported ESP32-S2
Sort glob results when auto-detecting QEMU binaries to reliably
pick the newest version. Previously filesystem ordering could select
an older build (8.2.0 instead of 9.0.0), missing ESP32-S3 support.

Remove ESP32-S2 from CHIP_MACHINES — the Espressif QEMU fork has
no esp32s2 machine type.
2026-01-28 16:59:24 -07:00
cb4822a0a4 Document QEMU emulation in README and improve tool descriptions
Add QEMU section to README with install instructions and tool reference.
Enrich MCP tool docstrings with workflow context, cross-references to
related tools, and guidance on when to use each tool — these descriptions
are read by the calling LLM to decide tool selection.
2026-01-28 16:48:39 -07:00
740164f582 Add download mode, efuse emulation, and watchdog disable to QEMU manager
Smoke tested against real Espressif QEMU fork — esptool successfully
identifies, reads flash_id, and writes firmware to emulated ESP32 via
socket://localhost:5555. Enriched CHIP_MACHINES with per-chip efuse
data, GPIO strap values, and watchdog timer driver names derived from
ESP-IDF's qemu_ext.py.
2026-01-28 16:44:17 -07:00
64c1505a00 Add QEMU ESP32 emulation support
Integrate Espressif's QEMU fork for virtual ESP device management:

- QemuManager component with 5 MCP tools (start/stop/list/status/flash)
- Config auto-detects QEMU binaries from ~/.espressif/tools/
- Supports esp32, esp32s2, esp32s3, esp32c3 chip emulation
- Virtual serial over TCP (socket://localhost:PORT) transparent to esptool
- Scan integration: QEMU instances appear in esp_scan_ports results
- Blank flash images initialized to 0xFF (erased NOR flash state)
- 38 unit tests covering lifecycle, port allocation, flash writes
2026-01-28 15:35:22 -07:00