Using the nrf8340-dk
board based on Cortex-M33 with the thumbv8m.main-none-eabihf ISA, with 1MB Flash and 256K RAM.
rustup- is recommended to install rust and its componentscargo install cargo-binutils- forcargo sizeandcargo objdump -- --disassemble, etc…cargo install probe-rs-tools- flash and debug using theprobe-rs project
cargo embed --example rtt- build, flash and open the rtt debugger/monitorcargo embed --example embassy- embassy demo with 2 concurent tasks, blinking 2 LEDs
The repo will also suggest common extensions for VS Code:
and some settings to instruct rust-analyzer to only run for the thumbv8m.main-none-eabihf target.
Apart from the rust source code files, the following files are involved in the build and debug process:
Cargo.toml,Cargo.lock- Cargo is the Rust package manager. Dependencies are specified here.rust-toolchain.toml- rustup overrides. Make sure we usestablerust, and have thethumbv8m.main-none-eabihftarget, and thellvm-toolscomponent.memory.x- the memory layout of the nRF5340/Cortex-M33 core..cargo/config.toml- this sets the default build target (thumbv8m.main-none-eabihf).build.rs- linker flags, track changes to memory.x.Embed.toml- cargo-embed config file. Specifies the chip, and enables rtt.
