Skip to content

Async runtime for embedded rust and access to resources that are based on the embedded-hal crate

License

Notifications You must be signed in to change notification settings

Skasselbard/embeddedRust

Repository files navigation

Rust on ARM

Embedded Rust

Getting rust to work an the Blue Pill stm32 board

Links

crates

Board specs

Steps Done

Install bootloader with Stlink (probably incomplete)

  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

Debug with ST-Link

  • connect both Boot Jumper to 0

setup rust

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

About

Async runtime for embedded rust and access to resources that are based on the embedded-hal crate

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages