Skip to content

autoresearch: chip-id probe 3 s timeout is too short for CP210x boards; add reset-strategy fallbacks #3446

Closed

Description

@zackees

Symptom

bash autoresearch esp32dev fails to detect an ESP32-wroom dev board (Silicon Labs CP210x USB-UART bridge) on Windows:

COM11: Silicon Labs CP210x USB to UART Bridge (COM11)
  hwid: USB VID:PID=10C4:EA60 SER=0254F7A1 LOCATION=1-10.1.1:x.0

No USB serial port matched expected environment 'esp32dev' (ESP32). Probed:
  COM11: detection failed (esptool timed out after 3.0s - device may not be in bootloader mode);

The board itself is healthy (independently confirmed via bash compile esp32dev --examples Blink succeeding end-to-end). Autoresearch's chip-id probe is just giving esptool too little time.

Root cause

ci/util/port_utils.py:194:

chip_result = detect_attached_chip(port.device, timeout=3.0)

esptool's chip-id end-to-end on a CP210x board needs more than 3 s:

  1. CP210x driver init + DTR/RTS line bring-up: ~100 ms
  2. Classic reset pulse (DTR low → EN low → release): ~250 ms
  3. ROM bootloader SYNC handshake, up to 7 retries at ~700 ms each: up to 5 s in pathological cases
  4. Stub upload + chip-id register read: ~500 ms

Realistic budget is 8–15 s, not 3 s.

Additional weakness: only one reset strategy is tried

detect_attached_chip (in ci/util/port_utils.py:468) invokes esptool with the default --before default-reset. If the board's auto-reset circuit is flaky — common after rework, after a soldered short, or on some clones — there's no fallback path. The probe gives up and reports "device may not be in bootloader mode" without ever attempting:

  • --before no-reset (handles the case where the user manually held BOOT)
  • --before usb-reset (handles USB-CDC native chips like S3/C3)
  • Extended DTR-low pulse (handles boards with a sluggish reset capacitor)

Ask

  1. Bump the default detect_attached_chip subprocess timeout to 15 s (covers the worst pathological case while still failing fast for "no port responded").
  2. After the default-reset probe fails, retry with --before no-reset and --before usb-reset before declaring the port unusable.
  3. Have the misleading "Available ports (all non-USB):" header in the failure message honour the actual USB-vs-Bluetooth-vs-LPT split — COM11 in the failing run is clearly USB, but the message classifies it as "non-USB" because it didn't match the expected env.

Repro

# Windows 10
# ESP32-WROOM dev kit on COM11 (CP210x)
bash autoresearch esp32dev
→ FATAL ERROR: PORT DETECTION FAILED

The same board compiles + boots fine when esptool is invoked manually with a generous timeout.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions