cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
svdmark
Adventurer
Adventurer
8,430 Views
Registered: ‎08-17-2009

lwip crashing after several days of runtime

Jump to solution

In my current project, I'm using lwip130 3.00.a in RAW mode, using the Hard TEMAC of a V5FX70T on an Avnet Minimodule Plus.The PPC in the V5 is the main system controller.

The system is connected to a PC from which it receives commands and to which it returns data via TCP/IP over an 100 MBps Ethernet connection.

 

Generally the system works fine, but about once a week it crashes. During operation, we transmit about 100 MB per hour, so quite a lot of data but far from the capacity of a 100 MBps connection.

 

The interval between crashes is random, it can happen after 3 days or after 30 days, one system is now running for 8 weeks without issues. When a crash happens, the systems stops working totally, not even the timer interrupts are coming (I have a watchdog in a timer interrupt that would show me through a LED if it would still be alive).

 

Now I have found that if I connect via JTAG to a crashed system, the PC register of the PPC points to the pbuf_clen() function of lwip (located in pbuf.c), which is iterating through a pbuf chain using a while(pbuf != NULL) scheme, which seems susceptible to concurrent execution issues. I'm guessing there could be some issue between the interrupt-driven parts of the ethernet driver and the lwip stack (I'm not using multithreading, so interrupts are the only sources for possible concurrency issues).

 

Has anyone seen an issue like this, or any idea what might be the problem here?

 

 

0 Kudos
1 Solution

Accepted Solutions
svdmark
Adventurer
Adventurer
10,835 Views
Registered: ‎08-17-2009

Hi all,

 

just in case any other people see the same problem:

The 13.1 version of xapp1026 is definitely buggy, it is not allowed to call the tcp_tmr funkctions from interrupt context. Using a scheme following the 14.3 version of the example code fixed the issue.

 

Best,

Stefan

 

View solution in original post

0 Kudos
11 Replies
Anonymous
Not applicable
8,421 Views
Can you post your lwip library settings? (Your mss file) please
0 Kudos
svdmark
Adventurer
Adventurer
8,407 Views
Registered: ‎08-17-2009

Here it is:

0 Kudos
Anonymous
Not applicable
8,390 Views

Can you follow the example desing attached to XAPP1026 to see how to init the lwip library:

You are using all the defaults. I would suggest that you try increasing the tcp_wnd, and increase the  pbuf pool size

 

BEGIN LIBRARY
 PARAMETER LIBRARY_NAME = lwip140
 PARAMETER LIBRARY_VER = 1.03.a
 PARAMETER PROC_INSTANCE = microblaze_0
 PARAMETER TCP_WND = 4096
 PARAMETER N_TX_DESCRIPTORS = 256
 PARAMETER N_RX_DESCRIPTORS = 256
 PARAMETER MEMP_N_PBUF = 1024
 PARAMETER MEMP_N_TCP_SEG = 1024
 PARAMETER PBUF_POOL_SIZE = 1024
 PARAMETER LWIP_DHCP = true
END

0 Kudos
svdmark
Adventurer
Adventurer
8,373 Views
Registered: ‎08-17-2009

Hi Stephen,

 

I found that the way the tcp_slowtmr() and tcp_fasttmr() functions are called were changed between the xapp1026 13.1 version (on which I built my code) and the current (14.3) version:

In the old verstion, they were called directyl from the timer interrupt handler, in the new version the timer interrupt handler only sets flags, and the tcp_tmr are called from the main loop.

Do you know why this has been changed? Might this be the cause for my problem?

 

Thanks,

Stefan

 

 

0 Kudos
svdmark
Adventurer
Adventurer
10,836 Views
Registered: ‎08-17-2009

Hi all,

 

just in case any other people see the same problem:

The 13.1 version of xapp1026 is definitely buggy, it is not allowed to call the tcp_tmr funkctions from interrupt context. Using a scheme following the 14.3 version of the example code fixed the issue.

 

Best,

Stefan

 

View solution in original post

0 Kudos
4,475 Views
Registered: ‎08-07-2017

hi 

0 Kudos
svdmark
Adventurer
Adventurer
4,468 Views
Registered: ‎08-17-2009

As I wrote above, just use the xapp1026 example version 14.3, it works fine.

Best,

Stefan

 

0 Kudos
4,456 Views
Registered: ‎08-07-2017

Hi 

thanks for reply.

but my working version is 12.4 with lwip 130,please explain me some more to debug the that problem.

and also please send me xapp1026 example code, if it is possible .....

0 Kudos
svdmark
Adventurer
Adventurer
4,453 Views
Registered: ‎08-17-2009

You can find it on the internet, just google for xapp1026 and 14.3 !

 

0 Kudos
2,630 Views
Registered: ‎08-07-2017

In my current project, I'm using lwip130 3.00.a in RAW API mode, using the Soft TEMAC of a xilinx Spartan 3e .
The system is connected to a PC from which it receives commands and to which it returns data via TCP/IP over an 100 MBps Ethernet connection.
Generally the system works fine, but about once a day it crashes**. During operation, we transmit about 100 MB per hour, so quite a lot of data but far from the capacity of a 100 MBps connection.

The interval between crashes is random, it can happen after 3 hours or after 12 hopurs, some time system is one day without issues. When a crash happens, the socket connection loss ,even not ping, but the timer interrupts are coming (I have check by the print some data in a timer interrupt).

Has anyone seen an issue like this, or any idea what might be the problem here?

please reply as early as possible
my mail ID is - arvinddandotiya47@gmail.com

0 Kudos
2,628 Views
Registered: ‎08-07-2017
In my current project, I'm using lwip130 3.00.a in RAW API mode, using the Soft TEMAC of a xilinx Spartan 3e .
The system is connected to a PC from which it receives commands and to which it returns data via TCP/IP over an 100 MBps Ethernet connection.
Generally the system works fine, but about once a day it crashes**. During operation,

The interval between crashes is random, it can happen after 3 hours or after 12 hopurs, some time system is one day without issues. When a crash happens, the socket connection loss ,even not ping, but the timer interrupts are coming (I have check by the print some data in a timer interrupt).

Has anyone seen an issue like this, or any idea what might be the problem here?
please reply as early as possible
my mail ID is - arvinddandotiya47@gmail.com
0 Kudos