File tree Expand file tree Collapse file tree 4 files changed +19
-13
lines changed Expand file tree Collapse file tree 4 files changed +19
-13
lines changed Original file line number Diff line number Diff line change @@ -444,6 +444,12 @@ fn eth_interrupt_handler_impl(eth_dma: ÐERNET_DMA) -> InterruptReasonSummary
444
444
. set_bit ( )
445
445
} ) ;
446
446
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
+
447
453
(
448
454
status. ri ( ) . bit_is_set ( ) ,
449
455
status. ti ( ) . bit_is_set ( ) ,
Original file line number Diff line number Diff line change @@ -109,16 +109,15 @@ impl<'data> RxRing<'data, NotRunning> {
109
109
110
110
#[ cfg( feature = "stm32h7xx-hal" ) ]
111
111
{
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 ) ;
115
114
116
115
// 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 ) ;
122
121
123
122
// Set the start pointer.
124
123
eth_dma
Original file line number Diff line number Diff line change @@ -114,12 +114,14 @@ impl<'data> TxRing<'data, NotRunning> {
114
114
115
115
#[ cfg( feature = "stm32h7xx-hal" ) ]
116
116
{
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 ) ;
120
119
121
120
// 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 ) ;
123
125
assert ! ( self . ring. last_descriptor( ) as * const _ as u32 % 4 == 0 ) ;
124
126
125
127
// Set the start pointer.
Original file line number Diff line number Diff line change @@ -41,7 +41,6 @@ use crate::{
41
41
} ;
42
42
43
43
#[ cfg( feature = "stm32h7xx-hal" ) ]
44
- // TODO: implement all allowed GPIO pins.
45
44
#[ allow( unused_imports) ]
46
45
use crate :: {
47
46
dma:: EthernetDMA ,
You can’t perform that action at this time.
0 commit comments