File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ use volatile_register::{RO, RW};
5
5
6
6
#[ repr( C ) ]
7
7
pub struct Descriptor {
8
- desc : Aligned < A8 , [ u32 ; 4 ] > ,
8
+ desc : Aligned < A8 , [ u32 ; 8 ] > ,
9
9
}
10
10
11
11
impl Clone for Descriptor {
@@ -25,7 +25,7 @@ impl Default for Descriptor {
25
25
impl Descriptor {
26
26
pub const fn new ( ) -> Self {
27
27
Self {
28
- desc : Aligned ( [ 0 ; 4 ] ) ,
28
+ desc : Aligned ( [ 0 ; 8 ] ) ,
29
29
}
30
30
}
31
31
Original file line number Diff line number Diff line change @@ -240,7 +240,12 @@ pub unsafe fn new_unchecked<'rx, 'tx>(
240
240
eth_mmc. mmctimr . modify ( |r, w| w. bits ( r. bits ( ) | ( 1 << 21 ) ) ) ;
241
241
242
242
// bus mode register
243
- eth_dma. dmabmr . modify ( |_, w|
243
+ eth_dma. dmabmr . modify ( |_, w| {
244
+ // For any non-f107 chips, we must use enhanced descriptor format to support checksum
245
+ // offloading and/or timestamps.
246
+ #[ cfg( not( feature = "stm32f107" ) ) ]
247
+ let w = w. edfe ( ) . set_bit ( ) ;
248
+
244
249
// Address-aligned beats
245
250
w. aab ( )
246
251
. set_bit ( )
@@ -258,7 +263,8 @@ pub unsafe fn new_unchecked<'rx, 'tx>(
258
263
. bits ( 0b01 )
259
264
// Use separate PBL
260
265
. usp ( )
261
- . set_bit ( ) ) ;
266
+ . set_bit ( )
267
+ } ) ;
262
268
263
269
let mut dma = EthernetDMA {
264
270
eth_dma,
You can’t perform that action at this time.
0 commit comments