An embedded rust template for the STM32F4xx Black Pill Board
You need to have a stable version of rust
installed. Make sure your version is > 1.6
rustup --version
You need to install some tools and the correct target:
rustup target add thumbv7em-none-eabihf
Install cargo-generate
to generate a project from this template
cargo install cargo-generate
Install cargo flash
and embed
utility to flash or debug your program
cargo install cargo-flash
cargo install cargo-embed
Generate a project with this template:
cargo generate --git https://github.com/EXXETA/stm32f4-blackpill-quickstart.git
Give your project a name and cd
into it:
cd my-app
Build it
cargo build --release
Flash it:
cargo flash --release --chip STM32F401CEUx
Or build and flash the example:
cargo flash --example dht22 --chip STM32F401CEUx
You might need to change the chip STM32F401CEUx
to your used chip, if you use a different board or chip.
You can debug it by starting a debug session on your chip
cargo embed --release
And in another terminal start gdb
& arm-none-eabi-gdb target/thumbv7em-none-eabihf/debug/hydroponic-stm32f4
& (gdb) target remote :1337
& (gdb) continue
This template includes launch configurations for debugging CortexM programs with Visual Studio Code located in
the .vscode/
directory.
See .vscode/README.md for more information.
If you're not using VS Code, you can safely delete the directory from the generated project.
This template is 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.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.