aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2021-09-07 11:12:46 +0200
committerGitHub <[email protected]>2021-09-07 11:12:46 +0200
commit9082e5f6c5982e7d220f54c8e64e0dd27c6c579d (patch)
tree34a38a7b792faf7dce8de95d64822b799a921f46
parent2928b99218c7a4c7c20745aeee5bdc166dd55c1b (diff)
parent14fa6c2760cd7468eda8ed4fe7142199714201bd (diff)
Merge pull request #389 from adamgreig/stm32h7-eth-fix
STM32H7: Ethernet: Disable RA in MAC filtering, fix order of MACA0 register writes
-rw-r--r--embassy-stm32/src/eth/v2/mod.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/embassy-stm32/src/eth/v2/mod.rs b/embassy-stm32/src/eth/v2/mod.rs
index a06c4cacc..42eb0680c 100644
--- a/embassy-stm32/src/eth/v2/mod.rs
+++ b/embassy-stm32/src/eth/v2/mod.rs
@@ -98,6 +98,10 @@ impl<'d, P: PHY, const TX: usize, const RX: usize> Ethernet<'d, P, TX, RX> {
98 // TODO: Carrier sense ? ECRSFD 98 // TODO: Carrier sense ? ECRSFD
99 }); 99 });
100 100
101 // Note: Writing to LR triggers synchronisation of both LR and HR into the MAC core,
102 // so the LR write must happen after the HR write.
103 mac.maca0hr()
104 .modify(|w| w.set_addrhi(u16::from(mac_addr[4]) | (u16::from(mac_addr[5]) << 8)));
101 mac.maca0lr().write(|w| { 105 mac.maca0lr().write(|w| {
102 w.set_addrlo( 106 w.set_addrlo(
103 u32::from(mac_addr[0]) 107 u32::from(mac_addr[0])
@@ -106,10 +110,7 @@ impl<'d, P: PHY, const TX: usize, const RX: usize> Ethernet<'d, P, TX, RX> {
106 | (u32::from(mac_addr[3]) << 24), 110 | (u32::from(mac_addr[3]) << 24),
107 ) 111 )
108 }); 112 });
109 mac.maca0hr()
110 .modify(|w| w.set_addrhi(u16::from(mac_addr[4]) | (u16::from(mac_addr[5]) << 8)));
111 113
112 mac.macpfr().modify(|w| w.set_ra(true));
113 mac.macqtx_fcr().modify(|w| w.set_pt(0x100)); 114 mac.macqtx_fcr().modify(|w| w.set_pt(0x100));
114 115
115 mtl.mtlrx_qomr().modify(|w| w.set_rsf(true)); 116 mtl.mtlrx_qomr().modify(|w| w.set_rsf(true));