cargo-flash
cargo-flash copied to clipboard
Add DFU support for USB and RS232
Most ARM microcontroller have a DFU bootloader over USB or USART. It would be great if cargo-flash would support this.
With DFU you would be able to flash a controller without the need for extra hardware.
Seconding this, I possess a Blue Pill (STM32F103C8T6) with a DFU bootloader, which I flashed on using a cheap FTDI breakout clone. Purchasing an ST-Link/J-Link is not an option for me, unfortunately, so being able to program it with cargo flash
with no extra hardware would be nice.
I believe this would be implemented as a probe in probe-rs? I'm not familiar with the internals, but I'd like to try to tackle this as it affects me too.
Hi folks!
It would certainly be cool to have this possibility in cargo-flash :) It is NOT possible to implement a probe for this in probe-rs currently, as DFU really is no probe.
Maybe we could make a new crate which is specifically tailored to DFU.
Maybe @Tiwalun has some ideas too :)
We'll definitely be here answering questions if you have any!
As an alternative solution, one can set a runner
parameter in .cargo/config
to point it to a custom script which runs objcopy and dfu-util to program the chip. This runner is triggered by cargo run
.
Here is the example (not for DFU, but almost the same) to get the idea: .cargo/config, flash.sh.