rustup self update
rustup updatehttps://rust-lang.github.io/rustup/concepts/components.html#components
rustup toolchain install stable --component rust-srcESP devices
cargo install espup --locked
espup install
# Either of
# 1. build with sources
cargo install esp-generate --locked
# 2. get the binaries
cargo-binstall esp-generate --locked
# Either of:
cargo install espflash --locked
cargo binstall espflash
# Optional: esp-config is a tool to edit configuration options via a TUI.
cargo install esp-config --features=tui --lockedFind the device's arch here: https://doc.rust-lang.org/nightly/rustc/platform-support.html
# Microbit v2
rustup target add thumbv7em-none-eabi
# ESP32 RISC-V
# For ESP32-C2 and ESP32-C3
rustup target add riscv32imc-unknown-none-elf
# For ESP32-C6 and ESP32-H2
rustup target add riscv32imac-unknown-none-elf
# Additional tools
rustup component add llvm-tools
cargo install cargo-binutils
# For build and sending to board
cargo install cargo-embedInstall probe-rs: https://probe.rs/docs/getting-started/installation/
cargo new project_name
cd project_name
cargo check
cargo buildhttps://crates.io/search?q=cortex-m-rt https://crates.io/crates/riscv https://crates.io/crates/esp-hal
Microbit only:
# https://docs.rs/cortex-m-rt/latest/cortex_m_rt/#memoryx
touch memory.xMEMORY
{
FLASH : ORIGIN = 0x00000000, LENGTH = 512K
RAM : ORIGIN = 0x20000000, LENGTH = 128K
}mkdir .cargo
touch .cargo/config.toml# Also add `use panic_halt as _;`
cargo add panic_halt
cargo build
# Display size/memory details
cargo size -- -Ax
cargo readobj -- -h# cargo-embed is now in probe-rs
# https://probe.rs/docs/tools/cargo-embed/
probe-rs chip listcargo embed --chip nRF52833_xxAA# https://crates.io/crates/embedded-hal
cargo add embedded_hal
# Check out microbit-v2 & microbit-common# https://probe.rs/docs/tools/cargo-embed/
touch Embed.tomlcargo add cortex_m --features critical-section-single-core
cargo add rtt-target
cargo build
cargo embed
sudo apt install gdb-multiarch