[Top][All Lists]

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

[lwip-users] Problem with lwIP in seial-ethernet data transfer

From: Vibhor Kapoor
Subject: [lwip-users] Problem with lwIP in seial-ethernet data transfer
Date: Sat, 19 Jul 2008 01:57:55 +0530


I'm working on ARM9 with Free RTOS as my OS and using lwIP stack. We have six serial ports on which continous data is coming which has to be transferred to UDP and TCP ports. Each of the six serial ports are mapped to six TCP ports.

Our problem is that the system performance starts to degrade after 4-5 hrs. The TCP transmission stops at one port and then after a while on second port and like this on each interval. At this time our Telnet session which is our command interface also hangs. Until 4-5hrs everything works fine with no hangouts and data losses but then the above situations starts happening.

Our design is as follows:

For each serial port we have a seperate queue which gets filled in the UART interrupt and then a serial task(for respective serial port) retreives this data from the queue and fills it in it's local buffer.Ater predefined time or when a predefined value/amount of data is present we need to broadcast it and also send it to TCP. Hence we have in total 6 rx tasks and 6 queues for 6 serial ports.

On debugging we found that whenever the system starts hangs, the conrol is in dataaborthandler. I have kept all the checks in my application such that there is no overflow,Null pointer assignments or any memory leakage. I'm using tcp-write and tcp-output for TCP transmission.

The serial task has the folwowing flow:

1. Check for the predefined(mentioned above0 conditions.

2. If true enter loop else simply return.

3. If true do tcp write and check for err_mem. If tcp-write returns no err, broadcast data on udp and call tcp-output. make local buffer index zero.

4. if tcp-output returns error, check if the local buffer has reached its limit. If it has, then broad cast data and make and make local buffer index zero.

5. If not, just return. Step 4 7 5 done so that we can avoid any loss of data on TCP,hoowever if local buffer is ful, we should atleast broadcast it.

I found out at many occasions that whenever my system hangs it doesn't complete the tcp-output function.

I tried to make changes in the lwipots.h but it didn't give any positive results.

can anyone help me in resolving this error or provide me with some useful changes or options that can be used.


reply via email to

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