-1

My application run on stm32F4 with FreeRTOS V9.0.0 and port files Source\portable\RVDS\ARM_CM4F (imported via RTE Keil). The main, call some initialization functions, create the task and then call the vTaskStartScheduler. The task simply call vTaskDelay(1000) which never return. The system is not is fault. The fault report dosen't show any error or problem.

The code is:

int main(void) 
{
 init_foo1()
 init_foo2()
 xTaskCreate(aTask, "name",1280, NULL, 6, NULL);
 init_foo3();
 vTaskStartScheduler();
 }
 void aTask()
 {
 vTaskDelay(1000);
 bar();
 }

What is wrong? Thanks all

Mattia S.
  • 1
  • 4

1 Answers1

1

You need to put infinite loop firstly:

Example usage of vTaskDelay function accordinly to documentation:

 void vTaskFunction( void * pvParameters )
 {
 /* Block for 500ms. */
 const TickType_t xDelay = 500 / portTICK_PERIOD_MS;

     for( ;; )
     {
         /* Simply toggle the LED every 500ms, blocking between each toggle. */
         vToggleLED();
         vTaskDelay( xDelay );
     }
}

Also test the priority in xTaskCreate

UBaseType_t uxPriority