Hi,
I'm trying to expand the demo-application for SDK 2.0 (K66) SDK_2.0_K66\boards\frdmk66f\demo_apps\lwip\lwip_tcpecho\freertos with additional tasks, however when i attempt add a new task function an run the code, the additional task never executes.
My tcpecho_init function looks like this
void tcpecho_init(void)
{
sys_thread_new("tcpecho_thread", tcpecho_thread, NULL, TCPECHO_STACKSIZE, TCPECHO_PRIORITY);
sys_thread_new("my_thread", my_thread, NULL, TCPECHO_STACKSIZE, TCPECHO_PRIORITY + 1);
vTaskStartScheduler();
}
and my my_thread functions is defined like this:
static void my_thread (void *arg) {
while (1) {
vTaskDelay(1000);
PRINTF("Hello from another task\r\n");
}
}
After executing the code with a debugger attached, my task list looks like this:
If I start `my_thread` before the `tcpecho_thread` both threads are visible in the task list
But the device does not respond when running `echotool 192.168.1.102 /p tcp /r 7 /d hello`
Any pointers on what I am doing wrong?
Solved! Go to Solution.
Hi, Kim,
The TCPECHO_STACKSIZE is 3K, which is too large to be allocated for two task,
"my_thread"
task fails to be created.of course, one task is okay.
Pls change the code as following, I have tried, it is okay.
BR
Xiangjun Rong
void tcpecho_init(void)
{
sys_thread_new("tcpecho_thread", tcpecho_thread, NULL, TCPECHO_STACKSIZE, TCPECHO_PRIORITY);
sys_thread_new("my_thread", my_thread, NULL, 512, TCPECHO_PRIORITY + 1);
vTaskStartScheduler();
}
Hi, Kim,
The TCPECHO_STACKSIZE is 3K, which is too large to be allocated for two task,
"my_thread"
task fails to be created.of course, one task is okay.
Pls change the code as following, I have tried, it is okay.
BR
Xiangjun Rong
void tcpecho_init(void)
{
sys_thread_new("tcpecho_thread", tcpecho_thread, NULL, TCPECHO_STACKSIZE, TCPECHO_PRIORITY);
sys_thread_new("my_thread", my_thread, NULL, 512, TCPECHO_PRIORITY + 1);
vTaskStartScheduler();
}