Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: EMAC problem in AT91SAM7x256
PostPosted: Tue Jul 08, 2008 12:26 pm 
Offline

Joined: Tue Jul 08, 2008 12:09 pm
Posts: 1
Hello All,
I'm using ATMEL evaluation board using the chip AT91SAM7x256.

There i downloaded sample code for Emac ( Ethernet) given by ATMEL. It is working . In that packet reception as polling . But i want to do that in EMAC Interrupt. So i called the same Emac_poll ( ) function in EMAC RxISR.


I'm transmitting pkt per 20msec and pkt size is 214 bytes. From that i'm facing the problem of BNA ( Buffer Not Available) continuously ,even i cleared the BNA bit in rx register , but it is same as previous.

No of Rx Buffers - 16
size of each Rx Buff - 128 bytes

Please anyone give me your suggesion or the code used for EMAC ISR.

Waiting for reply,
kpcta.


Top
 Profile  
 
 Post subject: Re: EMAC problem in AT91SAM7x256
PostPosted: Fri Sep 11, 2009 1:51 am 
Offline

Joined: Wed Jun 07, 2006 5:38 am
Posts: 5
I've been seeing a similar problem. I have the at91lib emac code working via interrupts (not polling, like the examples) nicely with lwip for sending, but I think there are a couple problems with the emac code with regards to receiving. Maybe these only apply to interrupt-driven usage, since the examples are all poll-based?

1. The system can get into a state where all the rx buffers are marked as owned by the emac, but an isr is never triggered by one of the sources that indicate data is ready for reading. Unscientifically, I've seen things usually work for a few (3-4) loops through the rx buffers before getting into this state. I haven't fully tracked down exactly where the transition into this state happens. The fact that I see Buffer Not Available errors triggered while in this state makes me think that new data is arriving, but an available buffer can't be gotten. Interestingly, I never see any overrun errors, only buffer not available.

2. In the EMAC_Handler(), rx error checking is done inside the block that is executed if a full frame has been received. Errors that occur in a different context (ie, Buffer Not Available) are not handled. This is obviously problematic since a frame can't be successfully received if there are no buffers available. Also, the rx callback is only triggered in the case that a full frame has been received. Since the isr status is passed back to the callback, it might want to do something with some of those error conditions, and should as such be called when an error condition arises. I've altered the code slightly to do this, so I can make a call to EMAC_Poll() from my callback when I get a Buffer Not Available interrupt.

Do any of the authors of the at91lib emac code read this forum? It would be interesting to get some input on this...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 21 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: