https://github.com/gdamjan/rust-embedded-intro
My Playground for the nrf5340-dk devkit and Rust
https://github.com/gdamjan/rust-embedded-intro
arm demo embedded nrf nrf53 rust
Last synced: about 2 months ago
JSON representation
My Playground for the nrf5340-dk devkit and Rust
- Host: GitHub
- URL: https://github.com/gdamjan/rust-embedded-intro
- Owner: gdamjan
- License: mit
- Created: 2024-05-17T17:58:39.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-26T01:42:27.000Z (6 months ago)
- Last Synced: 2025-02-09T21:23:27.440Z (4 months ago)
- Topics: arm, demo, embedded, nrf, nrf53, rust
- Language: Rust
- Homepage:
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `Rust Embedded Intro`
Using the [`nrf8340-dk`](https://www.nordicsemi.com/Products/Development-hardware/nrf5340-dk)
board based on Cortex-M33 with the `thumbv8m.main-none-eabihf` ISA, with 1MB Flash and 256K RAM.
## Preparation
- [`rustup`](https://rustup.rs/) - is recommended to install rust and its components
- `cargo install cargo-binutils` - for `cargo size` and `cargo objdump -- --disassemble`, etc…
- `cargo install probe-rs-tools` - flash and debug using the [`probe-rs project`](https://probe.rs/)## Examples
- `cargo embed --example rtt` - build, flash and open the rtt [debugger/monitor](https://probe.rs/docs/tools/cargo-embed/)
- `cargo embed --example embassy` - [embassy](https://embassy.dev/) demo with 2 concurent tasks, blinking 2 LEDs## VS Code settings
The repo will also suggest common extensions for VS Code:
- [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)
- [crates helper](https://marketplace.visualstudio.com/items?itemName=serayuzgur.crates)and some settings to instruct rust-analyzer to only run for the `thumbv8m.main-none-eabihf` target.
## Infrastructure files
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](https://doc.rust-lang.org/cargo/index.html).
Dependencies are specified here.
- `rust-toolchain.toml` - [rustup overrides](https://rust-lang.github.io/rustup/overrides.html).
Make sure we use `stable` rust, and have the `thumbv8m.main-none-eabihf` target, and the `llvm-tools` component.
- `memory.x` - the [memory layout](https://docs.rs/cortex-m-rt/latest/cortex_m_rt/#memoryx) of the nRF5340/Cortex-M33 core.
- [`.cargo/config.toml`](https://doc.rust-lang.org/cargo/reference/config.html) - this sets the default build target (`thumbv8m.main-none-eabihf`).
- [`build.rs`](https://doc.rust-lang.org/cargo/reference/build-scripts.html) - linker flags, track changes to memory.x.
- `Embed.toml` - [cargo-embed](https://probe.rs/docs/tools/cargo-embed/#configuration) config file. Specifies the chip,
and enables rtt.