From d88f01d68630406a0b86a289941d161430ccc8b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mali=C5=A1a=20Vu=C4=8Dini=C4=87?= Date: Thu, 5 Oct 2023 17:09:07 +0200 Subject: [PATCH] Add default features to edhoc-rs-no_std example and update README.md --- README.md | 9 +++++---- examples/edhoc-rs-no_std/Cargo.toml | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4d43a8cb..ad44c14a 100644 --- a/README.md +++ b/README.md @@ -46,16 +46,17 @@ To build an example application that works on the [nrf52840dk](https://www.nordi # head to the example `no_std` example cd ./examples/edhoc-rs-no_std +# build using the cryptocell310 crypto backend (hardware-accelerated) +cargo build --target="thumbv7em-none-eabihf" --release + # build using the psa crypto backend (software-based) -cargo build --target="thumbv7em-none-eabihf" --no-default-features --features="crypto-psa, rtt" --release +cargo build --target="thumbv7em-none-eabihf" --no-default-features --features="crypto-psa, ead-none, rtt" --release -# build using the cryptocell310 crypto backend (hardware-accelerated) -cargo build --target="thumbv7em-none-eabihf" --no-default-features --features="crypto-cryptocell310, rtt" ``` To build **and** flash to the board, replace the word `build` with `embed` in the commands above (you may need to `cargo install cargo-embed`). -For example: `cargo embed --target="thumbv7em-none-eabihf" --no-default-features --features="cryptocell310, rtt"` +For example: `cargo embed --target="thumbv7em-none-eabihf" --no-default-features --features="crypto-psa, ead-none, rtt"` ## Directory structure This library is structured as a Workspace, a feature from Cargo which makes it easy to manage more than one package / application in the same repository. Here are its the main folders: diff --git a/examples/edhoc-rs-no_std/Cargo.toml b/examples/edhoc-rs-no_std/Cargo.toml index ee4245b6..99fac08e 100644 --- a/examples/edhoc-rs-no_std/Cargo.toml +++ b/examples/edhoc-rs-no_std/Cargo.toml @@ -20,7 +20,7 @@ panic-semihosting = { version = "0.6.0", features = ["exit"] } rtt-target = { version = "0.3.1", features = ["cortex-m"] } [features] -default = [ ] +default = [ "rtt", "crypto-cryptocell310", "ead-none" ] rtt = [ ] crypto-psa = [ "edhoc-rs/crypto-psa-baremetal" ] crypto-cryptocell310 = [ "edhoc-rs/crypto-cryptocell310" ]