Open firmware for USB to CAN adapters
ferrocan is gs_usb firmware in Rust for STM32-based adapters. It speaks the protocol of candleLight and Linux's gs_usb driver, so SocketCAN works with it out of the box.
Adapters
| Adapter | Chip | CAN | Image |
|---|---|---|---|
| DSD TECH SH-C30A, SH-C30G | STM32F072 (bxCAN) | Classic CAN | sh-c30 |
| DSD TECH SH-C31A | STM32G431 (FDCAN) | CAN FD | sh-c31 |
What it does
- Echoes a frame once it's on the bus: acknowledged, not merely queued, and in bus order with the frames received.
- Reports the bus as candleLight does: error warning, error passive, bus-off and its automatic restart, with the error counters, and each bus error when asked.
- Starts clean: every session begins as from power-on, with no frames or counts left from the last.
- Reflashes without opening the case: the host can restart it in ST's ROM bootloader over USB.
- Tells a host why a frame wasn't sent, for hosts that ask (an extension Linux doesn't use): given up, bus-off, aborted, lost arbitration or an error; and can withdraw a pending frame.
Installing it
In Chrome or Edge, flash it from this site: plug the adapter in, pick it, and the flasher restarts it in its bootloader, saves the firmware it had, writes ferrocan, checks it and starts it.
Elsewhere, use dfu-util and the images of a release; the repository's scripts/flash.sh does the same steps.
Checking an image
Each release lists the SHA-256 of every file, and its images carry signed build provenance from GitHub Actions:
gh attestation verify ferrocan-0.1.0-sh-c30.bin -R ferrocan/ferrocan
The images are reproducible: scripts/release.sh, with the toolchain and dependencies the repository pins, builds the same bytes on any machine.