Async runtime for embedded rust and access to resources that are based on the embedded-hal crate
Getting rust to work an the Blue Pill stm32 board
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
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