aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2023-09-28 05:12:35 +0200
committerDario Nieuwenhuis <[email protected]>2023-09-28 05:12:35 +0200
commit6200d22438be21a014d95b9d4dde872fab18a51b (patch)
tree11d2a796de56c89b2c778996f3e6ff0e82509528
parentd9eae79f3eea8bf968f61e476b599e9f8dc97aa8 (diff)
stm32/eth: fix receiving large frames on v2.
-rw-r--r--embassy-stm32/src/eth/v2/mod.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/embassy-stm32/src/eth/v2/mod.rs b/embassy-stm32/src/eth/v2/mod.rs
index f03ea2e31..b7fe4766c 100644
--- a/embassy-stm32/src/eth/v2/mod.rs
+++ b/embassy-stm32/src/eth/v2/mod.rs
@@ -34,8 +34,6 @@ impl interrupt::typelevel::Handler<interrupt::typelevel::ETH> for InterruptHandl
34 } 34 }
35} 35}
36 36
37const MTU: usize = 1514; // 14 Ethernet header + 1500 IP packet
38
39pub struct Ethernet<'d, T: Instance, P: PHY> { 37pub struct Ethernet<'d, T: Instance, P: PHY> {
40 _peri: PeripheralRef<'d, T>, 38 _peri: PeripheralRef<'d, T>,
41 pub(crate) tx: TDesRing<'d>, 39 pub(crate) tx: TDesRing<'d>,
@@ -163,7 +161,7 @@ impl<'d, T: Instance, P: PHY> Ethernet<'d, T, P> {
163 dma.dmactx_cr().modify(|w| w.set_txpbl(1)); // 32 ? 161 dma.dmactx_cr().modify(|w| w.set_txpbl(1)); // 32 ?
164 dma.dmacrx_cr().modify(|w| { 162 dma.dmacrx_cr().modify(|w| {
165 w.set_rxpbl(1); // 32 ? 163 w.set_rxpbl(1); // 32 ?
166 w.set_rbsz(MTU as u16); 164 w.set_rbsz(RX_BUFFER_SIZE as u16);
167 }); 165 });
168 166
169 // NOTE(unsafe) We got the peripheral singleton, which means that `rcc::init` was called 167 // NOTE(unsafe) We got the peripheral singleton, which means that `rcc::init` was called