项目作者: Skasselbard

项目描述 :
Async runtime for embedded rust and access to resources that are based on the embedded-hal crate
高级语言: Rust
项目地址: git://github.com/Skasselbard/embeddedRust.git
创建时间: 2019-01-30T14:59:06Z
项目社区:https://github.com/Skasselbard/embeddedRust

开源协议:GNU General Public License v3.0

下载


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)

  1. sudo apt install \
  2. gdb-multiarch \
  3. openocd \
  4. qemu-system-arm

Create file /etc/udev/rules.d/70-st-link.rules for permissions with this content:

  1. # STM32F3DISCOVERY rev A/B - ST-LINK/V2\
  2. ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3748", TAG+="uaccess"\
  3. \
  4. # STM32F3DISCOVERY rev C+ - ST-LINK/V2-1\
  5. ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", TAG+="uaccess"\

Update:

  1. sudo udevadm control --reload-rules
  • connect both Boot Jumper to 0

setup rust

Install toolchain

  1. rustup target add thumbv7m-none-eabi

Install cargo-binutils

  1. cargo install cargo-binutils
  2. rustup component add llvm-tools-preview

Setup Cargo

  1. 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

  1. cargo build --target thumbv7m-none-eabi

Test build

  1. cargo readobj --bin embeddedRust --target thumbv7m-none-eabi -- -file-headers

Size of linker sections

  1. cargo size --bin embeddedRust --target thumbv7m-none-eabi --release -- -A