** Always make sure your submodules are up to date:
git submodule update --init --recursive
-
Install the latest version of the Xcode development environment from the macOS App Store.
-
Install Rust according to the official instructions.
curl https://sh.rustup.rs -sSf | sh
- Add Rust to your
PATH
environment variable.
source $HOME/.cargo/env
- Install the toolchain for the embedded target:
rustup target install thumbv7em-none-eabihf
- Install ARM cross-compiler toolchain
brew tap ArmMbed/homebrew-formulae
brew install arm-none-eabi-gcc
- Install the ST-LINK utilities
brew install stlink
- Open the Xcode project
simulator/RustAnywhere.xcodeproj
- Choose the menu item Product -> Run
Install the Rust plugin for Xcode to easily enable breakpoints in Rust files: https://github.com/mtak-/rust-xcode-plugin
From the device
subdirectory, run make
.
- In another terminal window, run
st-util
. You must leave this running to deploy and debug your code usinggdb
- Run GDB with the ELF binary:
arm-none-eabi-gdb build/bin/rust-anywhere.elf
- From the GDB prompt, connect to the remote target
tar ext :4242
- Load the binary and start execution:
load
continue