[En-Nut-Discussion] NutTcpConnect and NutTcpCloseSocket problem

Ole Reinhardt ole.reinhardt at embedded-it.de
Fri Aug 10 13:19:09 CEST 2012


Hi Oliver,

> i found the problem !
> the function "test_connection" is called in a thread which priority is 23.
> I tried with a priority higher or equal to 32 (priority of the thread "tcpsm") and it works fine.

You say that your board resettet, right?

This might indeed point to a hidden bug in the TCP statemachine. We have
to check this further!

The lower the priority of your thread is, the higher the chance, that it
will get the CPU time on a thread-switch.

In other words: With priority 23 it is one of the highest priority
threads, supposingly only the ethernet RX thread has a higher priority.
If your thread now is callong NutTcpCloseSocket, it might came to a
scheduling point. But as no higher priorised thread want's the CPU it
might get back CPU time without waiting. A raise condition might sleep
here anywhere in the TCP stack.

I will try to implement your code on one of my boards and will try to
debug this. Hopefully I can reproduce the problem here.

Bye,

Ole

-- 

Thermotemp GmbH, Embedded-IT

Embedded Hard-/ Software and Open Source Development, 
Integration and Consulting

http://www.embedded-it.de

Geschäftsstelle Siegen - Steinstraße 67 - D-57072 Siegen - 
tel +49 (0)271 5513597, +49 (0)271-73681 - fax +49 (0)271 736 97

Hauptsitz - Hademarscher Weg 7 - 13503 Berlin
Tel +49 (0)30 4315205 - Fax +49 (0)30 43665002
Geschäftsführer: Jörg Friedrichs, Ole Reinhardt
Handelsregister Berlin Charlottenburg HRB 45978 UstID DE 156329280 




More information about the En-Nut-Discussion mailing list