Skip to content

Commit ee383bb

Browse files
committed
update package
- Add embassy example - improve timer API - restructure examples - restructure and improve SPI
1 parent 405cc08 commit ee383bb

39 files changed

+2109
-566
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ jobs:
3939
steps:
4040
- uses: actions/checkout@v4
4141
- uses: dtolnay/rust-toolchain@nightly
42-
- run: RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc --all-features
42+
- run: RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc -p va108xx
43+
- run: RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc -p va108xx-hal
44+
- run: RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc -p vorago-reb1
4345

4446
clippy:
4547
name: Clippy

Cargo.toml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ members = [
55
"va108xx",
66
"va108xx-hal",
77
"examples/simple",
8+
"examples/rtic",
9+
"examples/embassy",
810
"board-tests",
11+
"bootloader",
912
]
1013

1114
exclude = [
@@ -17,7 +20,8 @@ codegen-units = 1
1720
debug = 2
1821
debug-assertions = true # <-
1922
incremental = false
20-
opt-level = 'z' # <-
23+
# This is problematic for stepping..
24+
# opt-level = 'z' # <-
2125
overflow-checks = true # <-
2226

2327
# cargo build/run --release
@@ -29,3 +33,12 @@ incremental = false
2933
lto = 'fat'
3034
opt-level = 3 # <-
3135
overflow-checks = false # <-
36+
37+
[profile.small]
38+
inherits = "release"
39+
codegen-units = 1
40+
debug-assertions = false # <-
41+
lto = true
42+
opt-level = 'z' # <-
43+
overflow-checks = false # <-
44+
strip = true # Automatically strip symbols from the binary.

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@ This workspace contains the following released crates:
1919

2020
It also contains the following helper crates:
2121

22-
- The `board-tests` contains an application which can be used to test the libraries on the
23-
board.
24-
- The `examples` crates contains various example applications for the HAL and the PAC.
22+
- The [`board-tests`](https://egit.irs.uni-stuttgart.de/rust/va108xx-rs/src/branch/main/board-tests)
23+
contains an application which can be used to test the libraries on the board.
24+
- The [`examples`](https://egit.irs.uni-stuttgart.de/rust/va108xx-rs/src/branch/main/examples)
25+
folder contains various example applications crates using the HAL and the PAC.
26+
This folder also contains dedicated example applications using the
27+
[`RTIC`](https://rtic.rs/2/book/en/) and [`embassy`](https://github.com/embassy-rs/embassy)
28+
native Rust RTOSes.
2529

2630
## Using the `.cargo/config.toml` file
2731

@@ -94,6 +98,8 @@ example.
9498

9599
Assuming a working debug connection to your VA108xx board, you can debug using VS Code with
96100
the [`Cortex-Debug` plugin](https://marketplace.visualstudio.com/items?itemName=marus25.cortex-debug).
101+
Please make sure that [`objdump-multiarch` and `nm-multiarch`](https://forums.raspberrypi.com/viewtopic.php?t=333146)
102+
are installed as well.
97103

98104
Some sample configuration files for VS code were provided and can be used by running
99105
`cp -rT vscode .vscode` like specified above. After that, you can use `Run and Debug`
@@ -108,4 +114,5 @@ configuration variables in your `settings.json`:
108114
- `"cortex-debug.gdbPath.osx"`
109115

110116
The provided VS Code configurations also provide an integrated RTT logger, which you can access
111-
via the terminal at `RTT Ch:0 console`.
117+
via the terminal at `RTT Ch:0 console`. In order for the RTT block address detection to
118+
work properly, `objdump-multiarch` and `nm-multiarch` need to be installed.

automation/Jenkinsfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ pipeline {
2525
stage('Docs') {
2626
steps {
2727
sh """
28-
RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc --all-features
28+
RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc -p va108xx
29+
RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc -p va108xx-hal
30+
RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc -p vorago-reb1
2931
"""
3032
}
3133
}

board-tests/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7-
cortex-m-rtic = "1"
8-
panic-halt = "0.2"
97
cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] }
108
cortex-m-rt = "0.7"
9+
panic-halt = "0.2"
1110
rtt-target = "0.5"
1211
panic-rtt-target = "0.1.3"
1312
embedded-hal = "1"

bootloader/Cargo.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[package]
2+
name = "bootloader"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
cortex-m = "0.7"
8+
cortex-m-rt = "0.7"
9+
embedded-hal = "1"
10+
embedded-hal-bus = "0.2"
11+
dummy-pin = "1"
12+
panic-rtt-target = { version = "0.1.3" }
13+
panic-halt = { version = "0.2" }
14+
rtt-target = { version = "0.5" }
15+
crc = "3"
16+
17+
[dependencies.va108xx-hal]
18+
path = "../va108xx-hal"
19+
20+
[dependencies.vorago-reb1]
21+
path = "../vorago-reb1"
22+
23+
[features]
24+
default = []
25+
rtt-panic = []

bootloader/src/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#![no_std]
2+
3+
use core::convert::Infallible;
4+
5+
/// Simple trait which makes swapping the NVM easier. NVMs only need to implement this interface.
6+
pub trait NvmInterface {
7+
fn write(&mut self, address: u32, data: &[u8]) -> Result<(), Infallible>;
8+
fn read(&mut self, address: u32, buf: &mut [u8]) -> Result<(), Infallible>;
9+
fn verify(&mut self, address: u32, data: &[u8]) -> Result<bool, Infallible>;
10+
}

0 commit comments

Comments
 (0)