diff options
| author | Raul Alimbekov <[email protected]> | 2025-12-16 09:05:22 +0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-12-16 09:05:22 +0300 |
| commit | c9a04b4b732b7a3b696eb8223664c1a7942b1875 (patch) | |
| tree | 6dbe5c02e66eed8d8762f13f95afd24f8db2b38c /tests/stm32/src/bin/eth.rs | |
| parent | cde24a3ef1117653ba5ed4184102b33f745782fb (diff) | |
| parent | 5ae6e060ec1c90561719aabdc29d5b6e7b8b0a82 (diff) | |
Merge branch 'main' into main
Diffstat (limited to 'tests/stm32/src/bin/eth.rs')
| -rw-r--r-- | tests/stm32/src/bin/eth.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/stm32/src/bin/eth.rs b/tests/stm32/src/bin/eth.rs index a65682a02..ffc76b96f 100644 --- a/tests/stm32/src/bin/eth.rs +++ b/tests/stm32/src/bin/eth.rs | |||
| @@ -7,8 +7,8 @@ mod common; | |||
| 7 | use common::*; | 7 | use common::*; |
| 8 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
| 9 | use embassy_net::StackResources; | 9 | use embassy_net::StackResources; |
| 10 | use embassy_stm32::eth::{Ethernet, GenericPhy, PacketQueue}; | 10 | use embassy_stm32::eth::{Ethernet, GenericPhy, PacketQueue, Sma}; |
| 11 | use embassy_stm32::peripherals::ETH; | 11 | use embassy_stm32::peripherals::{ETH, ETH_SMA}; |
| 12 | use embassy_stm32::rng::Rng; | 12 | use embassy_stm32::rng::Rng; |
| 13 | use embassy_stm32::{bind_interrupts, eth, peripherals, rng}; | 13 | use embassy_stm32::{bind_interrupts, eth, peripherals, rng}; |
| 14 | use static_cell::StaticCell; | 14 | use static_cell::StaticCell; |
| @@ -27,7 +27,7 @@ bind_interrupts!(struct Irqs { | |||
| 27 | RNG => rng::InterruptHandler<peripherals::RNG>; | 27 | RNG => rng::InterruptHandler<peripherals::RNG>; |
| 28 | }); | 28 | }); |
| 29 | 29 | ||
| 30 | type Device = Ethernet<'static, ETH, GenericPhy>; | 30 | type Device = Ethernet<'static, ETH, GenericPhy<Sma<'static, ETH_SMA>>>; |
| 31 | 31 | ||
| 32 | #[embassy_executor::task] | 32 | #[embassy_executor::task] |
| 33 | async fn net_task(mut runner: embassy_net::Runner<'static, Device>) -> ! { | 33 | async fn net_task(mut runner: embassy_net::Runner<'static, Device>) -> ! { |
| @@ -69,13 +69,12 @@ async fn main(spawner: Spawner) { | |||
| 69 | const PACKET_QUEUE_SIZE: usize = 4; | 69 | const PACKET_QUEUE_SIZE: usize = 4; |
| 70 | 70 | ||
| 71 | static PACKETS: StaticCell<PacketQueue<PACKET_QUEUE_SIZE, PACKET_QUEUE_SIZE>> = StaticCell::new(); | 71 | static PACKETS: StaticCell<PacketQueue<PACKET_QUEUE_SIZE, PACKET_QUEUE_SIZE>> = StaticCell::new(); |
| 72 | |||
| 72 | let device = Ethernet::new( | 73 | let device = Ethernet::new( |
| 73 | PACKETS.init(PacketQueue::<PACKET_QUEUE_SIZE, PACKET_QUEUE_SIZE>::new()), | 74 | PACKETS.init(PacketQueue::<PACKET_QUEUE_SIZE, PACKET_QUEUE_SIZE>::new()), |
| 74 | p.ETH, | 75 | p.ETH, |
| 75 | Irqs, | 76 | Irqs, |
| 76 | p.PA1, | 77 | p.PA1, |
| 77 | p.PA2, | ||
| 78 | p.PC1, | ||
| 79 | p.PA7, | 78 | p.PA7, |
| 80 | p.PC4, | 79 | p.PC4, |
| 81 | p.PC5, | 80 | p.PC5, |
| @@ -85,8 +84,10 @@ async fn main(spawner: Spawner) { | |||
| 85 | #[cfg(feature = "stm32h563zi")] | 84 | #[cfg(feature = "stm32h563zi")] |
| 86 | p.PB15, | 85 | p.PB15, |
| 87 | p.PG11, | 86 | p.PG11, |
| 88 | GenericPhy::new_auto(), | ||
| 89 | mac_addr, | 87 | mac_addr, |
| 88 | p.ETH_SMA, | ||
| 89 | p.PA2, | ||
| 90 | p.PC1, | ||
| 90 | ); | 91 | ); |
| 91 | 92 | ||
| 92 | let config = embassy_net::Config::dhcpv4(Default::default()); | 93 | let config = embassy_net::Config::dhcpv4(Default::default()); |
