|
|
||
|---|---|---|
| .cargo | ||
| .vscode | ||
| examples | ||
| imgs | ||
| src | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| Embed.toml | ||
| LICENSE | ||
| memory.x | ||
| openocd.cfg | ||
| openocd.gdb | ||
| README.EN.md | ||
| README.md | ||
stm32-rustup
A guide about rustup your stm32 mcu.
WIP
Why use Rust
Rust as a new-generation programming language has a lot of modern features than C and C++. Means that using Rust has a better experience.
And Rust has a great variety crates in no_std.
As Rust has a lot of modern features, it's possible to transplant your code to other type of chips, even other target such as RISC-V and AVR.
See Transplant
well done !
Try out
IDE
I'm using VSCode, and install these extensions:
- crates
- rust-analyzer
NOTE: bug fixed. Use latest version, at least
0.2.441. there is a bug in the newest version ofrust-analyzer, which can NOT parse macro properly, before the bug fixed, please use version0.2.400instead.newest version now:
0.2.408
device
my device is a STM32F429IGT6 chip and other peripherals which I'll introduce in Section resource
As using Rust, you do not have to use a same board even a same target (ARM), you can try the examples use your own device.
Oh, and a ST-Link debugger and TTL-Serial transformer and two usb cable
Resource
The resource used in examples
High-Speed-External : 25MHz
- PB0 - A green LED
- PB1 - A red LED
- PA0 - WK_UP
- PC13 - key
- PH2 - key
- PH3 - key
Transplant
If you want to try out the examples in your device
- according to your device's manufacture, edit the memory layout
memory.x - fix the dependencies in
cargo.toml - redeclare pins in examples
And if you want try in another architecture chip
- edit anything about target in
.cargo/config - edit
cargo.tomlto add crates about HAL, PAC - Optionally, edit
.vscode/settings.jsonto make vscode check your code correctly
Read More
- Lib.rs you can find a lot `no_std' crates here
- crates.io
- awesome-embedded-rust you can find a lot crates about embedded, such as hardware driver, HAL, PAC.
Q&A
I'm also a noob.
So just open an issue, and I'll try my best to answer.
Give me a star to let me know this repo helps you and encourage me to do more.
Author
@Logiase
