[Top][All Lists]

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

[lwip-users] HTTP server help needed

From: Stojan Kovacevic
Subject: [lwip-users] HTTP server help needed
Date: Wed, 07 Apr 2010 09:30:45 +0200
User-agent: Thunderbird (Windows/20100228)

I need some help setting up an http server, since you 've got it working. First, have you used http files from /contrib folder? Second, did you make a special thread for it, or does it use tcpip_thread?

Thanks in advance,
Stojan Kovacevic

address@hidden wrote:
Send lwip-users mailing list submissions to

To subscribe or unsubscribe via the World Wide Web, visit
or, via email, send a message with subject or body 'help' to

You can reach the person managing the list at

When replying, please edit your Subject line so it is more specific
than "Re: Contents of lwip-users digest..."

Today's Topics:

   1. lwIP malloc fail (Navcon - Pedro Paulo Santos)


Message: 1
Date: Tue, 6 Apr 2010 12:38:19 -0300
From: "Navcon - Pedro Paulo Santos" <address@hidden>
Subject: [lwip-users] lwIP malloc fail
To: <address@hidden>
Message-ID: <address@hidden>
Content-Type: text/plain; charset="iso-8859-1"

Hi all!

I'm having a problem in trying to make a system with lwIP that sends a large 
file with TCP from an external serial Flash memory.

I use the following logic: read certain amont of data from the external memory, 
send over TCP with tcp_write (), read more data, send again, and there goes on. 
I made a function to handle lack of memory because of Nagle's algoritm (because 
I have little memory and can't prepare a large TCP message), and use tcp_output 
() to force the send of the amont of data. The problem is that after some 
transfers (no more than 15 tcp transfers) the program doesn't find memory to 
alloc in the following lines of tcp_enqueue () function:

    /* Allocate memory for tcp_seg, and fill in fields. */
    seg = memp_malloc(MEMP_TCP_SEG);
    if (seg == NULL) {
      LWIP_DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_enqueue: could not allocate memory for 
      goto memerr;

In my thinking, the tcp_output () function should free memory for the further transfers 
so that I can transfer any amont of data if I make a lot of consecutive "small" 

It occurs even if I send really small messages, with 20 bytes, for example. I 
already tried to edit lwipopts.h raising TCP_SND_BUF, TCP_WND, TCP_MSS, 
PBUF_POOL_SIZE, MEM_SIZE... but I got no good results.

Do I have to free memory, myself, in any part of the lwIP implementation?
(I already free the pbuf that my recv function returns as callback after the 

Anyone have a suggestion of what could be the problem?

Informations: I'm using an ARM microcontroller with 64kB SRAM and 256kB flash. 
I already made an HTTP server into it, but it spends very little memory. My 
external serial (SPI) flash memory have 128MB.

Thanks to all!

Pedro Paulo.

__________ Informação do ESET NOD32 Antivirus, versão da vacina 4628 (20091122) 

A mensagem foi verificada pelo  ESET NOD32 Antivirus.


-------------- next part --------------
An HTML attachment was scrubbed...


lwip-users mailing list

End of lwip-users Digest, Vol 80, Issue 4

Stojan Kovacevic, M.Sc.
Engineer / UACB
Tel +381-(0)21-4801-127
Fax +381-(0)21-450-721

RT-RK Group
Fruskogorska 11
21000 Novi Sad

reply via email to

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