[En-Nut-Discussion] sam7x problems, solutions and more problems

Nicolas Moreau moreau at gmail.com
Thu Jan 25 22:51:47 CET 2007

Hi Harald

Thanks for the reply, the code I have been using is the same as CVS
head,  in EmacRxThread this comment :
         * Wait for the arrival of new packets or poll the receiver every
         * 200 milliseconds. This short timeout helps a bit to deal with
         * the SAM9260 Ethernet problem.
        NutEventWait(&ni->ni_rx_rdy, 200);

I think relates directly to the fact that interrupts are edge driven
and the handler will never run if the flag is already high when
You need to clear it just before the thread loop with:  isr = inr(EMAC_ISR);

There is no reason why should need a timeout on the Event.

Also in the RX code this part:

     * Search the next frame start. Release any fragment.
    while ((rxBufTab[rxBufIdx].addr & RXBUF_OWNERSHIP) != 0 &&
(rxBufTab[rxBufIdx].stat & RXS_SOF) == 0) {
        rxBufTab[rxBufIdx].addr &= ~(RXBUF_OWNERSHIP);
        if (rxBufIdx >= EMAC_RX_BUFFERS) {
            rxBufIdx = 0;

makes no sense at all and I think is the cause of the packet loss, why
should there be fragments, and if they are why wouldn't they be read
by the normal frame read code just below.

I found the linux AVR code that uses the atmel MACB interface that
seems to be very similar and the driver seems to be quite different.
Do you know where this driver came from ?



On 1/25/07, Harald Kipp <harald.kipp at egnite.de> wrote:
> Hi Nicolas,
> We've been using
> http://ethernut.cvs.sourceforge.net/ethernut/nut/arch/arm/dev/at91_emac.c?revision=1.5&view=markup
> for some time now with very good results.
> For the SAM7X and SAM9160 I'd recommend to use the latest beta or, even
> better, CVS head.
> Harald
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion

More information about the En-Nut-Discussion mailing list