aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorxoviat <[email protected]>2025-11-18 16:06:19 +0000
committerGitHub <[email protected]>2025-11-18 16:06:19 +0000
commita72ba1e0571e6bef9c93c1d98b67724c685a37cc (patch)
tree604068e12694e9f3cb6e449b2544c38b6a17620b /tests
parentaad02db7c59467374526ffbb484dbacf2a7b6e5e (diff)
parent0102bc3f82a4a92f3ba7594bc788f6345acc8d17 (diff)
Merge pull request #4871 from datdenkikniet/sma
Standalone ethernet station management
Diffstat (limited to 'tests')
-rw-r--r--tests/stm32/src/bin/eth.rs13
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;
7use common::*; 7use common::*;
8use embassy_executor::Spawner; 8use embassy_executor::Spawner;
9use embassy_net::StackResources; 9use embassy_net::StackResources;
10use embassy_stm32::eth::{Ethernet, GenericPhy, PacketQueue}; 10use embassy_stm32::eth::{Ethernet, GenericPhy, PacketQueue, Sma};
11use embassy_stm32::peripherals::ETH; 11use embassy_stm32::peripherals::{ETH, ETH_SMA};
12use embassy_stm32::rng::Rng; 12use embassy_stm32::rng::Rng;
13use embassy_stm32::{bind_interrupts, eth, peripherals, rng}; 13use embassy_stm32::{bind_interrupts, eth, peripherals, rng};
14use static_cell::StaticCell; 14use 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
30type Device = Ethernet<'static, ETH, GenericPhy>; 30type Device = Ethernet<'static, ETH, GenericPhy<Sma<'static, ETH_SMA>>>;
31 31
32#[embassy_executor::task] 32#[embassy_executor::task]
33async fn net_task(mut runner: embassy_net::Runner<'static, Device>) -> ! { 33async 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());