Skip to content

jasonlmfong/rustM32

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rustM32

Rust program on the STM32

prerequisites

install rust prerequisites:

rustup update
rustup target install thumbv7m-none-eabi
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/probe-rs/probe-rs/releases/latest/download/probe-rs-tools-installer.sh | sh

install linux prerequisites:

sudo apt install binutils-arm-none-eabi
sudo apt install stlink-tools

how to run

Clone the repository:

git clone https://github.com/jasonlmfong/rustM32.git
cd rustM32

Compile the code:

cargo rustc --target thumbv7m-none-eabi --release -- -C link-arg=-Tlink.x

you should see the ELF file target/thumbv7m-none-eabi/release/rustM32 created.

Build the binary:

arm-none-eabi-objcopy -O binary target/thumbv7m-none-eabi/release/rustM32 rustM32.bin

Flash the binary

st-flash write rustM32.bin 0x8000000

Ta-da!

About

STM32 MCU code in Rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published