aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2023-05-29 23:21:00 +0000
committerGitHub <[email protected]>2023-05-29 23:21:00 +0000
commit1d34078fa11839f88dd2e47a9355c6b35755128f (patch)
tree486197f43cb3124e5d185d0a67ff4819afab90ff
parent3760bdbb1b7b8d8aa8f59befdc31fbf9e09aaa5a (diff)
parent020e956f1ba5c0b3baf75b02f286218f661e1c02 (diff)
Merge pull request #1508 from embassy-rs/ci-fixes
ci: run HIL tests in parallel.
-rwxr-xr-x.github/ci/build.sh1
-rwxr-xr-xci.sh43
-rw-r--r--tests/nrf/.cargo/config.toml2
-rw-r--r--tests/nrf/Cargo.toml2
-rw-r--r--tests/nrf/build.rs1
-rw-r--r--tests/nrf/src/bin/buffered_uart.rs2
-rw-r--r--tests/nrf/src/bin/buffered_uart_spam.rs2
-rw-r--r--tests/nrf/src/bin/timer.rs2
-rw-r--r--tests/nrf/src/common.rs1
-rw-r--r--tests/rp/.cargo/config.toml4
-rw-r--r--tests/rp/Cargo.toml2
-rw-r--r--tests/rp/build.rs1
-rw-r--r--tests/rp/src/bin/dma_copy_async.rs2
-rw-r--r--tests/rp/src/bin/flash.rs2
-rw-r--r--tests/rp/src/bin/float.rs2
-rw-r--r--tests/rp/src/bin/gpio.rs2
-rw-r--r--tests/rp/src/bin/gpio_async.rs2
-rw-r--r--tests/rp/src/bin/gpio_multicore.rs2
-rw-r--r--tests/rp/src/bin/multicore.rs2
-rw-r--r--tests/rp/src/bin/pwm.rs2
-rw-r--r--tests/rp/src/bin/spi.rs2
-rw-r--r--tests/rp/src/bin/spi_async.rs2
-rw-r--r--tests/rp/src/bin/uart.rs2
-rw-r--r--tests/rp/src/bin/uart_buffered.rs2
-rw-r--r--tests/rp/src/bin/uart_dma.rs2
-rw-r--r--tests/rp/src/bin/uart_upgrade.rs2
-rw-r--r--tests/rp/src/common.rs1
-rw-r--r--tests/stm32/.cargo/config.toml2
-rw-r--r--tests/stm32/Cargo.toml2
-rw-r--r--tests/stm32/build.rs1
-rw-r--r--tests/stm32/src/bin/gpio.rs6
-rw-r--r--tests/stm32/src/bin/rtc.rs8
-rw-r--r--tests/stm32/src/bin/sdmmc.rs2
-rw-r--r--tests/stm32/src/bin/spi.rs6
-rw-r--r--tests/stm32/src/bin/spi_dma.rs6
-rw-r--r--tests/stm32/src/bin/timer.rs6
-rw-r--r--tests/stm32/src/bin/tl_mbox.rs10
-rw-r--r--tests/stm32/src/bin/usart.rs6
-rw-r--r--tests/stm32/src/bin/usart_dma.rs6
-rw-r--r--tests/stm32/src/bin/usart_rx_ringbuffered.rs6
-rw-r--r--tests/stm32/src/common.rs44
-rw-r--r--tests/stm32/src/example_common.rs25
42 files changed, 136 insertions, 92 deletions
diff --git a/.github/ci/build.sh b/.github/ci/build.sh
index 1c3a7f3b0..30ca1e6f0 100755
--- a/.github/ci/build.sh
+++ b/.github/ci/build.sh
@@ -9,6 +9,7 @@ export CARGO_HOME=/ci/cache/cargo
9export CARGO_TARGET_DIR=/ci/cache/target 9export CARGO_TARGET_DIR=/ci/cache/target
10if [ -f /ci/secrets/teleprobe-token.txt ]; then 10if [ -f /ci/secrets/teleprobe-token.txt ]; then
11 echo Got teleprobe token! 11 echo Got teleprobe token!
12 export TELEPROBE_HOST=https://teleprobe.embassy.dev
12 export TELEPROBE_TOKEN=$(cat /ci/secrets/teleprobe-token.txt) 13 export TELEPROBE_TOKEN=$(cat /ci/secrets/teleprobe-token.txt)
13fi 14fi
14 15
diff --git a/ci.sh b/ci.sh
index 11c569328..1eafda3a3 100755
--- a/ci.sh
+++ b/ci.sh
@@ -12,7 +12,7 @@ if [ $TARGET = "x86_64-unknown-linux-gnu" ]; then
12 BUILD_EXTRA="--- build --release --manifest-path examples/std/Cargo.toml --target $TARGET --out-dir out/examples/std" 12 BUILD_EXTRA="--- build --release --manifest-path examples/std/Cargo.toml --target $TARGET --out-dir out/examples/std"
13fi 13fi
14 14
15find . -name '*.rs' -not -path '*target*' | xargs rustfmt --check --skip-children --unstable-features --edition 2018 15find . -name '*.rs' -not -path '*target*' | xargs rustfmt --check --skip-children --unstable-features --edition 2021
16 16
17cargo batch \ 17cargo batch \
18 --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv7em-none-eabi --features nightly \ 18 --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv7em-none-eabi --features nightly \
@@ -127,45 +127,24 @@ cargo batch \
127 --- build --release --manifest-path examples/boot/bootloader/rp/Cargo.toml --target thumbv6m-none-eabi \ 127 --- build --release --manifest-path examples/boot/bootloader/rp/Cargo.toml --target thumbv6m-none-eabi \
128 --- build --release --manifest-path examples/boot/bootloader/stm32/Cargo.toml --target thumbv7em-none-eabi --features embassy-stm32/stm32wl55jc-cm4 \ 128 --- build --release --manifest-path examples/boot/bootloader/stm32/Cargo.toml --target thumbv7em-none-eabi --features embassy-stm32/stm32wl55jc-cm4 \
129 --- build --release --manifest-path examples/wasm/Cargo.toml --target wasm32-unknown-unknown --out-dir out/examples/wasm \ 129 --- build --release --manifest-path examples/wasm/Cargo.toml --target wasm32-unknown-unknown --out-dir out/examples/wasm \
130 --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f103c8 --out-dir out/tests/bluepill-stm32f103c8 \ 130 --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f103c8 --out-dir out/tests/stm32f103c8 \
131 --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi --out-dir out/tests/nucleo-stm32f429zi \ 131 --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi --out-dir out/tests/stm32f429zi \
132 --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g491re --out-dir out/tests/nucleo-stm32g491re \ 132 --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g491re --out-dir out/tests/stm32g491re \
133 --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32g071rb --out-dir out/tests/nucleo-stm32g071rb \ 133 --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32g071rb --out-dir out/tests/stm32g071rb \
134 --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32c031c6 --out-dir out/tests/nucleo-stm32c031c6 \ 134 --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32c031c6 --out-dir out/tests/stm32c031c6 \
135 --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi --out-dir out/tests/nucleo-stm32h755zi \ 135 --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi --out-dir out/tests/stm32h755zi \
136 --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wb55rg --out-dir out/tests/nucleo-stm32wb55rg \ 136 --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wb55rg --out-dir out/tests/stm32wb55rg \
137 --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h563zi --out-dir out/tests/nucleo-stm32h563zi \ 137 --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h563zi --out-dir out/tests/stm32h563zi \
138 --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32u585ai --out-dir out/tests/iot-stm32u585ai \ 138 --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32u585ai --out-dir out/tests/stm32u585ai \
139 --- build --release --manifest-path tests/rp/Cargo.toml --target thumbv6m-none-eabi --out-dir out/tests/rpi-pico \ 139 --- build --release --manifest-path tests/rp/Cargo.toml --target thumbv6m-none-eabi --out-dir out/tests/rpi-pico \
140 --- build --release --manifest-path tests/nrf/Cargo.toml --target thumbv7em-none-eabi --out-dir out/tests/nrf52840-dk \ 140 --- build --release --manifest-path tests/nrf/Cargo.toml --target thumbv7em-none-eabi --out-dir out/tests/nrf52840-dk \
141 --- build --release --manifest-path tests/riscv32/Cargo.toml --target riscv32imac-unknown-none-elf \ 141 --- build --release --manifest-path tests/riscv32/Cargo.toml --target riscv32imac-unknown-none-elf \
142 $BUILD_EXTRA 142 $BUILD_EXTRA
143 143
144 144
145
146function run_elf {
147 echo Running target=$1 elf=$2
148 STATUSCODE=$(
149 curl \
150 -sS \
151 --output /dev/stderr \
152 --write-out "%{http_code}" \
153 -H "Authorization: Bearer $TELEPROBE_TOKEN" \
154 https://teleprobe.embassy.dev/targets/$1/run --data-binary @$2
155 )
156 echo
157 echo HTTP Status code: $STATUSCODE
158 test "$STATUSCODE" -eq 200
159}
160
161if [[ -z "${TELEPROBE_TOKEN-}" ]]; then 145if [[ -z "${TELEPROBE_TOKEN-}" ]]; then
162 echo No teleprobe token found, skipping running HIL tests 146 echo No teleprobe token found, skipping running HIL tests
163 exit 147 exit
164fi 148fi
165 149
166for board in $(ls out/tests); do 150teleprobe client run -r out/tests \ No newline at end of file
167 echo Running tests for board: $board
168 for elf in $(ls out/tests/$board); do
169 run_elf $board out/tests/$board/$elf
170 done
171done
diff --git a/tests/nrf/.cargo/config.toml b/tests/nrf/.cargo/config.toml
index 4eec189d4..03995f963 100644
--- a/tests/nrf/.cargo/config.toml
+++ b/tests/nrf/.cargo/config.toml
@@ -1,6 +1,6 @@
1[target.'cfg(all(target_arch = "arm", target_os = "none"))'] 1[target.'cfg(all(target_arch = "arm", target_os = "none"))']
2#runner = "teleprobe local run --chip nRF52840_xxAA --elf" 2#runner = "teleprobe local run --chip nRF52840_xxAA --elf"
3runner = "teleprobe client run --target nrf52840-dk --elf" 3runner = "teleprobe client run"
4 4
5[build] 5[build]
6target = "thumbv7em-none-eabi" 6target = "thumbv7em-none-eabi"
diff --git a/tests/nrf/Cargo.toml b/tests/nrf/Cargo.toml
index ac38229a6..9735c87d9 100644
--- a/tests/nrf/Cargo.toml
+++ b/tests/nrf/Cargo.toml
@@ -5,6 +5,8 @@ version = "0.1.0"
5license = "MIT OR Apache-2.0" 5license = "MIT OR Apache-2.0"
6 6
7[dependencies] 7[dependencies]
8teleprobe-meta = "1"
9
8embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } 10embassy-futures = { version = "0.1.0", path = "../../embassy-futures" }
9embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt", "nightly"] } 11embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt", "nightly"] }
10embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "nightly", "integrated-timers"] } 12embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "nightly", "integrated-timers"] }
diff --git a/tests/nrf/build.rs b/tests/nrf/build.rs
index 6f4872249..93e2a28cf 100644
--- a/tests/nrf/build.rs
+++ b/tests/nrf/build.rs
@@ -11,6 +11,7 @@ fn main() -> Result<(), Box<dyn Error>> {
11 println!("cargo:rustc-link-arg-bins=--nmagic"); 11 println!("cargo:rustc-link-arg-bins=--nmagic");
12 println!("cargo:rustc-link-arg-bins=-Tlink_ram.x"); 12 println!("cargo:rustc-link-arg-bins=-Tlink_ram.x");
13 println!("cargo:rustc-link-arg-bins=-Tdefmt.x"); 13 println!("cargo:rustc-link-arg-bins=-Tdefmt.x");
14 println!("cargo:rustc-link-arg-bins=-Tteleprobe.x");
14 15
15 Ok(()) 16 Ok(())
16} 17}
diff --git a/tests/nrf/src/bin/buffered_uart.rs b/tests/nrf/src/bin/buffered_uart.rs
index e73d4f0b0..72a4cb4ef 100644
--- a/tests/nrf/src/bin/buffered_uart.rs
+++ b/tests/nrf/src/bin/buffered_uart.rs
@@ -1,6 +1,8 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4#[path = "../common.rs"]
5mod common;
4 6
5use defmt::{assert_eq, *}; 7use defmt::{assert_eq, *};
6use embassy_executor::Spawner; 8use embassy_executor::Spawner;
diff --git a/tests/nrf/src/bin/buffered_uart_spam.rs b/tests/nrf/src/bin/buffered_uart_spam.rs
index 74eda6d01..50960206f 100644
--- a/tests/nrf/src/bin/buffered_uart_spam.rs
+++ b/tests/nrf/src/bin/buffered_uart_spam.rs
@@ -1,6 +1,8 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4#[path = "../common.rs"]
5mod common;
4 6
5use core::mem; 7use core::mem;
6use core::ptr::NonNull; 8use core::ptr::NonNull;
diff --git a/tests/nrf/src/bin/timer.rs b/tests/nrf/src/bin/timer.rs
index 9b9b5fb28..607c5bbf1 100644
--- a/tests/nrf/src/bin/timer.rs
+++ b/tests/nrf/src/bin/timer.rs
@@ -1,6 +1,8 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4#[path = "../common.rs"]
5mod common;
4 6
5use defmt::{assert, info}; 7use defmt::{assert, info};
6use embassy_executor::Spawner; 8use embassy_executor::Spawner;
diff --git a/tests/nrf/src/common.rs b/tests/nrf/src/common.rs
new file mode 100644
index 000000000..1a05ac1c5
--- /dev/null
+++ b/tests/nrf/src/common.rs
@@ -0,0 +1 @@
teleprobe_meta::target!(b"nrf52840-dk");
diff --git a/tests/rp/.cargo/config.toml b/tests/rp/.cargo/config.toml
index e1744c703..bc92e788b 100644
--- a/tests/rp/.cargo/config.toml
+++ b/tests/rp/.cargo/config.toml
@@ -5,8 +5,8 @@
5#build-std-features = ["panic_immediate_abort"] 5#build-std-features = ["panic_immediate_abort"]
6 6
7[target.'cfg(all(target_arch = "arm", target_os = "none"))'] 7[target.'cfg(all(target_arch = "arm", target_os = "none"))']
8#runner = "teleprobe client run --target rpi-pico --elf" 8runner = "teleprobe client run"
9runner = "teleprobe local run --chip RP2040 --elf" 9#runner = "teleprobe local run --chip RP2040 --elf"
10 10
11rustflags = [ 11rustflags = [
12 # Code-size optimizations. 12 # Code-size optimizations.
diff --git a/tests/rp/Cargo.toml b/tests/rp/Cargo.toml
index 43167166e..1786baee3 100644
--- a/tests/rp/Cargo.toml
+++ b/tests/rp/Cargo.toml
@@ -5,6 +5,8 @@ version = "0.1.0"
5license = "MIT OR Apache-2.0" 5license = "MIT OR Apache-2.0"
6 6
7[dependencies] 7[dependencies]
8teleprobe-meta = "1"
9
8embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } 10embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
9embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } 11embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
10embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt"] } 12embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt"] }
diff --git a/tests/rp/build.rs b/tests/rp/build.rs
index 6f4872249..93e2a28cf 100644
--- a/tests/rp/build.rs
+++ b/tests/rp/build.rs
@@ -11,6 +11,7 @@ fn main() -> Result<(), Box<dyn Error>> {
11 println!("cargo:rustc-link-arg-bins=--nmagic"); 11 println!("cargo:rustc-link-arg-bins=--nmagic");
12 println!("cargo:rustc-link-arg-bins=-Tlink_ram.x"); 12 println!("cargo:rustc-link-arg-bins=-Tlink_ram.x");
13 println!("cargo:rustc-link-arg-bins=-Tdefmt.x"); 13 println!("cargo:rustc-link-arg-bins=-Tdefmt.x");
14 println!("cargo:rustc-link-arg-bins=-Tteleprobe.x");
14 15
15 Ok(()) 16 Ok(())
16} 17}
diff --git a/tests/rp/src/bin/dma_copy_async.rs b/tests/rp/src/bin/dma_copy_async.rs
index c53f644bd..2c0b559a9 100644
--- a/tests/rp/src/bin/dma_copy_async.rs
+++ b/tests/rp/src/bin/dma_copy_async.rs
@@ -1,6 +1,8 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4#[path = "../common.rs"]
5mod common;
4 6
5use defmt::{assert_eq, *}; 7use defmt::{assert_eq, *};
6use embassy_executor::Spawner; 8use embassy_executor::Spawner;
diff --git a/tests/rp/src/bin/flash.rs b/tests/rp/src/bin/flash.rs
index 00bebe2b6..cf9b86df5 100644
--- a/tests/rp/src/bin/flash.rs
+++ b/tests/rp/src/bin/flash.rs
@@ -1,6 +1,8 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4#[path = "../common.rs"]
5mod common;
4 6
5use defmt::*; 7use defmt::*;
6use embassy_executor::Spawner; 8use embassy_executor::Spawner;
diff --git a/tests/rp/src/bin/float.rs b/tests/rp/src/bin/float.rs
index 6715271e6..6a982507a 100644
--- a/tests/rp/src/bin/float.rs
+++ b/tests/rp/src/bin/float.rs
@@ -1,6 +1,8 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4#[path = "../common.rs"]
5mod common;
4 6
5use defmt::*; 7use defmt::*;
6use embassy_executor::Spawner; 8use embassy_executor::Spawner;
diff --git a/tests/rp/src/bin/gpio.rs b/tests/rp/src/bin/gpio.rs
index 80e92d0fd..51112d319 100644
--- a/tests/rp/src/bin/gpio.rs
+++ b/tests/rp/src/bin/gpio.rs
@@ -1,6 +1,8 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4#[path = "../common.rs"]
5mod common;
4 6
5use defmt::{assert, *}; 7use defmt::{assert, *};
6use embassy_executor::Spawner; 8use embassy_executor::Spawner;
diff --git a/tests/rp/src/bin/gpio_async.rs b/tests/rp/src/bin/gpio_async.rs
index f20b8fcbd..532494de5 100644
--- a/tests/rp/src/bin/gpio_async.rs
+++ b/tests/rp/src/bin/gpio_async.rs
@@ -1,6 +1,8 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4#[path = "../common.rs"]
5mod common;
4 6
5use defmt::{assert, *}; 7use defmt::{assert, *};
6use embassy_executor::Spawner; 8use embassy_executor::Spawner;
diff --git a/tests/rp/src/bin/gpio_multicore.rs b/tests/rp/src/bin/gpio_multicore.rs
index 6c13ccaae..780112bc1 100644
--- a/tests/rp/src/bin/gpio_multicore.rs
+++ b/tests/rp/src/bin/gpio_multicore.rs
@@ -1,6 +1,8 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4#[path = "../common.rs"]
5mod common;
4 6
5use defmt::{info, unwrap}; 7use defmt::{info, unwrap};
6use embassy_executor::Executor; 8use embassy_executor::Executor;
diff --git a/tests/rp/src/bin/multicore.rs b/tests/rp/src/bin/multicore.rs
index da78e887a..114889dec 100644
--- a/tests/rp/src/bin/multicore.rs
+++ b/tests/rp/src/bin/multicore.rs
@@ -1,6 +1,8 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4#[path = "../common.rs"]
5mod common;
4 6
5use defmt::{info, unwrap}; 7use defmt::{info, unwrap};
6use embassy_executor::Executor; 8use embassy_executor::Executor;
diff --git a/tests/rp/src/bin/pwm.rs b/tests/rp/src/bin/pwm.rs
index b8cbe74c8..c71d21ef9 100644
--- a/tests/rp/src/bin/pwm.rs
+++ b/tests/rp/src/bin/pwm.rs
@@ -1,6 +1,8 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4#[path = "../common.rs"]
5mod common;
4 6
5use defmt::{assert, assert_eq, assert_ne, *}; 7use defmt::{assert, assert_eq, assert_ne, *};
6use embassy_executor::Spawner; 8use embassy_executor::Spawner;
diff --git a/tests/rp/src/bin/spi.rs b/tests/rp/src/bin/spi.rs
index 478d62ee0..84dfa5a2c 100644
--- a/tests/rp/src/bin/spi.rs
+++ b/tests/rp/src/bin/spi.rs
@@ -1,6 +1,8 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4#[path = "../common.rs"]
5mod common;
4 6
5use defmt::{assert_eq, *}; 7use defmt::{assert_eq, *};
6use embassy_executor::Spawner; 8use embassy_executor::Spawner;
diff --git a/tests/rp/src/bin/spi_async.rs b/tests/rp/src/bin/spi_async.rs
index 2e22c9de7..a4080b03d 100644
--- a/tests/rp/src/bin/spi_async.rs
+++ b/tests/rp/src/bin/spi_async.rs
@@ -4,6 +4,8 @@
4#![no_std] 4#![no_std]
5#![no_main] 5#![no_main]
6#![feature(type_alias_impl_trait)] 6#![feature(type_alias_impl_trait)]
7#[path = "../common.rs"]
8mod common;
7 9
8use defmt::{assert_eq, *}; 10use defmt::{assert_eq, *};
9use embassy_executor::Spawner; 11use embassy_executor::Spawner;
diff --git a/tests/rp/src/bin/uart.rs b/tests/rp/src/bin/uart.rs
index 80c18c02e..2331c7d36 100644
--- a/tests/rp/src/bin/uart.rs
+++ b/tests/rp/src/bin/uart.rs
@@ -1,6 +1,8 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4#[path = "../common.rs"]
5mod common;
4 6
5use defmt::{assert_eq, *}; 7use defmt::{assert_eq, *};
6use embassy_executor::Spawner; 8use embassy_executor::Spawner;
diff --git a/tests/rp/src/bin/uart_buffered.rs b/tests/rp/src/bin/uart_buffered.rs
index 1dcf57d07..e74e9986c 100644
--- a/tests/rp/src/bin/uart_buffered.rs
+++ b/tests/rp/src/bin/uart_buffered.rs
@@ -1,6 +1,8 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4#[path = "../common.rs"]
5mod common;
4 6
5use defmt::{assert_eq, panic, *}; 7use defmt::{assert_eq, panic, *};
6use embassy_executor::Spawner; 8use embassy_executor::Spawner;
diff --git a/tests/rp/src/bin/uart_dma.rs b/tests/rp/src/bin/uart_dma.rs
index 75be76eda..fee6c825d 100644
--- a/tests/rp/src/bin/uart_dma.rs
+++ b/tests/rp/src/bin/uart_dma.rs
@@ -1,6 +1,8 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4#[path = "../common.rs"]
5mod common;
4 6
5use defmt::{assert_eq, *}; 7use defmt::{assert_eq, *};
6use embassy_executor::Spawner; 8use embassy_executor::Spawner;
diff --git a/tests/rp/src/bin/uart_upgrade.rs b/tests/rp/src/bin/uart_upgrade.rs
index 8605bb1c5..760e53954 100644
--- a/tests/rp/src/bin/uart_upgrade.rs
+++ b/tests/rp/src/bin/uart_upgrade.rs
@@ -1,6 +1,8 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4#[path = "../common.rs"]
5mod common;
4 6
5use defmt::{assert_eq, *}; 7use defmt::{assert_eq, *};
6use embassy_executor::Spawner; 8use embassy_executor::Spawner;
diff --git a/tests/rp/src/common.rs b/tests/rp/src/common.rs
new file mode 100644
index 000000000..955674f27
--- /dev/null
+++ b/tests/rp/src/common.rs
@@ -0,0 +1 @@
teleprobe_meta::target!(b"rpi-pico");
diff --git a/tests/stm32/.cargo/config.toml b/tests/stm32/.cargo/config.toml
index 426d6e67f..07761b01c 100644
--- a/tests/stm32/.cargo/config.toml
+++ b/tests/stm32/.cargo/config.toml
@@ -3,7 +3,7 @@ build-std = ["core"]
3build-std-features = ["panic_immediate_abort"] 3build-std-features = ["panic_immediate_abort"]
4 4
5[target.'cfg(all(target_arch = "arm", target_os = "none"))'] 5[target.'cfg(all(target_arch = "arm", target_os = "none"))']
6runner = "teleprobe client run --target bluepill-stm32f103c8 --elf" 6runner = "teleprobe client run"
7#runner = "teleprobe local run --chip STM32F103C8 --elf" 7#runner = "teleprobe local run --chip STM32F103C8 --elf"
8 8
9rustflags = [ 9rustflags = [
diff --git a/tests/stm32/Cargo.toml b/tests/stm32/Cargo.toml
index 4c0597746..f1b0ba121 100644
--- a/tests/stm32/Cargo.toml
+++ b/tests/stm32/Cargo.toml
@@ -22,6 +22,8 @@ ble = []
22not-gpdma = [] 22not-gpdma = []
23 23
24[dependencies] 24[dependencies]
25teleprobe-meta = "1"
26
25embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } 27embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] }
26embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } 28embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
27embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "tick-hz-32_768", "defmt-timestamp-uptime"] } 29embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "tick-hz-32_768", "defmt-timestamp-uptime"] }
diff --git a/tests/stm32/build.rs b/tests/stm32/build.rs
index b4583147e..2e71954d7 100644
--- a/tests/stm32/build.rs
+++ b/tests/stm32/build.rs
@@ -26,6 +26,7 @@ fn main() -> Result<(), Box<dyn Error>> {
26 } 26 }
27 27
28 println!("cargo:rustc-link-arg-bins=-Tdefmt.x"); 28 println!("cargo:rustc-link-arg-bins=-Tdefmt.x");
29 println!("cargo:rustc-link-arg-bins=-Tteleprobe.x");
29 30
30 Ok(()) 31 Ok(())
31} 32}
diff --git a/tests/stm32/src/bin/gpio.rs b/tests/stm32/src/bin/gpio.rs
index 8b99b08a5..67f44317e 100644
--- a/tests/stm32/src/bin/gpio.rs
+++ b/tests/stm32/src/bin/gpio.rs
@@ -1,13 +1,13 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4#[path = "../common.rs"]
5mod common;
4 6
5#[path = "../example_common.rs"] 7use common::*;
6mod example_common;
7use defmt::assert; 8use defmt::assert;
8use embassy_executor::Spawner; 9use embassy_executor::Spawner;
9use embassy_stm32::gpio::{Flex, Input, Level, Output, OutputOpenDrain, Pull, Speed}; 10use embassy_stm32::gpio::{Flex, Input, Level, Output, OutputOpenDrain, Pull, Speed};
10use example_common::*;
11 11
12#[embassy_executor::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner) { 13async fn main(_spawner: Spawner) {
diff --git a/tests/stm32/src/bin/rtc.rs b/tests/stm32/src/bin/rtc.rs
index ccf2ca609..32d35c42c 100644
--- a/tests/stm32/src/bin/rtc.rs
+++ b/tests/stm32/src/bin/rtc.rs
@@ -1,18 +1,16 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4#[path = "../common.rs"]
5mod common;
4 6
5// required-features: chrono
6
7#[path = "../example_common.rs"]
8mod example_common;
9use chrono::{NaiveDate, NaiveDateTime}; 7use chrono::{NaiveDate, NaiveDateTime};
8use common::*;
10use defmt::assert; 9use defmt::assert;
11use embassy_executor::Spawner; 10use embassy_executor::Spawner;
12use embassy_stm32::pac; 11use embassy_stm32::pac;
13use embassy_stm32::rtc::{Rtc, RtcConfig}; 12use embassy_stm32::rtc::{Rtc, RtcConfig};
14use embassy_time::{Duration, Timer}; 13use embassy_time::{Duration, Timer};
15use example_common::*;
16 14
17#[embassy_executor::main] 15#[embassy_executor::main]
18async fn main(_spawner: Spawner) { 16async fn main(_spawner: Spawner) {
diff --git a/tests/stm32/src/bin/sdmmc.rs b/tests/stm32/src/bin/sdmmc.rs
index 7d96cf41e..515025386 100644
--- a/tests/stm32/src/bin/sdmmc.rs
+++ b/tests/stm32/src/bin/sdmmc.rs
@@ -2,6 +2,8 @@
2#![no_std] 2#![no_std]
3#![no_main] 3#![no_main]
4#![feature(type_alias_impl_trait)] 4#![feature(type_alias_impl_trait)]
5#[path = "../common.rs"]
6mod common;
5 7
6use defmt::{assert_eq, *}; 8use defmt::{assert_eq, *};
7use embassy_executor::Spawner; 9use embassy_executor::Spawner;
diff --git a/tests/stm32/src/bin/spi.rs b/tests/stm32/src/bin/spi.rs
index a87ac3237..819ecae3c 100644
--- a/tests/stm32/src/bin/spi.rs
+++ b/tests/stm32/src/bin/spi.rs
@@ -1,15 +1,15 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4#[path = "../common.rs"]
5mod common;
4 6
5#[path = "../example_common.rs"] 7use common::*;
6mod example_common;
7use defmt::assert_eq; 8use defmt::assert_eq;
8use embassy_executor::Spawner; 9use embassy_executor::Spawner;
9use embassy_stm32::dma::NoDma; 10use embassy_stm32::dma::NoDma;
10use embassy_stm32::spi::{self, Spi}; 11use embassy_stm32::spi::{self, Spi};
11use embassy_stm32::time::Hertz; 12use embassy_stm32::time::Hertz;
12use example_common::*;
13 13
14#[embassy_executor::main] 14#[embassy_executor::main]
15async fn main(_spawner: Spawner) { 15async fn main(_spawner: Spawner) {
diff --git a/tests/stm32/src/bin/spi_dma.rs b/tests/stm32/src/bin/spi_dma.rs
index 74776ebf8..78aad24e1 100644
--- a/tests/stm32/src/bin/spi_dma.rs
+++ b/tests/stm32/src/bin/spi_dma.rs
@@ -1,14 +1,14 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4#[path = "../common.rs"]
5mod common;
4 6
5#[path = "../example_common.rs"] 7use common::*;
6mod example_common;
7use defmt::assert_eq; 8use defmt::assert_eq;
8use embassy_executor::Spawner; 9use embassy_executor::Spawner;
9use embassy_stm32::spi::{self, Spi}; 10use embassy_stm32::spi::{self, Spi};
10use embassy_stm32::time::Hertz; 11use embassy_stm32::time::Hertz;
11use example_common::*;
12 12
13#[embassy_executor::main] 13#[embassy_executor::main]
14async fn main(_spawner: Spawner) { 14async fn main(_spawner: Spawner) {
diff --git a/tests/stm32/src/bin/timer.rs b/tests/stm32/src/bin/timer.rs
index e00e43bf1..f8b453cda 100644
--- a/tests/stm32/src/bin/timer.rs
+++ b/tests/stm32/src/bin/timer.rs
@@ -1,13 +1,13 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4#[path = "../common.rs"]
5mod common;
4 6
5#[path = "../example_common.rs"] 7use common::*;
6mod example_common;
7use defmt::assert; 8use defmt::assert;
8use embassy_executor::Spawner; 9use embassy_executor::Spawner;
9use embassy_time::{Duration, Instant, Timer}; 10use embassy_time::{Duration, Instant, Timer};
10use example_common::*;
11 11
12#[embassy_executor::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner) { 13async fn main(_spawner: Spawner) {
diff --git a/tests/stm32/src/bin/tl_mbox.rs b/tests/stm32/src/bin/tl_mbox.rs
index 626e7ac6f..fab9f0e1b 100644
--- a/tests/stm32/src/bin/tl_mbox.rs
+++ b/tests/stm32/src/bin/tl_mbox.rs
@@ -1,16 +1,16 @@
1// required-features: ble
2
1#![no_std] 3#![no_std]
2#![no_main] 4#![no_main]
3#![feature(type_alias_impl_trait)] 5#![feature(type_alias_impl_trait)]
6#[path = "../common.rs"]
7mod common;
4 8
5// required-features: ble 9use common::*;
6
7#[path = "../example_common.rs"]
8mod example_common;
9use embassy_executor::Spawner; 10use embassy_executor::Spawner;
10use embassy_stm32::tl_mbox::{Config, TlMbox}; 11use embassy_stm32::tl_mbox::{Config, TlMbox};
11use embassy_stm32::{bind_interrupts, tl_mbox}; 12use embassy_stm32::{bind_interrupts, tl_mbox};
12use embassy_time::{Duration, Timer}; 13use embassy_time::{Duration, Timer};
13use example_common::*;
14 14
15bind_interrupts!(struct Irqs{ 15bind_interrupts!(struct Irqs{
16 IPCC_C1_RX => tl_mbox::ReceiveInterruptHandler; 16 IPCC_C1_RX => tl_mbox::ReceiveInterruptHandler;
diff --git a/tests/stm32/src/bin/usart.rs b/tests/stm32/src/bin/usart.rs
index 415c7afa9..394005b82 100644
--- a/tests/stm32/src/bin/usart.rs
+++ b/tests/stm32/src/bin/usart.rs
@@ -1,16 +1,16 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4#[path = "../common.rs"]
5mod common;
4 6
5#[path = "../example_common.rs"] 7use common::*;
6mod example_common;
7use defmt::assert_eq; 8use defmt::assert_eq;
8use embassy_executor::Spawner; 9use embassy_executor::Spawner;
9use embassy_stm32::dma::NoDma; 10use embassy_stm32::dma::NoDma;
10use embassy_stm32::usart::{Config, Error, Uart}; 11use embassy_stm32::usart::{Config, Error, Uart};
11use embassy_stm32::{bind_interrupts, peripherals, usart}; 12use embassy_stm32::{bind_interrupts, peripherals, usart};
12use embassy_time::{Duration, Instant}; 13use embassy_time::{Duration, Instant};
13use example_common::*;
14 14
15#[cfg(any( 15#[cfg(any(
16 feature = "stm32f103c8", 16 feature = "stm32f103c8",
diff --git a/tests/stm32/src/bin/usart_dma.rs b/tests/stm32/src/bin/usart_dma.rs
index 7f002b97e..50dd2893e 100644
--- a/tests/stm32/src/bin/usart_dma.rs
+++ b/tests/stm32/src/bin/usart_dma.rs
@@ -1,15 +1,15 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4#[path = "../common.rs"]
5mod common;
4 6
5#[path = "../example_common.rs"] 7use common::*;
6mod example_common;
7use defmt::assert_eq; 8use defmt::assert_eq;
8use embassy_executor::Spawner; 9use embassy_executor::Spawner;
9use embassy_futures::join::join; 10use embassy_futures::join::join;
10use embassy_stm32::usart::{Config, Uart}; 11use embassy_stm32::usart::{Config, Uart};
11use embassy_stm32::{bind_interrupts, peripherals, usart}; 12use embassy_stm32::{bind_interrupts, peripherals, usart};
12use example_common::*;
13 13
14#[cfg(any( 14#[cfg(any(
15 feature = "stm32f103c8", 15 feature = "stm32f103c8",
diff --git a/tests/stm32/src/bin/usart_rx_ringbuffered.rs b/tests/stm32/src/bin/usart_rx_ringbuffered.rs
index 3a34773f7..c8dd2643b 100644
--- a/tests/stm32/src/bin/usart_rx_ringbuffered.rs
+++ b/tests/stm32/src/bin/usart_rx_ringbuffered.rs
@@ -3,15 +3,15 @@
3#![no_std] 3#![no_std]
4#![no_main] 4#![no_main]
5#![feature(type_alias_impl_trait)] 5#![feature(type_alias_impl_trait)]
6#[path = "../common.rs"]
7mod common;
6 8
7#[path = "../example_common.rs"] 9use common::*;
8mod example_common;
9use defmt::{assert_eq, panic}; 10use defmt::{assert_eq, panic};
10use embassy_executor::Spawner; 11use embassy_executor::Spawner;
11use embassy_stm32::usart::{Config, DataBits, Parity, RingBufferedUartRx, StopBits, Uart, UartTx}; 12use embassy_stm32::usart::{Config, DataBits, Parity, RingBufferedUartRx, StopBits, Uart, UartTx};
12use embassy_stm32::{bind_interrupts, peripherals, usart}; 13use embassy_stm32::{bind_interrupts, peripherals, usart};
13use embassy_time::{Duration, Timer}; 14use embassy_time::{Duration, Timer};
14use example_common::*;
15use rand_chacha::ChaCha8Rng; 15use rand_chacha::ChaCha8Rng;
16use rand_core::{RngCore, SeedableRng}; 16use rand_core::{RngCore, SeedableRng};
17 17
diff --git a/tests/stm32/src/common.rs b/tests/stm32/src/common.rs
new file mode 100644
index 000000000..3d2a9b8ef
--- /dev/null
+++ b/tests/stm32/src/common.rs
@@ -0,0 +1,44 @@
1#![macro_use]
2
3pub use defmt::*;
4#[allow(unused)]
5use embassy_stm32::time::Hertz;
6use embassy_stm32::Config;
7use {defmt_rtt as _, panic_probe as _};
8
9#[cfg(feature = "stm32f103c8")]
10teleprobe_meta::target!(b"bluepill-stm32f103c8");
11#[cfg(feature = "stm32g491re")]
12teleprobe_meta::target!(b"nucleo-stm32g491re");
13#[cfg(feature = "stm32g071rb")]
14teleprobe_meta::target!(b"nucleo-stm32g071rb");
15#[cfg(feature = "stm32f429zi")]
16teleprobe_meta::target!(b"nucleo-stm32f429zi");
17#[cfg(feature = "stm32wb55rg")]
18teleprobe_meta::target!(b"nucleo-stm32wb55rg");
19#[cfg(feature = "stm32h755zi")]
20teleprobe_meta::target!(b"nucleo-stm32h755zi");
21#[cfg(feature = "stm32u585ai")]
22teleprobe_meta::target!(b"iot-stm32u585ai");
23#[cfg(feature = "stm32h563zi")]
24teleprobe_meta::target!(b"nucleo-stm32h563zi");
25#[cfg(feature = "stm32c031c6")]
26teleprobe_meta::target!(b"nucleo-stm32c031c6");
27
28pub fn config() -> Config {
29 #[allow(unused_mut)]
30 let mut config = Config::default();
31
32 #[cfg(feature = "stm32h755zi")]
33 {
34 config.rcc.sys_ck = Some(Hertz(400_000_000));
35 config.rcc.pll1.q_ck = Some(Hertz(100_000_000));
36 }
37
38 #[cfg(feature = "stm32u585ai")]
39 {
40 config.rcc.mux = embassy_stm32::rcc::ClockSrc::MSI(embassy_stm32::rcc::MSIRange::Range48mhz);
41 }
42
43 config
44}
diff --git a/tests/stm32/src/example_common.rs b/tests/stm32/src/example_common.rs
deleted file mode 100644
index 3d150da60..000000000
--- a/tests/stm32/src/example_common.rs
+++ /dev/null
@@ -1,25 +0,0 @@
1#![macro_use]
2
3pub use defmt::*;
4#[allow(unused)]
5use embassy_stm32::time::Hertz;
6use embassy_stm32::Config;
7use {defmt_rtt as _, panic_probe as _};
8
9pub fn config() -> Config {
10 #[allow(unused_mut)]
11 let mut config = Config::default();
12
13 #[cfg(feature = "stm32h755zi")]
14 {
15 config.rcc.sys_ck = Some(Hertz(400_000_000));
16 config.rcc.pll1.q_ck = Some(Hertz(100_000_000));
17 }
18
19 #[cfg(feature = "stm32u585ai")]
20 {
21 config.rcc.mux = embassy_stm32::rcc::ClockSrc::MSI(embassy_stm32::rcc::MSIRange::Range48mhz);
22 }
23
24 config
25}