From e613324e1603741df150730fd26652458d0d0c50 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Thu, 1 Feb 2024 01:39:52 +0100 Subject: [PATCH] stm32/eth: rename new_rmii to new, update metapac to fix issues with PC2_C. --- embassy-stm32/Cargo.toml | 4 ++-- embassy-stm32/src/eth/v2/mod.rs | 2 +- examples/stm32f4/src/bin/eth.rs | 2 +- examples/stm32f7/src/bin/eth.rs | 2 +- examples/stm32h5/src/bin/eth.rs | 2 +- examples/stm32h7/src/bin/eth.rs | 2 +- examples/stm32h7/src/bin/eth_client.rs | 3 ++- tests/stm32/src/bin/eth.rs | 21 --------------------- 8 files changed, 9 insertions(+), 29 deletions(-) diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml index 6c7591f57..698febf71 100644 --- a/embassy-stm32/Cargo.toml +++ b/embassy-stm32/Cargo.toml @@ -68,7 +68,7 @@ rand_core = "0.6.3" sdio-host = "0.5.0" critical-section = "1.1" #stm32-metapac = { version = "15" } -stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-ab2bc2a739324793656ca1640e1caee2d88df72d" } +stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-0cb3a4fcaec702c93b3700715de796636d562b15" } vcell = "0.1.3" bxcan = "0.7.0" nb = "1.0.0" @@ -89,7 +89,7 @@ critical-section = { version = "1.1", features = ["std"] } proc-macro2 = "1.0.36" quote = "1.0.15" #stm32-metapac = { version = "15", default-features = false, features = ["metadata"]} -stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-ab2bc2a739324793656ca1640e1caee2d88df72d", default-features = false, features = ["metadata"]} +stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-0cb3a4fcaec702c93b3700715de796636d562b15", default-features = false, features = ["metadata"]} [features] diff --git a/embassy-stm32/src/eth/v2/mod.rs b/embassy-stm32/src/eth/v2/mod.rs index a176b01e5..4b22d1d21 100644 --- a/embassy-stm32/src/eth/v2/mod.rs +++ b/embassy-stm32/src/eth/v2/mod.rs @@ -64,7 +64,7 @@ macro_rules! config_pins { impl<'d, T: Instance, P: PHY> Ethernet<'d, T, P> { /// Create a new RMII ethernet driver using 9 pins. - pub fn new_rmii( + pub fn new( queue: &'d mut PacketQueue, peri: impl Peripheral

+ 'd, irq: impl interrupt::typelevel::Binding + 'd, diff --git a/examples/stm32f4/src/bin/eth.rs b/examples/stm32f4/src/bin/eth.rs index 2933cfe3c..7f5c8fdb1 100644 --- a/examples/stm32f4/src/bin/eth.rs +++ b/examples/stm32f4/src/bin/eth.rs @@ -63,7 +63,7 @@ async fn main(spawner: Spawner) -> ! { let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; static PACKETS: StaticCell> = StaticCell::new(); - let device = Ethernet::new_rmii( + let device = Ethernet::new( PACKETS.init(PacketQueue::<16, 16>::new()), p.ETH, Irqs, diff --git a/examples/stm32f7/src/bin/eth.rs b/examples/stm32f7/src/bin/eth.rs index 85b5bd3e0..5bff48197 100644 --- a/examples/stm32f7/src/bin/eth.rs +++ b/examples/stm32f7/src/bin/eth.rs @@ -64,7 +64,7 @@ async fn main(spawner: Spawner) -> ! { let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; static PACKETS: StaticCell> = StaticCell::new(); - let device = Ethernet::new_rmii( + let device = Ethernet::new( PACKETS.init(PacketQueue::<16, 16>::new()), p.ETH, Irqs, diff --git a/examples/stm32h5/src/bin/eth.rs b/examples/stm32h5/src/bin/eth.rs index 79288877f..2370656e6 100644 --- a/examples/stm32h5/src/bin/eth.rs +++ b/examples/stm32h5/src/bin/eth.rs @@ -67,7 +67,7 @@ async fn main(spawner: Spawner) -> ! { let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; static PACKETS: StaticCell> = StaticCell::new(); - let device = Ethernet::new_rmii( + let device = Ethernet::new( PACKETS.init(PacketQueue::<4, 4>::new()), p.ETH, Irqs, diff --git a/examples/stm32h7/src/bin/eth.rs b/examples/stm32h7/src/bin/eth.rs index 9abdcf3c0..cd9a27fcd 100644 --- a/examples/stm32h7/src/bin/eth.rs +++ b/examples/stm32h7/src/bin/eth.rs @@ -64,7 +64,7 @@ async fn main(spawner: Spawner) -> ! { let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; static PACKETS: StaticCell> = StaticCell::new(); - let device = Ethernet::new_rmii( + let device = Ethernet::new( PACKETS.init(PacketQueue::<4, 4>::new()), p.ETH, Irqs, diff --git a/examples/stm32h7/src/bin/eth_client.rs b/examples/stm32h7/src/bin/eth_client.rs index c4da5776f..aeb169e19 100644 --- a/examples/stm32h7/src/bin/eth_client.rs +++ b/examples/stm32h7/src/bin/eth_client.rs @@ -65,7 +65,8 @@ async fn main(spawner: Spawner) -> ! { let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; static PACKETS: StaticCell> = StaticCell::new(); - let device = Ethernet::new_rmii( + + let device = Ethernet::new( PACKETS.init(PacketQueue::<16, 16>::new()), p.ETH, Irqs, diff --git a/tests/stm32/src/bin/eth.rs b/tests/stm32/src/bin/eth.rs index b244874e7..7c02f0354 100644 --- a/tests/stm32/src/bin/eth.rs +++ b/tests/stm32/src/bin/eth.rs @@ -71,7 +71,6 @@ async fn main(spawner: Spawner) { const PACKET_QUEUE_SIZE: usize = 4; static PACKETS: StaticCell> = StaticCell::new(); - #[cfg(not(eth_v2))] let device = Ethernet::new( PACKETS.init(PacketQueue::::new()), p.ETH, @@ -91,26 +90,6 @@ async fn main(spawner: Spawner) { GenericSMI::new(0), mac_addr, ); - #[cfg(eth_v2)] - let device = Ethernet::new_rmii( - PACKETS.init(PacketQueue::::new()), - p.ETH, - Irqs, - p.PA1, - p.PA2, - p.PC1, - p.PA7, - p.PC4, - p.PC5, - p.PG13, - #[cfg(not(feature = "stm32h563zi"))] - p.PB13, - #[cfg(feature = "stm32h563zi")] - p.PB15, - p.PG11, - GenericSMI::new(0), - mac_addr, - ); let config = embassy_net::Config::dhcpv4(Default::default()); //let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 {