lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Windows 7 Startup crashes LwIP and Free RTOS


From: Marco Jakobs
Subject: Re: [lwip-users] Windows 7 Startup crashes LwIP and Free RTOS
Date: Tue, 20 Jul 2010 08:52:12 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5

Good morning, Simon

Am 20.07.2010 07:36, schrieb Simon Goldschmidt:
That's rather a driver question, not an lwIP question: the driver should make 
sure that it only delivers complete packets to lwIP. I.e. if some parts of the 
packet are missing due to the MAC trying to split it to multiple buffers but 
running out of buffers half way through, the driver should throw away the 
partly received packet.
Do you (or anybody) has any example code for this? The driver in my port puts everything in the EMAC buffers, and their contents are copied into LwIP pbufs in the EMAC task. If an overrun happens, these 128-byte-fragments are discarded by the EMAC (having no free EMAC buffers), but there may still be some first fragments of this packet in the EMAC buffers, which are then copied to the LwIP pbufs.

May this cause the problem of the crashes, that missing buffers of a packet may send the EMAC task to hell?

How can i find fragments of this packet in the EMAC buffers to wipe them out? I see no sequence number or anything like that in the RxDescriptors:

typedef struct _AT91S_RxTdDescriptor
{
    unsigned int    addr;
    union
    {
        unsigned int    status;
        struct
        {
            unsigned int    Length:11;
            unsigned int    Res0:1;
            unsigned int    Rxbuf_off:2;
            unsigned int    StartOfFrame:1;
            unsigned int    EndOfFrame:1;
            unsigned int    Cfi:1;
            unsigned int    VlanPriority:3;
            unsigned int    PriorityTag:1;
            unsigned int    VlanTag:1;
            unsigned int    TypeID:1;
            unsigned int    Sa4Match:1;
            unsigned int    Sa3Match:1;
            unsigned int    Sa2Match:1;
            unsigned int    Sa1Match:1;
            unsigned int    Res1:1;
            unsigned int    ExternalAdd:1;
            unsigned int    UniCast:1;
            unsigned int    MultiCast:1;
            unsigned int    BroadCast:1;
        } S_Status;
    } U_Status;
} AT91S_RxTdDescriptor, *AT91PS_RxTdDescriptor;


Question two:
Is there any action needed if the EMAC sets the receive overflow bit?
Can't help you with that... or the other hardware-related questions...
What i meant with this was discussed in the question above: If the overflow bit is set, this meant that a frame could not be stored due to missing available EMAC buffers. It is an indication that a frame was discarded by the EMAC.

Marco



reply via email to

[Prev in Thread] Current Thread [Next in Thread]