Skip to content

Commit 31123ff

Browse files
committed
Change to Data Memory Barrier from Data Synchronization Barrier in phy driver
Additonal minor cleanup
1 parent 4fe4c4b commit 31123ff

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ stm32-eth = { version = "0.2.0", features = ["stm32f429"] }
2525
or
2626
```rust
2727
stm32f7xx-hal = { version = "0.2.0", features = ["stm32f767"] }
28-
stm32-eth = { version = "0.1.1", features = ["stm32f767"]}
28+
stm32-eth = { version = "0.2.0", features = ["stm32f767"]}
2929
```
3030

3131
In `src/main.rs` add:

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,8 @@ impl<'rx, 'tx> Eth<'rx, 'tx> {
312312
f: F,
313313
) -> Result<R, TxError> {
314314
let result = self.tx_ring.send(length, f);
315-
//Wait for the memory to sync with the cache
316-
asm::dsb();
315+
//Make sure the memory write occurs before triggering DMA
316+
asm::dmb();
317317
self.tx_ring.demand_poll(&self.eth_dma);
318318
result
319319
}

src/smoltcp_phy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ impl<'a, 'rx, 'tx, 'b> Device<'a> for &'b mut Eth<'rx, 'tx> {
1111

1212
fn capabilities(&self) -> DeviceCapabilities {
1313
let mut caps = DeviceCapabilities::default();
14-
caps.max_transmission_unit = 1522;
14+
caps.max_transmission_unit = super::MTU;
1515
caps.max_burst_size = Some(1);
1616
caps
1717
}

0 commit comments

Comments
 (0)