https://github.com/cnfatal/stm32-rust
rust embedded example on stm32f103c8t6
https://github.com/cnfatal/stm32-rust
Last synced: about 1 month ago
JSON representation
rust embedded example on stm32f103c8t6
- Host: GitHub
- URL: https://github.com/cnfatal/stm32-rust
- Owner: cnfatal
- Created: 2022-04-28T14:41:45.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-28T14:42:32.000Z (about 4 years ago)
- Last Synced: 2025-01-08T07:25:44.673Z (over 1 year ago)
- Language: Rust
- Size: 53.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# stm32-led
simple led light control write on rust,run on stm32f103c8t6.
for more rust embedded infomation check [the embedded Rust book][book].
[book]: https://rust-embedded.github.io/book
## Build&Flash
```sh
cargo build
cargo objcopy --bin stm32-led --release -- -O binary boot.bin
sudo stm32flash -i '-dtr&rts,dtr&rts' -w boot.bin -v -g 0x0 /dev/cu.usbserial-10
```
## Debug
```sh
openocd -f interface/cmsis-dap.cfg -f target/stm32f1x.cfg -c 'transport select swd'
```
## Dependencies
### openocd
```sh
LIBUSB1_CFLAGS=$(pkg-config --cflags libusb) LIBUSB1_LIBS=$(pkg-config --libs libusb) CAPSTONE_CFLAGS=$(pkg-config --cflags capstone) CAPSTONE_LIBS=$(pkg-config --libs capstone)
```
To build embedded programs using this template you'll need:
- latest rust toolchain
- `rust-std` components (pre-compiled `core` crate) for the ARM Cortex-M targets. Run:
```console
rustup target add thumbv6m-none-eabi thumbv7m-none-eabi thumbv7em-none-eabi thumbv7em-none-eabihf
```
## VS Code
This template includes launch configurations for debugging CortexM programs with Visual Studio Code located in the `.vscode/` directory.
See [.vscode/README.md](./.vscode/README.md) for more information.
If you're not using VS Code, you can safely delete the directory from the generated project.