C++ - LWIP+FreeRTOS - Unable to create more threads

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

C++ - LWIP+FreeRTOS - Unable to create more threads

跳至解决方案
1,066 次查看
GanesanGuru
Contributor IV

Hi fellas,

I've created a sample c++ project - with lwip+freeRTOS - for two threads. It works fine as shown below:

image.png

 

When I tried to add 3rd thread - the build was successful - yet the none of the threads are being scheduled.image.png

 

 

To be very specific, the 3rd task creation itself failed. Hence, I think scheduler is not even called. Why it happens so?

 

The threads are as follows,

void delay(){
    volatile static int i,j;
    for (i=0;i<10000;i++)
        for (j=0;j<10000;j++);
}

void ledOn(void){
	GPIO_WritePinOutput(GPIO1,9,0);
    PRINTF("LED turned on\r\n");
}

void ledOFF(void){
	GPIO_WritePinOutput(GPIO1,9,1);
    PRINTF("LED turned off\r\n");
}

static void BLINKY(void * arg){
while(1){
	ledOn();
	delay();
	ledOFF();
	delay();
	taskYIELD();
}
}

static void SERIALL(void * arg){
   while(1){
	PRINTF("inside Serial loop");
	delay();
    PRINTF(".");
	delay();
    PRINTF(".\r\n");
	taskYIELD();
   }
}

static void testIoT(void * arg){
   while(1){
	PRINTF("inside iot loop");
	delay();
    PRINTF(".");
	delay();
    PRINTF(".\r\n");
	taskYIELD();
   }
}

 

标签 (1)
标记 (4)
0 项奖励
回复
1 解答
1,021 次查看
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello
I hope you are well.

Is the same issue present if you increase the stack size for the task? Which status is returning sys_thread_new()?

Best regards,
Omar

在原帖中查看解决方案

1 回复
1,022 次查看
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello
I hope you are well.

Is the same issue present if you increase the stack size for the task? Which status is returning sys_thread_new()?

Best regards,
Omar