diff options
| author | Dario Nieuwenhuis <[email protected]> | 2025-07-23 10:25:57 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-23 10:25:57 +0000 |
| commit | 60ed376a19f8f0401f13f4cdc065452f9cf3ddd7 (patch) | |
| tree | a0431af5418724966a2d5a5df000a1b88a5d6b38 | |
| parent | efc2306e6aaefd83250581e6607e0fbb0329a388 (diff) | |
| parent | e9211682a1a7067ae3a1fac36f94d981aab44912 (diff) | |
Merge pull request #4429 from obe1line/obe1line-stm32c071
Updates to support stm32c071
| -rwxr-xr-x | ci.sh | 6 | ||||
| -rw-r--r-- | embassy-stm32/Cargo.toml | 45 | ||||
| -rw-r--r-- | embassy-stm32/src/flash/u5.rs | 26 | ||||
| -rw-r--r-- | embassy-stm32/src/rcc/c0.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/rcc/hsi48.rs | 4 | ||||
| -rw-r--r-- | embassy-stm32/src/rcc/mco.rs | 2 | ||||
| -rw-r--r-- | tests/stm32/Cargo.toml | 1 | ||||
| -rw-r--r-- | tests/stm32/build.rs | 1 | ||||
| -rw-r--r-- | tests/stm32/src/common.rs | 10 |
9 files changed, 76 insertions, 21 deletions
| @@ -102,6 +102,8 @@ cargo batch \ | |||
| 102 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,dual-bank,defmt,exti \ | 102 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,dual-bank,defmt,exti \ |
| 103 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,dual-bank,defmt \ | 103 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,dual-bank,defmt \ |
| 104 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,single-bank,defmt \ | 104 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features stm32l552ze,single-bank,defmt \ |
| 105 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32c071rb,defmt,exti,time-driver-any,time \ | ||
| 106 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32c051f6,defmt,exti,time-driver-any,time \ | ||
| 105 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32f038f6,defmt,exti,time-driver-any,time \ | 107 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32f038f6,defmt,exti,time-driver-any,time \ |
| 106 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32f030c6,defmt,exti,time-driver-any,time \ | 108 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32f030c6,defmt,exti,time-driver-any,time \ |
| 107 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32f058t8,defmt,exti,time-driver-any,time \ | 109 | --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32f058t8,defmt,exti,time-driver-any,time \ |
| @@ -303,6 +305,7 @@ cargo batch \ | |||
| 303 | --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g491re --artifact-dir out/tests/stm32g491re \ | 305 | --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g491re --artifact-dir out/tests/stm32g491re \ |
| 304 | --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32g071rb --artifact-dir out/tests/stm32g071rb \ | 306 | --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32g071rb --artifact-dir out/tests/stm32g071rb \ |
| 305 | --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32c031c6 --artifact-dir out/tests/stm32c031c6 \ | 307 | --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32c031c6 --artifact-dir out/tests/stm32c031c6 \ |
| 308 | --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32c071rb --artifact-dir out/tests/stm32c071rb \ | ||
| 306 | --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi --artifact-dir out/tests/stm32h755zi \ | 309 | --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi --artifact-dir out/tests/stm32h755zi \ |
| 307 | --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h753zi --artifact-dir out/tests/stm32h753zi \ | 310 | --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h753zi --artifact-dir out/tests/stm32h753zi \ |
| 308 | --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h7a3zi --artifact-dir out/tests/stm32h7a3zi \ | 311 | --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h7a3zi --artifact-dir out/tests/stm32h7a3zi \ |
| @@ -382,6 +385,9 @@ rm out/tests/pimoroni-pico-plus-2/pwm | |||
| 382 | rm out/tests/rpi-pico/pwm | 385 | rm out/tests/rpi-pico/pwm |
| 383 | rm out/tests/rpi-pico/cyw43-perf | 386 | rm out/tests/rpi-pico/cyw43-perf |
| 384 | 387 | ||
| 388 | # tests are implemented but the HIL test farm doesn't actually have this board yet | ||
| 389 | rm -rf out/tests/stm32c071rb | ||
| 390 | |||
| 385 | if [[ -z "${TELEPROBE_TOKEN-}" ]]; then | 391 | if [[ -z "${TELEPROBE_TOKEN-}" ]]; then |
| 386 | echo No teleprobe token found, skipping running HIL tests | 392 | echo No teleprobe token found, skipping running HIL tests |
| 387 | exit | 393 | exit |
diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml index 43aee4e1a..38254ee40 100644 --- a/embassy-stm32/Cargo.toml +++ b/embassy-stm32/Cargo.toml | |||
| @@ -81,7 +81,7 @@ futures-util = { version = "0.3.30", default-features = false } | |||
| 81 | sdio-host = "0.9.0" | 81 | sdio-host = "0.9.0" |
| 82 | critical-section = "1.1" | 82 | critical-section = "1.1" |
| 83 | #stm32-metapac = { version = "16" } | 83 | #stm32-metapac = { version = "16" } |
| 84 | stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-dded8a33a460ae0eb182aee3ccb048beb659982b" } | 84 | stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-9fc86ca7b3a8bc05182bf1ce3045602df1f5dce3" } |
| 85 | 85 | ||
| 86 | vcell = "0.1.3" | 86 | vcell = "0.1.3" |
| 87 | nb = "1.0.0" | 87 | nb = "1.0.0" |
| @@ -110,7 +110,7 @@ proc-macro2 = "1.0.36" | |||
| 110 | quote = "1.0.15" | 110 | quote = "1.0.15" |
| 111 | 111 | ||
| 112 | #stm32-metapac = { version = "16", default-features = false, features = ["metadata"]} | 112 | #stm32-metapac = { version = "16", default-features = false, features = ["metadata"]} |
| 113 | stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-dded8a33a460ae0eb182aee3ccb048beb659982b", default-features = false, features = ["metadata"] } | 113 | stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-9fc86ca7b3a8bc05182bf1ce3045602df1f5dce3", default-features = false, features = ["metadata"] } |
| 114 | 114 | ||
| 115 | [features] | 115 | [features] |
| 116 | default = ["rt"] | 116 | default = ["rt"] |
| @@ -237,6 +237,47 @@ stm32c031g4 = [ "stm32-metapac/stm32c031g4" ] | |||
| 237 | stm32c031g6 = [ "stm32-metapac/stm32c031g6" ] | 237 | stm32c031g6 = [ "stm32-metapac/stm32c031g6" ] |
| 238 | stm32c031k4 = [ "stm32-metapac/stm32c031k4" ] | 238 | stm32c031k4 = [ "stm32-metapac/stm32c031k4" ] |
| 239 | stm32c031k6 = [ "stm32-metapac/stm32c031k6" ] | 239 | stm32c031k6 = [ "stm32-metapac/stm32c031k6" ] |
| 240 | stm32c051c6 = [ "stm32-metapac/stm32c051c6" ] | ||
| 241 | stm32c051c8 = [ "stm32-metapac/stm32c051c8" ] | ||
| 242 | stm32c051d8 = [ "stm32-metapac/stm32c051d8" ] | ||
| 243 | stm32c051f6 = [ "stm32-metapac/stm32c051f6" ] | ||
| 244 | stm32c051f8 = [ "stm32-metapac/stm32c051f8" ] | ||
| 245 | stm32c051g6 = [ "stm32-metapac/stm32c051g6" ] | ||
| 246 | stm32c051g8 = [ "stm32-metapac/stm32c051g8" ] | ||
| 247 | stm32c051k6 = [ "stm32-metapac/stm32c051k6" ] | ||
| 248 | stm32c051k8 = [ "stm32-metapac/stm32c051k8" ] | ||
| 249 | stm32c071c8 = [ "stm32-metapac/stm32c071c8" ] | ||
| 250 | stm32c071cb = [ "stm32-metapac/stm32c071cb" ] | ||
| 251 | stm32c071f8 = [ "stm32-metapac/stm32c071f8" ] | ||
| 252 | stm32c071fb = [ "stm32-metapac/stm32c071fb" ] | ||
| 253 | stm32c071g8 = [ "stm32-metapac/stm32c071g8" ] | ||
| 254 | stm32c071gb = [ "stm32-metapac/stm32c071gb" ] | ||
| 255 | stm32c071k8 = [ "stm32-metapac/stm32c071k8" ] | ||
| 256 | stm32c071kb = [ "stm32-metapac/stm32c071kb" ] | ||
| 257 | stm32c071r8 = [ "stm32-metapac/stm32c071r8" ] | ||
| 258 | stm32c071rb = [ "stm32-metapac/stm32c071rb" ] | ||
| 259 | stm32c091cb = [ "stm32-metapac/stm32c091cb" ] | ||
| 260 | stm32c091cc = [ "stm32-metapac/stm32c091cc" ] | ||
| 261 | stm32c091ec = [ "stm32-metapac/stm32c091ec" ] | ||
| 262 | stm32c091fb = [ "stm32-metapac/stm32c091fb" ] | ||
| 263 | stm32c091fc = [ "stm32-metapac/stm32c091fc" ] | ||
| 264 | stm32c091gb = [ "stm32-metapac/stm32c091gb" ] | ||
| 265 | stm32c091gc = [ "stm32-metapac/stm32c091gc" ] | ||
| 266 | stm32c091kb = [ "stm32-metapac/stm32c091kb" ] | ||
| 267 | stm32c091kc = [ "stm32-metapac/stm32c091kc" ] | ||
| 268 | stm32c091rb = [ "stm32-metapac/stm32c091rb" ] | ||
| 269 | stm32c091rc = [ "stm32-metapac/stm32c091rc" ] | ||
| 270 | stm32c092cb = [ "stm32-metapac/stm32c092cb" ] | ||
| 271 | stm32c092cc = [ "stm32-metapac/stm32c092cc" ] | ||
| 272 | stm32c092ec = [ "stm32-metapac/stm32c092ec" ] | ||
| 273 | stm32c092fb = [ "stm32-metapac/stm32c092fb" ] | ||
| 274 | stm32c092fc = [ "stm32-metapac/stm32c092fc" ] | ||
| 275 | stm32c092gb = [ "stm32-metapac/stm32c092gb" ] | ||
| 276 | stm32c092gc = [ "stm32-metapac/stm32c092gc" ] | ||
| 277 | stm32c092kb = [ "stm32-metapac/stm32c092kb" ] | ||
| 278 | stm32c092kc = [ "stm32-metapac/stm32c092kc" ] | ||
| 279 | stm32c092rb = [ "stm32-metapac/stm32c092rb" ] | ||
| 280 | stm32c092rc = [ "stm32-metapac/stm32c092rc" ] | ||
| 240 | stm32f030c6 = [ "stm32-metapac/stm32f030c6" ] | 281 | stm32f030c6 = [ "stm32-metapac/stm32f030c6" ] |
| 241 | stm32f030c8 = [ "stm32-metapac/stm32f030c8" ] | 282 | stm32f030c8 = [ "stm32-metapac/stm32f030c8" ] |
| 242 | stm32f030cc = [ "stm32-metapac/stm32f030cc" ] | 283 | stm32f030cc = [ "stm32-metapac/stm32f030cc" ] |
diff --git a/embassy-stm32/src/flash/u5.rs b/embassy-stm32/src/flash/u5.rs index 131caa195..6c3d4b422 100644 --- a/embassy-stm32/src/flash/u5.rs +++ b/embassy-stm32/src/flash/u5.rs | |||
| @@ -30,19 +30,19 @@ pub(crate) unsafe fn enable_blocking_write() { | |||
| 30 | 30 | ||
| 31 | #[cfg(feature = "trustzone-secure")] | 31 | #[cfg(feature = "trustzone-secure")] |
| 32 | pac::FLASH.seccr().write(|w| { | 32 | pac::FLASH.seccr().write(|w| { |
| 33 | w.set_pg(pac::flash::vals::SeccrPg::B_0X1); | 33 | w.set_pg(true); |
| 34 | }); | 34 | }); |
| 35 | #[cfg(not(feature = "trustzone-secure"))] | 35 | #[cfg(not(feature = "trustzone-secure"))] |
| 36 | pac::FLASH.nscr().write(|w| { | 36 | pac::FLASH.nscr().write(|w| { |
| 37 | w.set_pg(pac::flash::vals::NscrPg::B_0X1); | 37 | w.set_pg(true); |
| 38 | }); | 38 | }); |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | pub(crate) unsafe fn disable_blocking_write() { | 41 | pub(crate) unsafe fn disable_blocking_write() { |
| 42 | #[cfg(feature = "trustzone-secure")] | 42 | #[cfg(feature = "trustzone-secure")] |
| 43 | pac::FLASH.seccr().write(|w| w.set_pg(pac::flash::vals::SeccrPg::B_0X0)); | 43 | pac::FLASH.seccr().write(|w| w.set_pg(false)); |
| 44 | #[cfg(not(feature = "trustzone-secure"))] | 44 | #[cfg(not(feature = "trustzone-secure"))] |
| 45 | pac::FLASH.nscr().write(|w| w.set_pg(pac::flash::vals::NscrPg::B_0X0)); | 45 | pac::FLASH.nscr().write(|w| w.set_pg(false)); |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | pub(crate) unsafe fn blocking_write(start_address: u32, buf: &[u8; WRITE_SIZE]) -> Result<(), Error> { | 48 | pub(crate) unsafe fn blocking_write(start_address: u32, buf: &[u8; WRITE_SIZE]) -> Result<(), Error> { |
| @@ -65,19 +65,19 @@ pub(crate) unsafe fn blocking_erase_sector(sector: &FlashSector) -> Result<(), E | |||
| 65 | w.set_pnb(sector.index_in_bank); | 65 | w.set_pnb(sector.index_in_bank); |
| 66 | // TODO: add check for bank swap | 66 | // TODO: add check for bank swap |
| 67 | w.set_bker(match sector.bank { | 67 | w.set_bker(match sector.bank { |
| 68 | FlashBank::Bank1 => pac::flash::vals::SeccrBker::B_0X0, | 68 | FlashBank::Bank1 => false, |
| 69 | FlashBank::Bank2 => pac::flash::vals::SeccrBker::B_0X1, | 69 | FlashBank::Bank2 => true, |
| 70 | _ => unreachable!(), | 70 | _ => unreachable!(), |
| 71 | }); | 71 | }); |
| 72 | }); | 72 | }); |
| 73 | #[cfg(not(feature = "trustzone-secure"))] | 73 | #[cfg(not(feature = "trustzone-secure"))] |
| 74 | pac::FLASH.nscr().modify(|w| { | 74 | pac::FLASH.nscr().modify(|w| { |
| 75 | w.set_per(pac::flash::vals::NscrPer::B_0X1); | 75 | w.set_per(true); |
| 76 | w.set_pnb(sector.index_in_bank); | 76 | w.set_pnb(sector.index_in_bank); |
| 77 | // TODO: add check for bank swap | 77 | // TODO: add check for bank swap |
| 78 | w.set_bker(match sector.bank { | 78 | w.set_bker(match sector.bank { |
| 79 | FlashBank::Bank1 => pac::flash::vals::NscrBker::B_0X0, | 79 | FlashBank::Bank1 => false, |
| 80 | FlashBank::Bank2 => pac::flash::vals::NscrBker::B_0X1, | 80 | FlashBank::Bank2 => true, |
| 81 | _ => unreachable!(), | 81 | _ => unreachable!(), |
| 82 | }); | 82 | }); |
| 83 | }); | 83 | }); |
| @@ -93,13 +93,9 @@ pub(crate) unsafe fn blocking_erase_sector(sector: &FlashSector) -> Result<(), E | |||
| 93 | 93 | ||
| 94 | let ret: Result<(), Error> = blocking_wait_ready(); | 94 | let ret: Result<(), Error> = blocking_wait_ready(); |
| 95 | #[cfg(feature = "trustzone-secure")] | 95 | #[cfg(feature = "trustzone-secure")] |
| 96 | pac::FLASH | 96 | pac::FLASH.seccr().modify(|w| w.set_per(false)); |
| 97 | .seccr() | ||
| 98 | .modify(|w| w.set_per(pac::flash::vals::SeccrPer::B_0X0)); | ||
| 99 | #[cfg(not(feature = "trustzone-secure"))] | 97 | #[cfg(not(feature = "trustzone-secure"))] |
| 100 | pac::FLASH | 98 | pac::FLASH.nscr().modify(|w| w.set_per(false)); |
| 101 | .nscr() | ||
| 102 | .modify(|w| w.set_per(pac::flash::vals::NscrPer::B_0X0)); | ||
| 103 | clear_all_err(); | 99 | clear_all_err(); |
| 104 | ret | 100 | ret |
| 105 | } | 101 | } |
diff --git a/embassy-stm32/src/rcc/c0.rs b/embassy-stm32/src/rcc/c0.rs index cac2a9149..c2295bab6 100644 --- a/embassy-stm32/src/rcc/c0.rs +++ b/embassy-stm32/src/rcc/c0.rs | |||
| @@ -190,6 +190,8 @@ pub(crate) unsafe fn init(config: Config) { | |||
| 190 | // TODO | 190 | // TODO |
| 191 | lsi: None, | 191 | lsi: None, |
| 192 | lse: None, | 192 | lse: None, |
| 193 | #[cfg(crs)] | ||
| 194 | hsi48: None, | ||
| 193 | ); | 195 | ); |
| 194 | 196 | ||
| 195 | RCC.ccipr() | 197 | RCC.ccipr() |
diff --git a/embassy-stm32/src/rcc/hsi48.rs b/embassy-stm32/src/rcc/hsi48.rs index 3ea5c96c9..49be4af5e 100644 --- a/embassy-stm32/src/rcc/hsi48.rs +++ b/embassy-stm32/src/rcc/hsi48.rs | |||
| @@ -39,9 +39,9 @@ pub(crate) fn init_hsi48(config: Hsi48Config) -> Hertz { | |||
| 39 | }); | 39 | }); |
| 40 | 40 | ||
| 41 | // Enable HSI48 | 41 | // Enable HSI48 |
| 42 | #[cfg(not(any(stm32u5, stm32g0, stm32h5, stm32h7, stm32h7rs, stm32u5, stm32wba, stm32f0)))] | 42 | #[cfg(not(any(stm32u5, stm32g0, stm32h5, stm32h7, stm32h7rs, stm32u5, stm32wba, stm32f0, stm32c071)))] |
| 43 | let r = RCC.crrcr(); | 43 | let r = RCC.crrcr(); |
| 44 | #[cfg(any(stm32u5, stm32g0, stm32h5, stm32h7, stm32h7rs, stm32u5, stm32wba))] | 44 | #[cfg(any(stm32u5, stm32g0, stm32h5, stm32h7, stm32h7rs, stm32u5, stm32wba, stm32c071))] |
| 45 | let r = RCC.cr(); | 45 | let r = RCC.cr(); |
| 46 | #[cfg(any(stm32f0))] | 46 | #[cfg(any(stm32f0))] |
| 47 | let r = RCC.cr2(); | 47 | let r = RCC.cr2(); |
diff --git a/embassy-stm32/src/rcc/mco.rs b/embassy-stm32/src/rcc/mco.rs index 0371b9141..96e628b1a 100644 --- a/embassy-stm32/src/rcc/mco.rs +++ b/embassy-stm32/src/rcc/mco.rs | |||
| @@ -74,7 +74,7 @@ macro_rules! impl_peri { | |||
| 74 | }; | 74 | }; |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | #[cfg(any(rcc_c0, rcc_g0x0, rcc_g0x1, rcc_u0))] | 77 | #[cfg(any(rcc_c0, rcc_c0v2, rcc_g0x0, rcc_g0x1, rcc_u0))] |
| 78 | #[allow(unused_imports)] | 78 | #[allow(unused_imports)] |
| 79 | use self::{McoSource as Mco1Source, McoSource as Mco2Source}; | 79 | use self::{McoSource as Mco1Source, McoSource as Mco2Source}; |
| 80 | 80 | ||
diff --git a/tests/stm32/Cargo.toml b/tests/stm32/Cargo.toml index 8d10f6593..7c32c0ce1 100644 --- a/tests/stm32/Cargo.toml +++ b/tests/stm32/Cargo.toml | |||
| @@ -7,6 +7,7 @@ autobins = false | |||
| 7 | 7 | ||
| 8 | [features] | 8 | [features] |
| 9 | stm32c031c6 = ["embassy-stm32/stm32c031c6", "cm0", "not-gpdma"] | 9 | stm32c031c6 = ["embassy-stm32/stm32c031c6", "cm0", "not-gpdma"] |
| 10 | stm32c071rb = ["embassy-stm32/stm32c071rb", "cm0", "not-gpdma"] | ||
| 10 | stm32f103c8 = ["embassy-stm32/stm32f103c8", "spi-v1", "not-gpdma"] | 11 | stm32f103c8 = ["embassy-stm32/stm32f103c8", "spi-v1", "not-gpdma"] |
| 11 | stm32f207zg = ["embassy-stm32/stm32f207zg", "spi-v1", "chrono", "not-gpdma", "eth", "rng"] | 12 | stm32f207zg = ["embassy-stm32/stm32f207zg", "spi-v1", "chrono", "not-gpdma", "eth", "rng"] |
| 12 | stm32f303ze = ["embassy-stm32/stm32f303ze", "chrono", "not-gpdma"] | 13 | stm32f303ze = ["embassy-stm32/stm32f303ze", "chrono", "not-gpdma"] |
diff --git a/tests/stm32/build.rs b/tests/stm32/build.rs index 722671bf1..556d77a20 100644 --- a/tests/stm32/build.rs +++ b/tests/stm32/build.rs | |||
| @@ -12,6 +12,7 @@ fn main() -> Result<(), Box<dyn Error>> { | |||
| 12 | // too little RAM to run from RAM. | 12 | // too little RAM to run from RAM. |
| 13 | feature = "stm32f103c8", // 20 kb | 13 | feature = "stm32f103c8", // 20 kb |
| 14 | feature = "stm32c031c6", // 6 kb | 14 | feature = "stm32c031c6", // 6 kb |
| 15 | feature = "stm32c071rb", // 24 kb | ||
| 15 | feature = "stm32l073rz", // 20 kb | 16 | feature = "stm32l073rz", // 20 kb |
| 16 | feature = "stm32h503rb", // 32 kb | 17 | feature = "stm32h503rb", // 32 kb |
| 17 | // no VTOR, so interrupts can't work when running from RAM | 18 | // no VTOR, so interrupts can't work when running from RAM |
diff --git a/tests/stm32/src/common.rs b/tests/stm32/src/common.rs index 829f2cff0..a4d8048ce 100644 --- a/tests/stm32/src/common.rs +++ b/tests/stm32/src/common.rs | |||
| @@ -34,6 +34,8 @@ teleprobe_meta::target!(b"nucleo-stm32u5a5zj"); | |||
| 34 | teleprobe_meta::target!(b"nucleo-stm32h563zi"); | 34 | teleprobe_meta::target!(b"nucleo-stm32h563zi"); |
| 35 | #[cfg(feature = "stm32c031c6")] | 35 | #[cfg(feature = "stm32c031c6")] |
| 36 | teleprobe_meta::target!(b"nucleo-stm32c031c6"); | 36 | teleprobe_meta::target!(b"nucleo-stm32c031c6"); |
| 37 | #[cfg(feature = "stm32c071rb")] | ||
| 38 | teleprobe_meta::target!(b"nucleo-stm32c071rb"); | ||
| 37 | #[cfg(feature = "stm32l073rz")] | 39 | #[cfg(feature = "stm32l073rz")] |
| 38 | teleprobe_meta::target!(b"nucleo-stm32l073rz"); | 40 | teleprobe_meta::target!(b"nucleo-stm32l073rz"); |
| 39 | #[cfg(feature = "stm32l152re")] | 41 | #[cfg(feature = "stm32l152re")] |
| @@ -186,6 +188,12 @@ define_peris!( | |||
| 186 | SPI = SPI1, SPI_SCK = PA5, SPI_MOSI = PA7, SPI_MISO = PA6, SPI_TX_DMA = DMA1_CH1, SPI_RX_DMA = DMA1_CH2, | 188 | SPI = SPI1, SPI_SCK = PA5, SPI_MOSI = PA7, SPI_MISO = PA6, SPI_TX_DMA = DMA1_CH1, SPI_RX_DMA = DMA1_CH2, |
| 187 | @irq UART = {USART1 => embassy_stm32::usart::InterruptHandler<embassy_stm32::peripherals::USART1>;}, | 189 | @irq UART = {USART1 => embassy_stm32::usart::InterruptHandler<embassy_stm32::peripherals::USART1>;}, |
| 188 | ); | 190 | ); |
| 191 | #[cfg(feature = "stm32c071rb")] | ||
| 192 | define_peris!( | ||
| 193 | UART = USART1, UART_TX = PB6, UART_RX = PB7, UART_TX_DMA = DMA1_CH1, UART_RX_DMA = DMA1_CH2, | ||
| 194 | SPI = SPI1, SPI_SCK = PA5, SPI_MOSI = PA7, SPI_MISO = PA6, SPI_TX_DMA = DMA1_CH1, SPI_RX_DMA = DMA1_CH2, | ||
| 195 | @irq UART = {USART1 => embassy_stm32::usart::InterruptHandler<embassy_stm32::peripherals::USART1>;}, | ||
| 196 | ); | ||
| 189 | #[cfg(feature = "stm32l496zg")] | 197 | #[cfg(feature = "stm32l496zg")] |
| 190 | define_peris!( | 198 | define_peris!( |
| 191 | UART = USART3, UART_TX = PD8, UART_RX = PD9, UART_TX_DMA = DMA1_CH2, UART_RX_DMA = DMA1_CH3, | 199 | UART = USART3, UART_TX = PD8, UART_RX = PD9, UART_TX_DMA = DMA1_CH2, UART_RX_DMA = DMA1_CH3, |
| @@ -271,7 +279,7 @@ pub fn config() -> Config { | |||
| 271 | #[allow(unused_mut)] | 279 | #[allow(unused_mut)] |
| 272 | let mut config = Config::default(); | 280 | let mut config = Config::default(); |
| 273 | 281 | ||
| 274 | #[cfg(feature = "stm32c031c6")] | 282 | #[cfg(any(feature = "stm32c031c6", feature = "stm32c071rb"))] |
| 275 | { | 283 | { |
| 276 | config.rcc.hsi = Some(Hsi { | 284 | config.rcc.hsi = Some(Hsi { |
| 277 | sys_div: HsiSysDiv::DIV1, // 48Mhz | 285 | sys_div: HsiSysDiv::DIV1, // 48Mhz |
