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
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 ( ) ,
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 = self . ring . descriptors ( ) . count ( ) ;
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.
Original file line number Diff line number Diff 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) ]
4645use crate :: {
4746 dma:: EthernetDMA ,
You can’t perform that action at this time.
0 commit comments