You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(teensy): comprehensive deployer state machine (closes#433, #432)
Replaces the bare `teensy_loader_cli` wrapper with a state machine that
addresses the wedged-Windows-host failure modes catalogued in #433:
* `soft_reboot.rs` — baud-134 trigger so a running user firmware can be
flashed unattended (no program-button press); also fixes#432
(`Soft reboot is not implemented for Win32`).
* `halfkay_probe.rs` — confirms the CDC port left the bus after the
baud-134 trigger.
* `flash.rs` — bounded retry+backoff around `teensy_loader_cli` for the
WinUSB "error writing to Teensy" quirk that fires 6/10 cycles.
* `port_discovery.rs` — pre-flash port snapshot + post-flash new-CDC-ACM
detection; surfaces the freshly enumerated port through
`DeploymentResult.port`.
* `first_byte_probe.rs` — advisory probe that warns when a successful
flash produces zero serial bytes (typical `setup()`-hang signature).
* `usb_type.rs` — best-effort read of the build's `usb_type` and
advisory when no Serial endpoint exists (`USB_RAWHID`, …).
* Two-tier timeouts (`flash_timeout_secs` vs
`wait_for_halfkay_timeout_secs`) so first-flash button-press scenarios
don't kill the loader at 60s.
* Env escape hatches: `FBUILD_TEENSY_FLASH_RETRIES`,
`FBUILD_TEENSY_FIRST_BYTE_TIMEOUT_SECS`,
`FBUILD_TEENSY_DISABLE_BAUD_134_TRIGGER`.
Daemon's `/api/deploy` now forwards `DeploymentResult.port` to the
post-deploy monitor (failure mode #7) so re-enumeration to a new COM
name doesn't leave the monitor on the dead pre-flash port.
Public API of `TeensyDeployer::new` / `from_board_config` is unchanged;
`TeensyLoaderParams` gains opt-in fields with sensible defaults so the
daemon dispatch site needs no code change.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments