flasher-0.1.1 is not a library.
Teensy Flasher
cross-platform CLI tool for flashing firmware onto Teensy 4.0/4.1 microcontrollers via USB
usage
# flash firmware (device must be in bootloader mode)
# wait for device to appear, then flash
# wait with custom timeout (default 30s)
# list devices in bootloader mode (prints serial numbers)
exit codes: 0 success, 1 error
build
platform setup
Linux
|
&&
macOS
no setup required
Windows
no setup required for HID devices
entering bootloader mode
- press the button on the Teensy board
- LED should blink slowly
- run
flasher listto confirm detection
technical details
uses the HalfKay bootloader protocol over USB HID (hidapi):
- packet: 1 byte report ID + 64 byte header + 1024 byte data = 1089 bytes
- header: 24-bit LE address in bytes 0-2, rest zero
- boot: address bytes set to 0xFF, rest zero
- first block triggers chip erase (45s timeout)
- subsequent blocks: 500ms timeout
- automatic retry with device reopen on broken pipe
development
the vendored blink-test.hex blinks the LED in a 3-fast-blink pattern.
source: test-firmware/src/main.cpp.