-
You must have a working Rust compiler installed. Visit rustup.rs to install Rust.
-
Your Rust toolchain needs the
thumbv6m-none-eabi
target installed:
rustup target add thumbv6m-none-eabi
Once Rust is installed, use Cargo to build:
cargo build --release
The resulting binary is an ELF file in
target/thumbv6m-none-eabi/release/ffp_firmware
which can be programmed via
your usual programmer, or see below for generating a raw binary file and
bootloading over USB.
You can reprogram the FFP using its built-in USB bootloader. You can use dfu-util or STM32CubeProg to perform the bootloading, both of which are available for Linux, MacOS, and Windows.
To generate a binary file suitable for bootloading with dfu-util:
cargo build --release
arm-none-eabi-objcopy -O binary -S target/thumbv6m-none-eabi/release/ffp_firmware ffp.bin
STM32CubeProg can load data directly from the ELF file, but only if it has a
.elf
extension. Simply copy the elf file:
cp target/thumbv6m-none-eabi/release/ffp_firmware ffp_firmware.elf
To put an already-programmed FFP device into bootload mode:
ffp bootload
Devices which have a totally erased flash will come up in bootloader mode automatically.
To bootload using dfu-util:
dfu-suffix -a ffp.bin -v 0483 -p df11
dfu-util -a 0 -s 0x08000000 -D ffp.bin
To bootload using STM32CubeProg, open the ffp_firmware.elf
file made above,
and download it to the FFP.
Reconnect the device after programming to load new firmware.
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0 )
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT )
at your option.