Skip to content

Commit

Permalink
doc: update README.md with embassy in mind
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspar030 committed Oct 17, 2023
1 parent 8d07861 commit e702d93
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 35 deletions.
42 changes: 12 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand Down
12 changes: 7 additions & 5 deletions doc/build_system.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <board> [other options] <task-name>`.
laze tasks currently have the syntax `laze build -b <board> [other options] <task-name>`.
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 <module>` or `--disable <module>>`.
Expand All @@ -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.,
Expand All @@ -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 <board> --disable release flash
laze task -b <board> --disable release debug
laze build -b <board> --disable release flash
laze build -b <board> --disable release debug

- `release`: used by default. Selects `no-semihosting` and `silent-panic`
- `no-semihosting`: turn off RIOT-rs debug output
Expand Down

0 comments on commit e702d93

Please sign in to comment.