crosspad_flash
Flash firmware to a connected CrossPad device. Choose ESP32-S3 (via UART in bootloader mode or USB-CDC OTA) or STM32G0 (via ST-Link SWD or USB DFU) to install firmware built from source.
Instructions
[ESP HW | STM HW] Flash firmware to a connected CrossPad device. target='esp' (default) → ESP32-S3 firmware (requires prior crosspad_build platform=idf): • transport='uart' uses idf.py flash (device must be in bootloader mode). • transport='ota' uses platform-idf/tools/ota_flash.py over USB CDC (no bootloader mode required). Works on both CrossPad generations: rev <2.0 (ESP native USB) and rev 2.0 (port is the STM32 CDC bridge — STM emulates the esptool DTR/RTS auto-reset and forwards the flash to the ESP over LPUART2; rev-2.0 STM must be in passthrough mode, i.e. NOT booted with pad-4 held). target='stm' → STM32G0 firmware via STM32_Programmer_CLI (requires prior crosspad_build platform=stm): • method='swd' flashes over ST-Link (SWD). • method='dfu' flashes the USB DFU bootloader (board in ST system memory — hold pad 1 at boot or trigger boot_request_dfu). Flasher resolved from config (stm_programmer_cli) → $STM32_PROG → PATH.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | Serial port path (e.g. /dev/ttyACM0, COM3). Auto-detected if omitted; required when multiple devices connected. | |
| method | No | STM only. 'swd' = ST-Link/SWD; 'dfu' = USB DFU system bootloader. | |
| target | No | 'esp' = ESP32-S3 (transport uart/ota); 'stm' = STM32G0 firmware via STM32_Programmer_CLI (method swd/dfu). | esp |
| transport | No | ESP only. 'uart' = bootloader-mode flash via idf.py; 'ota' = USB-CDC OTA flash via ota_flash.py. | |
| build_type | No | STM only. Selects the build/<preset> dir for the default firmware binary. Defaults to Debug. | |
| firmware_path | No | Custom firmware binary path. ESP: OTA only, defaults to <idf-root>/build/CrossPad.bin. STM: defaults to <stm-root>/build/<preset>/CrossPad_STM32_r20.bin. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | ||
| error | No | ||
| method | Yes | ||
| success | Yes | ||
| programmer | No | ||
| output_tail | Yes | ||
| firmware_path | No | ||
| duration_seconds | Yes |