Skip to content

Latest commit

 

History

History
51 lines (34 loc) · 895 Bytes

README.md

File metadata and controls

51 lines (34 loc) · 895 Bytes

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!