diff options
| -rw-r--r-- | embassy-stm32/src/eth/v2/mod.rs | 7 |
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)); |
