From fbda1d9c2a818e009c8ff9f8a49c02d0c00475ce Mon Sep 17 00:00:00 2001 From: Mirabellensaft Date: Tue, 21 Mar 2023 19:13:34 +0100 Subject: [PATCH] fixing issue with form, rm download link --- embedded-workshop-book/src/generating-pac.md | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/embedded-workshop-book/src/generating-pac.md b/embedded-workshop-book/src/generating-pac.md index 936fb02..5cdff32 100644 --- a/embedded-workshop-book/src/generating-pac.md +++ b/embedded-workshop-book/src/generating-pac.md @@ -13,8 +13,7 @@ Generate your own PAC from an SVD file. ## Tasks * Install `svd2rust` and `form` via cargo. -* Download the [nrf-svd][svd] file and place it into `down-the-stack/dk-pac`. -* Run `svd2rust` on the file using the `cortex-m` target. +* Run `svd2rust` on `nrf52.svd` using the `cortex-m` target. * Split the file into its modules using `form`. * Format the generated file to make it readable. * Check the documentation. @@ -29,10 +28,9 @@ cargo install svd2rust cargo install form ``` -✅ Download [nrf-svd][svd](This version has an error: writeonce needs to be changed to writeOnce) -Place the file into `down-the-stack/dk-pac`. Note how we provide a `Cargo.toml` file, as it will not be generated by svd2rust. +✅ Go `down-the-stack/dk-pac`. The folder contains the SVD file `nrf52.svd`. We also provide a `Cargo.toml` file, as it will not be generated by svd2rust. -✅ In the terminal, go to the file's location. Run `svd2rust` with the SVD file to generate a PAC using the `cortex-m` target. +✅ In the terminal, go to the SVD file's location. Run `svd2rust` with the SVD file to generate a PAC using the `cortex-m` target. ``` svd2rust --target cortex-m -i nrf52.svd @@ -62,6 +60,14 @@ This does not change to the docs, but `lib.rs` is a bit more readable. form -i src/lib.rs -o src/ ``` -✅ Re-run `cargo fmt`. +In case this last command causes problems try this instead: -[svd]: (https://github.com/NordicSemiconductor/nrfx/blob/master/mdk/nrf52.svd ) \ No newline at end of file +Move `lib.rs` out of `/src`. + +Run the following command: + +```terminal +form -i ./lib.rs -o ./src +``` + +✅ Re-run `cargo fmt`.