Embedded rust example for WeAct STM32F411 MiniF4.
This uses a fork of the funksteckdose
crate (forked to enable no_std
) and
a fork of the cc1101
crate (forked to allow transmitting).
The application toggles an rc switch when the user key is pressed.
funksteckose
is a partial reimplementation of rc-switch
,
so for more details see [https://github.com/sui77/rc-switch].
cc1101 module is connected over SPI (pins A7 to A4) and GDO0 (pin A3). GDO0 is used to transmit data in asynchronous mode/compatibility mode - this lets the c1101 module be used in the same way as more common, simpler modules.
rust target
$ rustup target install thumbv7em-none-eabihf
cargo-binutils
$ cargo install cargo-binutils
$ rustup component add llvm-tools-preview
dfu-util
$ brew install dfu-util
$ cargo objcopy --release -- -O binary out.bin
Flashing with dfu requires the following procedure.
- Disconnect board from USB C.
- Short A9 and A10 (You can leave these connected).
- Connect USB C to board.
- Press BOOT0, NRST.
- Release NRST, wait 500ms, Release BOOT0.
- Flash with dfu-util with the following command.
$ dfu-util -a0 -s 0x08000000 -D out.bin
Using the ST-link with probe-run to flash and run with cargo run
.
$ brew install libftdi
$ cargo install cargo-flash
$ cargo install probe-run
probe-run is already set as the default cargo runner - just run cargo run
.