Not able to run task

Hi,
I’ve assigned vTaskStartScheduler() correctly, and my tasks are not getting triggered. I’ve already verified that the heap size is sufficient. There are no errors in the code—only one warning: " warning: unused variable ‘pxVectorTable’ [-Wunused-variable]". I’m using printf statements to trace the flow, and everything seems to be in place up to the scheduler start.

Could you please guide me further on what might be causing this issue and areas to cross check as there are no errors in build?
Let me know if you require more data

It seems you have a minor configuration issue. How have you defined the configASSERT() macro?

Hey @Harsh_1000, welcome to the community.

Could you share the code snippet where you are creating the tasks and then calling the vTaskStartScheduler() function? This might give us more context to help you solve the issue.

Also if you could let us know that which port of FreeRTOS are you using here?

Thanks.

Here I am sharing my code which is relevant with the freeRTOS working
In this code I am able to print “starting the code5” with both the task successfully created.

#include "main.h"
#include "FreeRTOS.h"
#include "task.h"
#include "stdio.h"

static void Task1_handler(void *parameters);
static void Task2_handler(void *parameters);

int main(void)
{
	TaskHandle_t task1Handle;
	TaskHandle_t task2Handle;
	BaseType_t status;

  status = xTaskCreate(Task1_handler, "Task 1",200,"Hello Task-1", 1, &task1Handle);
  if (status == pdPASS)
  {
      printf("Task 1 created successfully.\n");
  }
  configASSERT(status==pdPASS);
  status = xTaskCreate(Task2_handler, "Task 2",200,"Hello Task-2", 1, &task2Handle);
  configASSERT(status==pdPASS);
  if (status == pdPASS)
  {
      printf("Task 2 created successfully.\n");
  }

  printf("Starting the code5\n");
  vTaskStartScheduler();
  printf("Starting the code\n");

  while(1)
  {
  
  }
}
static void Task1_handler(void *parameters)
{
	printf("Starting the code1\n");
 while(1)
 {
	 printf("Starting the code2\n");
	 printf("%s\n", (char*)parameters);
	 vTaskDelay(100);
 }
//vTaskDelete(NULL);
}
static void Task2_handler(void *parameters)
{
	while(1)
	 {
		 printf("%s\n", (char*)parameters);
		 vTaskDelay(100);
	 }
	//vTaskDelete(NULL);
}

I am using an ARM Cortex-M4-based Nucleo board (STM32L476) and programming it using STM32CubeIDE.

The task stacks are probably too small when using stack hungy printf-family functions.
That’s also mentioned many times here in the forum because it’s a common pitfall.
Quick try e.g. stacksize 1000 and way better enable stack checking and properly define configASSERT for development.
In case you have already defined configASSERT the program might have stopped in the assert function.
Also for the future e.g. your task handles should be global variables because the main stack get’s reset after starting the scheduler for Cortex-M MCUs i.e. all local variables defined in main get lost/corrupted.