Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
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
–
–
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
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.