fixing issue with form, rm download link

This commit is contained in:
Mirabellensaft 2023-03-21 19:13:34 +01:00
parent a5f4ebee56
commit fbda1d9c2a

View file

@ -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 )
Move `lib.rs` out of `/src`.
Run the following command:
```terminal
form -i ./lib.rs -o ./src
```
✅ Re-run `cargo fmt`.