[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ethmac] MAC receive buffer corruption when continuously receiving frames



I've come across a problem when the Ethernet MAC is being 
continuously sent frames. Sometimes the MAC will fill my receive buffer 
with the 'end' of a frame, rather than the whole frame.

When using a single Receive buffer descriptor: to receive a frame, I 
simply set the descriptor's empty flag. This operation is asynchronous to 
the incoming data. It would appear that this flag is interpreted by the 
MAC simply as a 'write-enable', and if the current incoming frame is 
addressed to the device, the MAC appears to simply write the incoming 
data to my buffer - from the point I set the empty flag!. I expected the 
MAC to wait for the start of the next frame before writing anything to 
my buffer.

I have worked-around this problem by disabling the Receiver via the 
Mode register (bit 0) when a frame arrives, then setting the empty flag 
in the buffer descriptor, then re-enabling the Receiver. The MAC 
appears to need some time between the Receiver being disabled and re-
enabled for this workaround to fix the problem.

Has anyone experienced this problem? 

Although I have a workaround for the single Receive buffer descriptor 
case, I want to use the MAC in a double-buffered mode, where I can 
continue to receive a frame while processing the previous one. I can't 
use the single-buffer workaround because I obviously need to leave the 
Receiver enabled in order to receive the next frame!

Any help would be very much appreciated!

Kind Regards

Pete
Although I have a workaround I wish to use the 
--
To unsubscribe from ethmac mailing list please visit http://www.opencores.org/mailinglists.shtml