Skip to content

Commit 053e479

Browse files
committed
Add some more TODOs
Panic on FBE
1 parent 7de9731 commit 053e479

File tree

4 files changed

+19
-13
lines changed

4 files changed

+19
-13
lines changed

src/dma/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,12 @@ fn eth_interrupt_handler_impl(eth_dma: &ETHERNET_DMA) -> InterruptReasonSummary
444444
.set_bit()
445445
});
446446

447+
if status.fbe().bit_is_set() {
448+
// TODO: add a link to a/the github issue describing this problem,
449+
// and how to solve it.
450+
panic!("Fatal bus error! Is the descriptor and buffer memory accessible by the Ethernet MAC/DMA?");
451+
}
452+
447453
(
448454
status.ri().bit_is_set(),
449455
status.ti().bit_is_set(),

src/dma/rx/mod.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,15 @@ impl<'data> RxRing<'data, NotRunning> {
109109

110110
#[cfg(feature = "stm32h7xx-hal")]
111111
{
112-
// TODO: assert that ethernet DMA can access
113-
// the memory in these rings
114-
assert!(self.ring.descriptors().count() >= 4);
112+
let rx_ring_descriptors = self.ring.descriptors().count();
113+
assert!(rx_ring_descriptors >= 4);
115114

116115
// Assert that the descriptors are properly aligned.
117-
assert!(ring_ptr as u32 & !0b11 == ring_ptr as u32);
118-
assert!(
119-
self.ring.last_descriptor_mut() as *const _ as u32 & !0b11
120-
== self.ring.last_descriptor_mut() as *const _ as u32
121-
);
116+
//
117+
// FIXME: these require different alignment if the data is stored
118+
// in AXI SRAM
119+
assert!(ring_ptr as u32 % 4 == 0);
120+
assert!(self.ring.last_descriptor_mut() as *const _ as u32 % 4 == 0);
122121

123122
// Set the start pointer.
124123
eth_dma

src/dma/tx/mod.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,14 @@ impl<'data> TxRing<'data, NotRunning> {
114114

115115
#[cfg(feature = "stm32h7xx-hal")]
116116
{
117-
// TODO: assert that ethernet DMA can access
118-
// the memory in these rings
119-
assert!(self.ring.descriptors().count() >= 4);
117+
let tx_descriptor_count = 0;
118+
assert!(tx_descriptor_count >= 4);
120119

121120
// Assert that the descriptors are properly aligned.
122-
assert!(ring_ptr as u32 & !0b11 == ring_ptr as u32);
121+
//
122+
// FIXME: these require different alignment if the data is stored
123+
// in AXI SRAM
124+
assert!(ring_ptr as u32 % 4 == 0);
123125
assert!(self.ring.last_descriptor() as *const _ as u32 % 4 == 0);
124126

125127
// Set the start pointer.

src/setup.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ use crate::{
4141
};
4242

4343
#[cfg(feature = "stm32h7xx-hal")]
44-
// TODO: implement all allowed GPIO pins.
4544
#[allow(unused_imports)]
4645
use crate::{
4746
dma::EthernetDMA,

0 commit comments

Comments
 (0)