From e702d93c73e20672c22aa264e42a6f7efb4703a7 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Tue, 17 Oct 2023 11:10:17 +0200 Subject: [PATCH] doc: update README.md with embassy in mind --- README.md | 42 ++++++++++++------------------------------ doc/build_system.md | 12 +++++++----- 2 files changed, 19 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 2a091f9fe..61c6293dc 100644 --- a/README.md +++ b/README.md @@ -27,12 +27,9 @@ This currently only supports the Nordic nrf52840dk. ## Status -This project currently allows to build a RIOT application with an embedded Rust -based rt+linking. In addition, it provides a Rust rewrite of RIOT's "core" module, -providing API compatible implementations of RIOT's scheduler, mutexes, thread flags, -msg and mbox. -[riot-wrappers](https://gitlab.com/etonomy/riot-wrappers) are integrated for -developing applications using Rust, though this has not been used / tested much. +The current iteration of RIOT-rs combines [embassy](https://embassy.dev/) with +a preemptive scheduler and adds some integration and build system work. +It's highly experimental, expect frequent changes and breakage. ## Quickstart @@ -50,31 +47,16 @@ Assuming you have a Nordic nrf52840dk connected, this should get you somewhere: 1. install [laze](https://github.com/kaspar030/laze): `cargo install laze` -1. clone this repository and cd into it - -1. set up RIOT-rs toolchain - - laze task install-toolchain - laze task install-c2rust - laze task clone-riot - -### Flash some example +1. install [probe-rs](https://github.com/probe-rs/probe-rs): `cargo install probe-rs --features cli` + (2023-10-17: if that fails, try from git: `cargo install --git https://github.com/probe-rs/probe-rs --features cli`) -1. Compile and flash the bottles example - - laze -C examples/bottles task -b nrf52840dk flash - -1. in another window, run a terminal program of your choice to watch the - nrf52840dk's serial output - -## Building RIOT C applications with RIOT-rs +1. clone this repository and cd into it -It is possible to build any RIOT application using RIOT-rs and its core -implementation, using `examples/riot-app`: +### Run some example - laze -Cexamples/riot-app task -b nrf52840dk -a riot-app -DRIOT_APP=foo/bar flash +1. Compile, flash and the hello-world example using `probe-rs run` -See the [riot-app docs](examples/riot-app/README.md) for more information. + laze -C examples/hello-world build -b nrf52840dk -s probe-rs-run run ## More information @@ -94,10 +76,10 @@ RIOT-rs is licensed under either of at your option. -RIOT-rs links with many components of [RIOT OS](https://github.com/RIOT-OS/RIOT), -which is licenced under the terms of LGPLv2.1. +~~RIOT-rs links with many components of [RIOT OS](https://github.com/RIOT-OS/RIOT), +which is licenced under the terms of LGPLv2.1.~~ -Copyright (C) 2020 Freie Universität Berlin, Inria, Kaspar Schleiser +Copyright (C) 2020-2023 Freie Universität Berlin, Inria, Kaspar Schleiser ## Contribution diff --git a/doc/build_system.md b/doc/build_system.md index 7cc3270ae..9312812fe 100644 --- a/doc/build_system.md +++ b/doc/build_system.md @@ -11,10 +11,10 @@ laze commands are applied to the application(s) within the subfolder laze is cal For example, when called in `examples/hello-world`, `laze build -b nrf52840dk` would build the hello-world example for nrf52840dk. -laze tasks currently have the syntax `laze task -b [other options] `. +laze tasks currently have the syntax `laze build -b [other options] `. E.g., to flash the bottles example, the command would be (when in `examples/bottles`): - laze task -b nrf52840dk flash + laze build -b nrf52840dk flash Laze allows enabling/disabling features using "modules", which can be selected or disabled using `--select ` or `--disable >`. @@ -23,11 +23,13 @@ Laze also allows to override global variables using e.g., `-DFOO=BAR`. Note: all tasks and build need to be called with the same set of arguments (`--select`, `--disable`, `-D...`). -A `laze task -DFOO=1 flash` followed by `laze task -DFOO=other debug` might not +A `laze build -DFOO=1 flash` followed by `laze build -DFOO=other debug` might not work. ## Laze tasks +2023-10-14 Note: this is probably outdated + - `flash` -> compiles (if needed) and flashes an application - `flash-riotboot` -> same as flash, but flashes to riotboot slot 0 (first slot) This needs the "riotboot" feature to be enabled. e.g., @@ -50,8 +52,8 @@ This is an non-exhaustive list of modules that can be used. E.g., to start a debug session with all semihosting and panic output enabled, run - laze task -b --disable release flash - laze task -b --disable release debug + laze build -b --disable release flash + laze build -b --disable release debug - `release`: used by default. Selects `no-semihosting` and `silent-panic` - `no-semihosting`: turn off RIOT-rs debug output