Home/Support/Support Forum/tx_thread_create fails when ethernet cable is unpluged
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

tx_thread_create fails when ethernet cable is unpluged

0 votes
Hello,

Application details:
- Digi connectME ( -C jtag and S)
- NET+OS Version 7.1
- Uses ftp, cli, web server ( original, without user modifications)
- Custom user thread for tcp-ip/serial bridge ( it does XML parsing and glue to an RS232 ASCII protocol)
- Custom thread uses NAReset if no activity (on TCP) is detected within a certain amount of time.

When network cable is connected everything works ok.
If network cable is disconnected, application gets an auto-ip (as expected) and then fails to create custom thread, tx_thread_create returns with error code 14 - TX_THREAD_ERROR.

Thanks in advance,
Márcio Correia
asked May 22, 2014 in NET+OS by Oicram New to the Community (4 points)

Please log in or register to answer this question.

2 Answers

+1 vote
My first (back of the envelope) guess would be that your issue is NOT directly tied to the cable not being plugged in and that this is a side effect of something else.

To that end I would check a could of things, as follows:

The thread control block (the TX_THREAD object) must be static global or malloced. That is it can not be allowed to go out of scope.

The thread control block (The TX_THREAD object should be cleared out before use (memset(theObject, '\0', sizeof(TX_THREAD)).

Ensure you clear out the thread stack before use.

From what I can see the TX_THREAD_ERROR is defined as :
"Invalid thread control pointer. Either the pointer is NULL or the thread is already started." Any chance you are trying to restart a thread that is already started?
answered May 27, 2014 by dakotas_dad Veteran of the Digi Community (694 points)
0 votes
Before going to your issue, i would like to clarify that NETOS applications do not work on -S modules. Those are plug and play modules you cannot load custom firmware on it.

-C, yes they are NETOS modules.
Try disabling auto-ip in appconfig.h

APP_ENABLE_AUTO_IP
answered May 25, 2014 by tuxembb Veteran of the Digi Community (288 points)
...