Working with the STM32L4A6ZG microcontroller via the Nucleo-L4A6ZG.
- Install Rust. It must be installed using
rustup. - Install the required dependencies for embedded rust development.
rustup update
rustup target add thumbv7em-none-eabihf
rustup component add llvm-tools
cargo install cargo-binutils probe-rs-tools cargo-expand- Open this repo in VS Code.
- To flash and run the firmware, run
cargo embedfrom the root of this repo, with the Nucleo-L4A6ZG plugged in. - Observe logs coming from the STM32. Observe the green onboard LED blinking.
- Main guide: https://www.makerspace-online.com/make-your-microcontroller-apps-safe-and-secure-with-rust-2/
- User Manual: https://www.st.com/resource/en/user_manual/um2179-stm32-nucleo144-boards-mb1312-stmicroelectronics.pdf
- Maybe good: https://www.anyleaf.org/blog/writing-embedded-firmware-using-rust
- Could give this one a try: https://github.com/David-OConnor/stm32-hal
- LD1 = PC7 (Green LED)
- LD2 = PB7 (Blue LED)
- LD3 = PB14 (Red LED)
- USART2 TX = PA2 or PD5
- USART2 RX = PA3 or PD6
- PG7 = LPUART1 TX (via ST-LINK)
- PG8 = LPUART1 RX (via ST-LINK)
- Create two separate crates in a repo, and put as much testable logic as possible in the other platform-independent crate.
- E.g., command parsing, the command list, etc. goes in that crate.
- Consider adding defmt logging: https://github.com/knurling-rs/defmt