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

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

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

Jump to solution
1,011 Views
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();
   }
}

 

Labels (1)
0 Kudos
Reply
1 Solution
966 Views
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

View solution in original post

1 Reply
967 Views
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