mirror of
https://github.com/ferrous-systems/embedded-trainings-2020.git
synced 2025-01-10 08:15:36 +00:00
fixing issue with form, rm download link
This commit is contained in:
parent
a5f4ebee56
commit
fbda1d9c2a
1 changed files with 13 additions and 7 deletions
|
@ -13,8 +13,7 @@ Generate your own PAC from an SVD file.
|
||||||
|
|
||||||
## Tasks
|
## Tasks
|
||||||
* Install `svd2rust` and `form` via cargo.
|
* Install `svd2rust` and `form` via cargo.
|
||||||
* Download the [nrf-svd][svd] file and place it into `down-the-stack/dk-pac`.
|
* Run `svd2rust` on `nrf52.svd` using the `cortex-m` target.
|
||||||
* Run `svd2rust` on the file using the `cortex-m` target.
|
|
||||||
* Split the file into its modules using `form`.
|
* Split the file into its modules using `form`.
|
||||||
* Format the generated file to make it readable.
|
* Format the generated file to make it readable.
|
||||||
* Check the documentation.
|
* Check the documentation.
|
||||||
|
@ -29,10 +28,9 @@ cargo install svd2rust
|
||||||
cargo install form
|
cargo install form
|
||||||
```
|
```
|
||||||
|
|
||||||
✅ Download [nrf-svd][svd](This version has an error: writeonce needs to be changed to writeOnce)
|
✅ 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.
|
||||||
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.
|
|
||||||
|
|
||||||
✅ 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
|
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/
|
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 )
|
Move `lib.rs` out of `/src`.
|
||||||
|
|
||||||
|
Run the following command:
|
||||||
|
|
||||||
|
```terminal
|
||||||
|
form -i ./lib.rs -o ./src
|
||||||
|
```
|
||||||
|
|
||||||
|
✅ Re-run `cargo fmt`.
|
||||||
|
|
Loading…
Reference in a new issue