Getting rust to work an the Blue Pill stm32 board
- The embedded rust book
- blue pill wiki page
- rust core basics
- embedded rust project and link collection
- gdb commands
- ARM instruction set
- rust blue pill setup instructions and helpful pages
- (want to read)
- openocd docu
- https://medium.com/@ly.lee/hosting-embedded-rust-apps-on-apache-mynewt-with-stm32-blue-pill-c86b119fe5f
- rust os how to
- blue pill peripherals crate https://crates.io/crates/stm32f103xx
- stm32f1 crate https://github.com/stm32-rs/stm32-rs
- blue pill hal crate https://crates.io/crates/stm32f1xx-hal
- data sheet
- reference manual
- flash programming manual
- bootloader notes
- start of flash 0x0800_0000
- start of sram 0x2000_0000
sudo apt install \
gdb-multiarch \
openocd \
qemu-system-arm
Create file /etc/udev/rules.d/70-st-link.rules
for permissions with this content:
# STM32F3DISCOVERY rev A/B - ST-LINK/V2\
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3748", TAG+="uaccess"\
\
# STM32F3DISCOVERY rev C+ - ST-LINK/V2-1\
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", TAG+="uaccess"\
Update:
sudo udevadm control --reload-rules
- connect both Boot Jumper to 0
Install toolchain
rustup target add thumbv7m-none-eabi
Install cargo-binutils
cargo install cargo-binutils
rustup component add llvm-tools-preview
Setup Cargo
cargo init --bin --edition 2018
get the cortex m quick-start files like described in the embedded rust book
https://github.com/rust-embedded/cortex-m-quickstart/blob/master/
Build binary
cargo build --target thumbv7m-none-eabi
Test build
cargo readobj --bin embeddedRust --target thumbv7m-none-eabi -- -file-headers
Size of linker sections
cargo size --bin embeddedRust --target thumbv7m-none-eabi --release -- -A