Page 1 of 1

TcpUpdate Error

Posted: Mon Jun 30, 2025 8:22 am
by SeeCwriter
At the completion of programming a Nano module using Autoupdate, v2.5, the following message is output on the serial port:

TcpUpdate Error: 40

The module is programmed correctly and runs as expected. I have detected nothing wrong. What does that message mean?

The applications are built with v2.9.5 of the tools.

Re: TcpUpdate Error

Posted: Mon Jun 30, 2025 9:39 am
by TomNB
I don't see the string "TcpUpdate Error:" anywhere in our code. Is that something in your app?

Re: TcpUpdate Error

Posted: Mon Jun 30, 2025 11:33 am
by SeeCwriter
Well, this is embarrassing. It is in my code. It's generated when function StartTcpUpdate returns a non-zero value, which in this case is 40.

Re: TcpUpdate Error

Posted: Mon Jun 30, 2025 12:42 pm
by SeeCwriter
StartTcpUpdate just calls OSTaskCreatewName, and returns the value returned by OSTaskCreatewName. But the uCosLibrary document doesn't define any return values.

Re: TcpUpdate Error

Posted: Mon Jun 30, 2025 3:26 pm
by SeeCwriter
It turns out the return code for OSTaskCreatewName is defined in OSTaskCreate. And error code of 40 mean the task priority is already used.
These are my priorities:

Code: Select all

#define USERMAIN_PRIO     (55)
#define NTP_TASK_PRIO     (54)
#define UDP_TASK_PRIO     (53)
#define SNMP_PRIO         (52)  
#define FTP_TASK_PRIO     (51)
#define TCPUPDATE_PRIO    (49)   
#define SSL_REPRO_PRIO    (48)
I don't see a conflict with the priorities defined in constants.h. Is priority 49 used somewhere else?

Re: TcpUpdate Error

Posted: Mon Jun 30, 2025 10:58 pm
by TomNB
Its not used by the system anywhere else. What do you get if you add TCP update to an example like SimpleHtml?

Re: TcpUpdate Error

Posted: Mon Jun 30, 2025 10:59 pm
by TomNB
If you have any of your tasks at MAIN_PRIO-1, that would be 49