diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-05-29 23:21:00 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-05-29 23:21:00 +0000 |
| commit | 1d34078fa11839f88dd2e47a9355c6b35755128f (patch) | |
| tree | 486197f43cb3124e5d185d0a67ff4819afab90ff /tests | |
| parent | 3760bdbb1b7b8d8aa8f59befdc31fbf9e09aaa5a (diff) | |
| parent | 020e956f1ba5c0b3baf75b02f286218f661e1c02 (diff) | |
Merge pull request #1508 from embassy-rs/ci-fixes
ci: run HIL tests in parallel.
Diffstat (limited to 'tests')
40 files changed, 124 insertions, 60 deletions
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" |
| 3 | runner = "teleprobe client run --target nrf52840-dk --elf" | 3 | runner = "teleprobe client run" |
| 4 | 4 | ||
| 5 | [build] | 5 | [build] |
| 6 | target = "thumbv7em-none-eabi" | 6 | target = "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" | |||
| 5 | license = "MIT OR Apache-2.0" | 5 | license = "MIT OR Apache-2.0" |
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | teleprobe-meta = "1" | ||
| 9 | |||
| 8 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | 10 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| 9 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt", "nightly"] } | 11 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt", "nightly"] } |
| 10 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "nightly", "integrated-timers"] } | 12 | embassy-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"] | ||
| 5 | mod common; | ||
| 4 | 6 | ||
| 5 | use defmt::{assert_eq, *}; | 7 | use defmt::{assert_eq, *}; |
| 6 | use embassy_executor::Spawner; | 8 | use 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"] | ||
| 5 | mod common; | ||
| 4 | 6 | ||
| 5 | use core::mem; | 7 | use core::mem; |
| 6 | use core::ptr::NonNull; | 8 | use 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"] | ||
| 5 | mod common; | ||
| 4 | 6 | ||
| 5 | use defmt::{assert, info}; | 7 | use defmt::{assert, info}; |
| 6 | use embassy_executor::Spawner; | 8 | use 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" | 8 | runner = "teleprobe client run" |
| 9 | runner = "teleprobe local run --chip RP2040 --elf" | 9 | #runner = "teleprobe local run --chip RP2040 --elf" |
| 10 | 10 | ||
| 11 | rustflags = [ | 11 | rustflags = [ |
| 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" | |||
| 5 | license = "MIT OR Apache-2.0" | 5 | license = "MIT OR Apache-2.0" |
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | teleprobe-meta = "1" | ||
| 9 | |||
| 8 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 10 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 11 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt"] } | 12 | embassy-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"] | ||
| 5 | mod common; | ||
| 4 | 6 | ||
| 5 | use defmt::{assert_eq, *}; | 7 | use defmt::{assert_eq, *}; |
| 6 | use embassy_executor::Spawner; | 8 | use 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"] | ||
| 5 | mod common; | ||
| 4 | 6 | ||
| 5 | use defmt::*; | 7 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 8 | use 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"] | ||
| 5 | mod common; | ||
| 4 | 6 | ||
| 5 | use defmt::*; | 7 | use defmt::*; |
| 6 | use embassy_executor::Spawner; | 8 | use 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"] | ||
| 5 | mod common; | ||
| 4 | 6 | ||
| 5 | use defmt::{assert, *}; | 7 | use defmt::{assert, *}; |
| 6 | use embassy_executor::Spawner; | 8 | use 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"] | ||
| 5 | mod common; | ||
| 4 | 6 | ||
| 5 | use defmt::{assert, *}; | 7 | use defmt::{assert, *}; |
| 6 | use embassy_executor::Spawner; | 8 | use 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"] | ||
| 5 | mod common; | ||
| 4 | 6 | ||
| 5 | use defmt::{info, unwrap}; | 7 | use defmt::{info, unwrap}; |
| 6 | use embassy_executor::Executor; | 8 | use 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"] | ||
| 5 | mod common; | ||
| 4 | 6 | ||
| 5 | use defmt::{info, unwrap}; | 7 | use defmt::{info, unwrap}; |
| 6 | use embassy_executor::Executor; | 8 | use 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"] | ||
| 5 | mod common; | ||
| 4 | 6 | ||
| 5 | use defmt::{assert, assert_eq, assert_ne, *}; | 7 | use defmt::{assert, assert_eq, assert_ne, *}; |
| 6 | use embassy_executor::Spawner; | 8 | use 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"] | ||
| 5 | mod common; | ||
| 4 | 6 | ||
| 5 | use defmt::{assert_eq, *}; | 7 | use defmt::{assert_eq, *}; |
| 6 | use embassy_executor::Spawner; | 8 | use 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"] | ||
| 8 | mod common; | ||
| 7 | 9 | ||
| 8 | use defmt::{assert_eq, *}; | 10 | use defmt::{assert_eq, *}; |
| 9 | use embassy_executor::Spawner; | 11 | use 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"] | ||
| 5 | mod common; | ||
| 4 | 6 | ||
| 5 | use defmt::{assert_eq, *}; | 7 | use defmt::{assert_eq, *}; |
| 6 | use embassy_executor::Spawner; | 8 | use 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"] | ||
| 5 | mod common; | ||
| 4 | 6 | ||
| 5 | use defmt::{assert_eq, panic, *}; | 7 | use defmt::{assert_eq, panic, *}; |
| 6 | use embassy_executor::Spawner; | 8 | use 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"] | ||
| 5 | mod common; | ||
| 4 | 6 | ||
| 5 | use defmt::{assert_eq, *}; | 7 | use defmt::{assert_eq, *}; |
| 6 | use embassy_executor::Spawner; | 8 | use 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"] | ||
| 5 | mod common; | ||
| 4 | 6 | ||
| 5 | use defmt::{assert_eq, *}; | 7 | use defmt::{assert_eq, *}; |
| 6 | use embassy_executor::Spawner; | 8 | use 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"] | |||
| 3 | build-std-features = ["panic_immediate_abort"] | 3 | build-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"))'] |
| 6 | runner = "teleprobe client run --target bluepill-stm32f103c8 --elf" | 6 | runner = "teleprobe client run" |
| 7 | #runner = "teleprobe local run --chip STM32F103C8 --elf" | 7 | #runner = "teleprobe local run --chip STM32F103C8 --elf" |
| 8 | 8 | ||
| 9 | rustflags = [ | 9 | rustflags = [ |
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 = [] | |||
| 22 | not-gpdma = [] | 22 | not-gpdma = [] |
| 23 | 23 | ||
| 24 | [dependencies] | 24 | [dependencies] |
| 25 | teleprobe-meta = "1" | ||
| 26 | |||
| 25 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 27 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 26 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 28 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 27 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "tick-hz-32_768", "defmt-timestamp-uptime"] } | 29 | embassy-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"] | ||
| 5 | mod common; | ||
| 4 | 6 | ||
| 5 | #[path = "../example_common.rs"] | 7 | use common::*; |
| 6 | mod example_common; | ||
| 7 | use defmt::assert; | 8 | use defmt::assert; |
| 8 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 9 | use embassy_stm32::gpio::{Flex, Input, Level, Output, OutputOpenDrain, Pull, Speed}; | 10 | use embassy_stm32::gpio::{Flex, Input, Level, Output, OutputOpenDrain, Pull, Speed}; |
| 10 | use example_common::*; | ||
| 11 | 11 | ||
| 12 | #[embassy_executor::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner) { | 13 | async 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"] | ||
| 5 | mod common; | ||
| 4 | 6 | ||
| 5 | // required-features: chrono | ||
| 6 | |||
| 7 | #[path = "../example_common.rs"] | ||
| 8 | mod example_common; | ||
| 9 | use chrono::{NaiveDate, NaiveDateTime}; | 7 | use chrono::{NaiveDate, NaiveDateTime}; |
| 8 | use common::*; | ||
| 10 | use defmt::assert; | 9 | use defmt::assert; |
| 11 | use embassy_executor::Spawner; | 10 | use embassy_executor::Spawner; |
| 12 | use embassy_stm32::pac; | 11 | use embassy_stm32::pac; |
| 13 | use embassy_stm32::rtc::{Rtc, RtcConfig}; | 12 | use embassy_stm32::rtc::{Rtc, RtcConfig}; |
| 14 | use embassy_time::{Duration, Timer}; | 13 | use embassy_time::{Duration, Timer}; |
| 15 | use example_common::*; | ||
| 16 | 14 | ||
| 17 | #[embassy_executor::main] | 15 | #[embassy_executor::main] |
| 18 | async fn main(_spawner: Spawner) { | 16 | async 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"] | ||
| 6 | mod common; | ||
| 5 | 7 | ||
| 6 | use defmt::{assert_eq, *}; | 8 | use defmt::{assert_eq, *}; |
| 7 | use embassy_executor::Spawner; | 9 | use 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"] | ||
| 5 | mod common; | ||
| 4 | 6 | ||
| 5 | #[path = "../example_common.rs"] | 7 | use common::*; |
| 6 | mod example_common; | ||
| 7 | use defmt::assert_eq; | 8 | use defmt::assert_eq; |
| 8 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 9 | use embassy_stm32::dma::NoDma; | 10 | use embassy_stm32::dma::NoDma; |
| 10 | use embassy_stm32::spi::{self, Spi}; | 11 | use embassy_stm32::spi::{self, Spi}; |
| 11 | use embassy_stm32::time::Hertz; | 12 | use embassy_stm32::time::Hertz; |
| 12 | use example_common::*; | ||
| 13 | 13 | ||
| 14 | #[embassy_executor::main] | 14 | #[embassy_executor::main] |
| 15 | async fn main(_spawner: Spawner) { | 15 | async 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"] | ||
| 5 | mod common; | ||
| 4 | 6 | ||
| 5 | #[path = "../example_common.rs"] | 7 | use common::*; |
| 6 | mod example_common; | ||
| 7 | use defmt::assert_eq; | 8 | use defmt::assert_eq; |
| 8 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 9 | use embassy_stm32::spi::{self, Spi}; | 10 | use embassy_stm32::spi::{self, Spi}; |
| 10 | use embassy_stm32::time::Hertz; | 11 | use embassy_stm32::time::Hertz; |
| 11 | use example_common::*; | ||
| 12 | 12 | ||
| 13 | #[embassy_executor::main] | 13 | #[embassy_executor::main] |
| 14 | async fn main(_spawner: Spawner) { | 14 | async 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"] | ||
| 5 | mod common; | ||
| 4 | 6 | ||
| 5 | #[path = "../example_common.rs"] | 7 | use common::*; |
| 6 | mod example_common; | ||
| 7 | use defmt::assert; | 8 | use defmt::assert; |
| 8 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 9 | use embassy_time::{Duration, Instant, Timer}; | 10 | use embassy_time::{Duration, Instant, Timer}; |
| 10 | use example_common::*; | ||
| 11 | 11 | ||
| 12 | #[embassy_executor::main] | 12 | #[embassy_executor::main] |
| 13 | async fn main(_spawner: Spawner) { | 13 | async 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"] | ||
| 7 | mod common; | ||
| 4 | 8 | ||
| 5 | // required-features: ble | 9 | use common::*; |
| 6 | |||
| 7 | #[path = "../example_common.rs"] | ||
| 8 | mod example_common; | ||
| 9 | use embassy_executor::Spawner; | 10 | use embassy_executor::Spawner; |
| 10 | use embassy_stm32::tl_mbox::{Config, TlMbox}; | 11 | use embassy_stm32::tl_mbox::{Config, TlMbox}; |
| 11 | use embassy_stm32::{bind_interrupts, tl_mbox}; | 12 | use embassy_stm32::{bind_interrupts, tl_mbox}; |
| 12 | use embassy_time::{Duration, Timer}; | 13 | use embassy_time::{Duration, Timer}; |
| 13 | use example_common::*; | ||
| 14 | 14 | ||
| 15 | bind_interrupts!(struct Irqs{ | 15 | bind_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"] | ||
| 5 | mod common; | ||
| 4 | 6 | ||
| 5 | #[path = "../example_common.rs"] | 7 | use common::*; |
| 6 | mod example_common; | ||
| 7 | use defmt::assert_eq; | 8 | use defmt::assert_eq; |
| 8 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 9 | use embassy_stm32::dma::NoDma; | 10 | use embassy_stm32::dma::NoDma; |
| 10 | use embassy_stm32::usart::{Config, Error, Uart}; | 11 | use embassy_stm32::usart::{Config, Error, Uart}; |
| 11 | use embassy_stm32::{bind_interrupts, peripherals, usart}; | 12 | use embassy_stm32::{bind_interrupts, peripherals, usart}; |
| 12 | use embassy_time::{Duration, Instant}; | 13 | use embassy_time::{Duration, Instant}; |
| 13 | use 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"] | ||
| 5 | mod common; | ||
| 4 | 6 | ||
| 5 | #[path = "../example_common.rs"] | 7 | use common::*; |
| 6 | mod example_common; | ||
| 7 | use defmt::assert_eq; | 8 | use defmt::assert_eq; |
| 8 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 9 | use embassy_futures::join::join; | 10 | use embassy_futures::join::join; |
| 10 | use embassy_stm32::usart::{Config, Uart}; | 11 | use embassy_stm32::usart::{Config, Uart}; |
| 11 | use embassy_stm32::{bind_interrupts, peripherals, usart}; | 12 | use embassy_stm32::{bind_interrupts, peripherals, usart}; |
| 12 | use 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"] | ||
| 7 | mod common; | ||
| 6 | 8 | ||
| 7 | #[path = "../example_common.rs"] | 9 | use common::*; |
| 8 | mod example_common; | ||
| 9 | use defmt::{assert_eq, panic}; | 10 | use defmt::{assert_eq, panic}; |
| 10 | use embassy_executor::Spawner; | 11 | use embassy_executor::Spawner; |
| 11 | use embassy_stm32::usart::{Config, DataBits, Parity, RingBufferedUartRx, StopBits, Uart, UartTx}; | 12 | use embassy_stm32::usart::{Config, DataBits, Parity, RingBufferedUartRx, StopBits, Uart, UartTx}; |
| 12 | use embassy_stm32::{bind_interrupts, peripherals, usart}; | 13 | use embassy_stm32::{bind_interrupts, peripherals, usart}; |
| 13 | use embassy_time::{Duration, Timer}; | 14 | use embassy_time::{Duration, Timer}; |
| 14 | use example_common::*; | ||
| 15 | use rand_chacha::ChaCha8Rng; | 15 | use rand_chacha::ChaCha8Rng; |
| 16 | use rand_core::{RngCore, SeedableRng}; | 16 | use 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 | |||
| 3 | pub use defmt::*; | ||
| 4 | #[allow(unused)] | ||
| 5 | use embassy_stm32::time::Hertz; | ||
| 6 | use embassy_stm32::Config; | ||
| 7 | use {defmt_rtt as _, panic_probe as _}; | ||
| 8 | |||
| 9 | #[cfg(feature = "stm32f103c8")] | ||
| 10 | teleprobe_meta::target!(b"bluepill-stm32f103c8"); | ||
| 11 | #[cfg(feature = "stm32g491re")] | ||
| 12 | teleprobe_meta::target!(b"nucleo-stm32g491re"); | ||
| 13 | #[cfg(feature = "stm32g071rb")] | ||
| 14 | teleprobe_meta::target!(b"nucleo-stm32g071rb"); | ||
| 15 | #[cfg(feature = "stm32f429zi")] | ||
| 16 | teleprobe_meta::target!(b"nucleo-stm32f429zi"); | ||
| 17 | #[cfg(feature = "stm32wb55rg")] | ||
| 18 | teleprobe_meta::target!(b"nucleo-stm32wb55rg"); | ||
| 19 | #[cfg(feature = "stm32h755zi")] | ||
| 20 | teleprobe_meta::target!(b"nucleo-stm32h755zi"); | ||
| 21 | #[cfg(feature = "stm32u585ai")] | ||
| 22 | teleprobe_meta::target!(b"iot-stm32u585ai"); | ||
| 23 | #[cfg(feature = "stm32h563zi")] | ||
| 24 | teleprobe_meta::target!(b"nucleo-stm32h563zi"); | ||
| 25 | #[cfg(feature = "stm32c031c6")] | ||
| 26 | teleprobe_meta::target!(b"nucleo-stm32c031c6"); | ||
| 27 | |||
| 28 | pub 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 | |||
| 3 | pub use defmt::*; | ||
| 4 | #[allow(unused)] | ||
| 5 | use embassy_stm32::time::Hertz; | ||
| 6 | use embassy_stm32::Config; | ||
| 7 | use {defmt_rtt as _, panic_probe as _}; | ||
| 8 | |||
| 9 | pub 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 | } | ||
