Problems with SDK 2.0 lwip demo

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problems with SDK 2.0 lwip demo

Jump to solution
740 Views
whata
Contributor III

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:

 

178040_178040.pngpastedImage_1.png

If I start `my_thread` before the `tcpecho_thread` both threads are visible in the task list

 

178041_178041.pngpastedImage_2.png

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?

Labels (1)
Tags (1)
0 Kudos
1 Solution
499 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

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();
}

View solution in original post

0 Kudos
1 Reply
500 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

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();
}
0 Kudos