lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] lwIP crash?!


From: ThomasJ
Subject: Re: [lwip-users] lwIP crash?!
Date: Wed, 21 Nov 2012 00:48:01 -0800 (PST)

Hi Artem

I have looked at the thread and some further questions regarding you guide:

2. Make sure your sys arch protection implementation does
taskDISABLE_INTERRUPTS/taskENABLE_INTERRUPTS (or portXXX equivalents).

If it is the sys_arch_protect/unprotoect function you mean, then they end in
a portDISABLE/ENABLE interrupt in my port

3. Make sure that numerical(!) value of interrupt priority is equal to or
*greater* than the configMAX_SYSCALL_INTERRUPT_PRIORITY setting in your
FreeRTOSConfig.h. Also be warned that configMAX_SYSCALL_INTERRUPT_PRIORITY
must not be set to 0. Use only priorities 1 and above.

This one I have some difficulties understand.
My configMAX_SYSCALL_INTERRUPT_PRIORITY is set to  5 << (8 -
configPRIO_BITS) 
Schould end up with the value of 40

The text in my FreeRTOSConfig.h state that:

/* Priorities passed to NVIC_SetPriority() do not require shifting as the
function does the shifting itself.  Note these priorities need to be equal
to
or* lower *than configMAX_SYSCALL_INTERRUPT_PRIORITY - therefore the numeric
value needs to be equal to or greater than 5 (on the Cortex-M3 the lower the
numeric value the higher the interrupt priority). */

Isn't that the opposite of what you say??

5. Make sure you defined configKERNEL_INTERRUPT_PRIORITY to 255 or (255 <<
(8 - __NVIC_PRIO_BITS))

It is set to 248 ( 31 << (8 - configPRIO_BITS) )

Changing it to 255 does not do the trick.


Just to sort out the priorities I use the following:

The RTOS task calling the netconn_recv uses priority 6
lwIP Receive thread has 5
lwIP tx clean thread has 6
TCP ip task has 8

Ethernet NVIC priority is set with NVIC_SetPriority with prio 9. 
NVIC_SetPriority does shift the value to 72 ? Is that the a problem?

I also did a very simple test. 
I connected the device to a TCP server on a PC. Then the server sends 14
bytes and the device returns the message as soon it is received on the
netconn_resv function.
I then measure the time from TCP server send and until the packet is
returned. (Nagle disabled on both ends). Some tx/rx roundtrip from the
server takes ~300 ms to complete.
I can see that the netconn_recv is "stucked" for around 300 ms from time to
time. Even the server did send the packet.

And the worst part is, when there is no delay in the server when the packet
is returned until a new is send, the lwIp stack "dies" after ~45000 packets.
But the TCP ip task, TX clean and receive task still runs. But nothing is
send to the netconn_recv function. (Syn ack send from TCP/IP stack)

I cant figure out whar could be wrong??

Thomas

Artem Pisarenko wrote
> Hi.
> See neighboring discussion "Assertion "memp sanity" failed at line 
> 463in../lwip_1_4_0/Src/core/memp.c". I think you have the same problems 
> (same processor and same RTOS).
> 
> Regards, Artem.
> 
> 
> _______________________________________________
> lwip-users mailing list

> lwip-users@

> https://lists.nongnu.org/mailman/listinfo/lwip-users





--
View this message in context: 
http://lwip.100.n7.nabble.com/lwIP-crash-tp20652p20655.html
Sent from the lwip-users mailing list archive at Nabble.com.



reply via email to

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