Adapters

Better ScooterFlasher talks to hardware exclusively through OpenOCD. Install a system OpenOCD (openocd on PATH) — check with scooterflasher doctor.

Voltage warning: all documented targets in this project use 3.3V SWD signaling. Do not connect a 5V-signaling adapter/probe directly; use a level shifter or a 3.3V-native adapter. Better ScooterFlasher does not detect or adjust target voltage — verify your wiring against the scooter's documentation before connecting.

Every probe/backup/plan/flash/verify/restore command accepts the same adapter flags: --adapter, --adapter-serial, --clock-khz, --gpio-chip, --gpio-swdio, --gpio-swclk, --gpio-reset, --custom-interface-cfg. Unset flags fall back to the values in settings.json (see scooterflasher.config.settings.Settings).

Uses OpenOCD's stock interface/stlink.cfg. This was the original's only supported adapter. Implemented and covered by tests against a fake subprocess; not hardware-verified — see support-matrix.md.

Permissions on Linux: add a udev rule granting your user access to the ST-Link's USB device (distribution-dependent; OpenOCD's own udev rules package usually covers this), or run as a user in the appropriate group (often plugdev).

Use OpenOCD's stock interface/cmsis-dap.cfg / interface/jlink.cfg. Same permission considerations as ST-Link. Not hardware-verified.

--adapter raspberrypi-gpio

Bit-banged SWD through the Raspberry Pi's native GPIO header via OpenOCD's linuxgpiod driver — no external probe needed. Ported from better-scooterflasher-fork commit 10e16e2. Defaults (all overridable via flags):

SettingDefaultFlag
GPIO chip0 (/dev/gpiochip0)--gpio-chip
SWDIOGPIO22--gpio-swdio
SWCLKGPIO23--gpio-swclk
SRSTnot wired (reset_config none)--gpio-reset

Wiring (BCM numbering)

SignalRaspberry Pi GPIO
SWDIOGPIO22 (default; --gpio-swdio to change)
SWCLKGPIO23 (default; --gpio-swclk to change)
GNDany GND pin
SRSToptional; pass --gpio-reset <pin> if wired, otherwise OpenOCD uses a software reset

Permissions

linuxgpiod needs access to /dev/gpiochipN. Either run as root, or add your user to the gpio group (sudo usermod -aG gpio $USER, then log out and back in) and ensure udev grants that group access to /dev/gpiochip* (commonly already the case on Raspberry Pi OS; verify with ls -l /dev/gpiochip0).

Barely hardware-verified — unit-tested against a fake subprocess (checking the exact generated -c/-f OpenOCD commands), with one informal report of a working ESC flash on a real scooter.

--adapter custom

Pass --custom-interface-cfg /path/to/your.cfg for any OpenOCD interface configuration not covered above (e.g. a different GPIO pin mapping needing extra Tcl beyond what --gpio-* flags cover, or a probe with no stock config).

Clock speed

--clock-khz maps to OpenOCD's adapter speed <kHz>. Leave unset to use OpenOCD's/the interface config's default. Higher speeds may be unreliable over long or unshielded wiring — if you see intermittent connection or verification failures, try lowering it before assuming a hardware fault.