From e39fd4a7361ef58163adbb3adf6a83c1294f75e8 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Thu, 24 Feb 2022 00:19:26 +0100 Subject: [PATCH] stm32: add stm32f103 bluepill to HIL tests. --- ci.sh | 1 + tests/stm32/.cargo/config.toml | 7 +++---- tests/stm32/Cargo.toml | 1 + tests/stm32/src/bin/gpio.rs | 2 ++ tests/stm32/src/bin/spi_dma.rs | 2 ++ tests/stm32/src/bin/usart.rs | 2 ++ tests/stm32/src/bin/usart_dma.rs | 2 ++ 7 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ci.sh b/ci.sh index 032affa1b..91c7cd3ba 100755 --- a/ci.sh +++ b/ci.sh @@ -73,6 +73,7 @@ cargo batch \ --- build --release --manifest-path examples/stm32wb55/Cargo.toml --target thumbv7em-none-eabihf --out-dir out/examples/stm32wb55 \ --- build --release --manifest-path examples/stm32wl55/Cargo.toml --target thumbv7em-none-eabihf --out-dir out/examples/stm32wl55 \ --- build --release --manifest-path examples/wasm/Cargo.toml --target wasm32-unknown-unknown --out-dir out/examples/wasm \ + --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f103c8 --out-dir out/tests/bluepill-stm32f103c8 \ --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi --out-dir out/tests/nucleo-stm32f429zi \ --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g491re --out-dir out/tests/nucleo-stm32g491re \ --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32g071rb --out-dir out/tests/nucleo-stm32g071rb \ diff --git a/tests/stm32/.cargo/config.toml b/tests/stm32/.cargo/config.toml index 586a63875..eafab3ed0 100644 --- a/tests/stm32/.cargo/config.toml +++ b/tests/stm32/.cargo/config.toml @@ -3,9 +3,8 @@ build-std = ["core"] build-std-features = ["panic_immediate_abort"] [target.'cfg(all(target_arch = "arm", target_os = "none"))'] -# replace STM32F429ZITx with your chip as listed in `probe-run --list-chips` -#runner = "teleprobe run --chip STM32G071RBTx --elf" -runner = "./teleprobe.sh nucleo-stm32f429zi" +runner = "teleprobe client run --target bluepill-stm32f103c8 --elf" +#runner = "teleprobe local run --chip STM32F103C8 --elf" rustflags = [ # Code-size optimizations. @@ -15,4 +14,4 @@ rustflags = [ ] [build] -target = "thumbv7em-none-eabi" +target = "thumbv7m-none-eabi" diff --git a/tests/stm32/Cargo.toml b/tests/stm32/Cargo.toml index 8d0901091..041ec76ad 100644 --- a/tests/stm32/Cargo.toml +++ b/tests/stm32/Cargo.toml @@ -6,6 +6,7 @@ version = "0.1.0" resolver = "2" [features] +stm32f103c8 = ["embassy-stm32/stm32f103c8"] stm32f429zi = ["embassy-stm32/stm32f429zi"] stm32g071rb = ["embassy-stm32/stm32g071rb"] stm32g491re = ["embassy-stm32/stm32g491re"] diff --git a/tests/stm32/src/bin/gpio.rs b/tests/stm32/src/bin/gpio.rs index 305da8d12..41c10d45f 100644 --- a/tests/stm32/src/bin/gpio.rs +++ b/tests/stm32/src/bin/gpio.rs @@ -16,6 +16,8 @@ async fn main(_spawner: Spawner, p: Peripherals) { // Arduino pins D0 and D1 // They're connected together with a 1K resistor. + #[cfg(feature = "stm32f103c8")] + let (mut a, mut b) = (p.PA9, p.PA10); #[cfg(feature = "stm32g491re")] let (mut a, mut b) = (p.PC4, p.PC5); #[cfg(feature = "stm32g071rb")] diff --git a/tests/stm32/src/bin/spi_dma.rs b/tests/stm32/src/bin/spi_dma.rs index bf682e097..f224d3446 100644 --- a/tests/stm32/src/bin/spi_dma.rs +++ b/tests/stm32/src/bin/spi_dma.rs @@ -15,6 +15,8 @@ use example_common::*; async fn main(_spawner: Spawner, p: Peripherals) { info!("Hello World!"); + #[cfg(feature = "stm32f103c8")] + let (sck, mosi, miso, tx_dma, rx_dma) = (p.PA5, p.PA7, p.PA6, p.DMA1_CH3, p.DMA1_CH2); #[cfg(feature = "stm32f429zi")] let (sck, mosi, miso, tx_dma, rx_dma) = (p.PA5, p.PA7, p.PA6, p.DMA2_CH3, p.DMA2_CH2); #[cfg(feature = "stm32h755zi")] diff --git a/tests/stm32/src/bin/usart.rs b/tests/stm32/src/bin/usart.rs index 44ee730e4..87a593ca5 100644 --- a/tests/stm32/src/bin/usart.rs +++ b/tests/stm32/src/bin/usart.rs @@ -23,6 +23,8 @@ async fn main(_spawner: Spawner, p: Peripherals) { // Arduino pins D0 and D1 // They're connected together with a 1K resistor. + #[cfg(feature = "stm32f103c8")] + let (tx, rx, usart) = (p.PA9, p.PA10, p.USART1); #[cfg(feature = "stm32g491re")] let (tx, rx, usart) = (p.PC4, p.PC5, p.USART1); #[cfg(feature = "stm32g071rb")] diff --git a/tests/stm32/src/bin/usart_dma.rs b/tests/stm32/src/bin/usart_dma.rs index 37faaf376..3cf9c7860 100644 --- a/tests/stm32/src/bin/usart_dma.rs +++ b/tests/stm32/src/bin/usart_dma.rs @@ -22,6 +22,8 @@ async fn main(_spawner: Spawner, p: Peripherals) { // Arduino pins D0 and D1 // They're connected together with a 1K resistor. + #[cfg(feature = "stm32f103c8")] + let (tx, rx, usart, tx_dma, rx_dma) = (p.PA9, p.PA10, p.USART1, p.DMA1_CH4, p.DMA1_CH5); #[cfg(feature = "stm32g491re")] let (tx, rx, usart, tx_dma, rx_dma) = (p.PC4, p.PC5, p.USART1, p.DMA1_CH0, p.DMA1_CH1); #[cfg(feature = "stm32g071rb")]