I'm using FreeRTOs on Arduino for the first time. In my setup(), i would like to create my tasks but i have few more configuration to do after so i would like to create my tasks but don't start the scheduler immediately. This is my code currently with xTaskCreate and vTaskScheduler, but my code start the task immediately when they are created :

   //Create Tasks
   s1 = xTaskCreate(TaskAcquisition, NULL, configMINIMAL_STACK_SIZE, NULL, 2, &Acquisition);
   s2 = xTaskCreate(TaskStockage,NULL,configMINIMAL_STACK_SIZE + 200, NULL, 1, &Stockage);

.... Some more config

   Serial.println(F("Config finished"));

  //Check errors
  if(fifoData==NULL || fifoSpace == NULL || s1 != pdPASS || s2 != pdPASS){
  Serial.println(F("Creation error"));
  Serial.println(F("Fifo and Tasks created"));


  //if the scheduler start the code don't came here
  Serial.println(F("Ram issue"));

Thanks for your help !

  • 4
    I'm voting to close this question as off-topic because it is entirely about FreeRTOS, and not at all about the Arduino on which that is running. You really need to seek help in a FreeRTOS forum. – Chris Stratton Aug 18 '17 at 13:42

You need to vTaskSuspend the tasks immediately after creating them.

Then when you need a task to run you vTaskResume it.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.