FreeRTOS xCreateTask does not fail, but task does not run

Running on RAK4631

I’ve got the simplest task I can think of

void ProcessReceivedDataTask(void * parameter)
{
    configASSERT(((QueueHandle_t)parameter) != NULL);
    for( ;; )
    {
        Serial.println("task running");
        vTaskDelay(1000);
        taskYIELD();
    }
}

and it is created in setup() as follows

QueueHandle_t _messageQueue = xQueueCreate(64, sizeof(struct int));
TaskHandle_t _taskHandle = NULL;
BaseType_t xReturned = xTaskCreate(ProcessReceivedDataTask, "DATA_PROC", 1000, (void *)_messageQueue, tskIDLE_PRIORITY, &_taskHandle);
if(xReturned != pdPASS)
{ 
  while(true){
    Serial.println("Failed to create data processing task");
    delay(100);
  }
}

The program does not hang on Serial.println("Failed to create data processing task"); however, the task does not send any output to the Serial port.

Does anyone have any ideas of why this might be the case? OR should I be directing this query to the FreeRTOS forum?

For anyone who should run into such an issue … here’s the problem.

Don’t forget to put a call to vTaskDelay(DELAY) into your main loop()

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.