lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] lwip port for LPC17xx micros


From: FreeRTOS Info
Subject: Re: [lwip-users] lwip port for LPC17xx micros
Date: Fri, 04 Feb 2011 07:53:45 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7

I think all you need to do is a memcpy into the buffer then tell the DMA
there is something in the buffer pointed to by the Tx descriptor.  No
copying byte by byte.  Although the DMA driver itself is more complex
than the simply FIFO driver, the actually copying of data is much easier.

The uIP driver tries to be zero copy in that it just points the DMA at
the uip_buf, then sets uip_buf to point to the next Rx buffer (pointed
to by the DMA's RX descriptor).  The lwIP equivalent will be a bit more
tricky because it has more comprehensive memory management than uIP's
very simply single buffer.

Regards,
Richard.

+ http://www.FreeRTOS.org
Designed for Microcontrollers.  More than 7000 downloads per month.

+ http://www.SafeRTOS.com
Certified by TÜV as meeting the requirements for safety related systems.



On 03/02/2011 23:41, Bernard Mentink wrote:
> Hi Richard,
> 
> You are write, the uIP implementation is DMA driven, however the lwIP
> stack sample which is written for the Stellaris MCUs writes to a FiFO, I
> don't know if that is a DMA address on that micro , or not.
> i.e in the read function you get the following:
> 
> ------------------------------------------------------- code
> ---------------------------------------------
> 
> /* Process all but the last buffer in the pbuf chain. */
>         q = p;
>         do {
>             /* Setup a byte pointer into the payload section of the pbuf. */
>             unsigned long *ptr = (unsigned long *)q->payload;
> 
>             /**
>             * Read data from FIFO into the current pbuf
>             * (assume pbuf length is modulo 4)
>             */
>             for (i = 0; i < q->len; i += 4) {
>                 *ptr++ = ETH->DATA;
>             }
> 
>             /* Link in the next pbuf in the chain. */
>             q = q->next;
>         } while (q != NULL);
> 
> ------------------------------------------- end code
> ----------------------------------------------------
> 
> I will need to investigate what ETH->DATA is .. and replace it with a
> call to read the DMA channel .. and ditto for the write ..
> 
> Cheers,
> Bernie
> 
> On Fri, Feb 4, 2011 at 10:48 AM, FreeRTOS Info <address@hidden
> <mailto:address@hidden>> wrote:
> 
>     Hi again,
> 
>     The drivers in FreeRTOS are interrupt (and I think DMA (?)) driven.  The
>     driver moves a packet into a buffer pointed to by a chain of DMA
>     descriptors, thats it.  I don't see why the driver would not be agnostic
>     of the stack it is being used with - the packets coming in off the
>     network will be the same - the reception and buffering of the packets by
>     the DMA will be the same - only how the packets are read from the
>     buffers by the stack will be different and that is not part of the
>     driver but part of the stack.
> 
> 
>     Regards,
>     Richard.
> 
>     + http://www.FreeRTOS.org
>     Designed for Microcontrollers.  More than 7000 downloads per month.
> 
>     + http://www.SafeRTOS.com
>     Certified by TÜV as meeting the requirements for safety related systems.
> 
> 
> 
>     On 03/02/2011 20:57, Bernard Mentink wrote:
>     > Hi There,
>     >
>     > Yes, I do have uIP working on the LPC1766, so I can use their drivers
>     > ... they don't use interrupts, just polling, so will need to do some
>     > hacking there
>     > (I am also using it with QP OS so every thing needs to be event
>     based ..)
>     >
>     > Reason I am asking, is to try and save myself the work of porting the
>     > uIP driver to lwIP, which does need a chunk of work .. so if
>     anyone has
>     > done it, that would be cool?
>     >
>     > Cheers,
>     > Bernie
>     >
>     > On Fri, Feb 4, 2011 at 9:34 AM, FreeRTOS Info <address@hidden
>     <mailto:address@hidden>
>     > <mailto:address@hidden <mailto:address@hidden>>> wrote:
>     >
>     >     Hi,
>     >
>     >     If you look at the LPC1768 demos in the FreeRTOS download you
>     will find
>     >     uIP demos, but the drivers are probably just as relevant to lwIP.
>     >
>     >     Regards,
>     >     Richard.
>     >
>     >     + http://www.FreeRTOS.org
>     >     Designed for Microcontrollers.  More than 7000 downloads per
>     month.
>     >
>     >     + http://www.SafeRTOS.com
>     >     Certified by TÜV as meeting the requirements for safety
>     related systems.
>     >
>     >
>     >
>     >     On 03/02/2011 19:09, Bernard Mentink wrote:
>     >     > Hi all,
>     >     >
>     >     > Does anyone have a port to this family of micros? I guess I
>     am just
>     >     > wanting the eth_driver.c and eth_driver.h files ...
>     >     >
>     >     > Many Thanks,
>     >     > Bernie
>     >     >
>     >     > --
>     >     > You always have believers and scepticts.. A True inventor is
>     always a
>     >     > believer..
>     >     >
>     >     >
>     >     >
>     >     > _______________________________________________
>     >     > lwip-users mailing list
>     >     > address@hidden <mailto:address@hidden>
>     <mailto:address@hidden <mailto:address@hidden>>
>     >     > http://lists.nongnu.org/mailman/listinfo/lwip-users
>     >
>     >
>     >     _______________________________________________
>     >     lwip-users mailing list
>     >     address@hidden <mailto:address@hidden>
>     <mailto:address@hidden <mailto:address@hidden>>
>     >     http://lists.nongnu.org/mailman/listinfo/lwip-users
>     >
>     >
>     >
>     >
>     > --
>     > You always have believers and scepticts.. A True inventor is always a
>     > believer..
>     >
>     >
>     >
>     > _______________________________________________
>     > lwip-users mailing list
>     > address@hidden <mailto:address@hidden>
>     > http://lists.nongnu.org/mailman/listinfo/lwip-users
> 
> 
>     _______________________________________________
>     lwip-users mailing list
>     address@hidden <mailto:address@hidden>
>     http://lists.nongnu.org/mailman/listinfo/lwip-users
> 
> 
> 
> 
> -- 
> You always have believers and scepticts.. A True inventor is always a
> believer..
> 
> 
> 
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users




reply via email to

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