User Tools

Site Tools


understanding_freertos_for_stm32_primer_code_control_flow

Understanding FreeRTOS (for STM32 primer) code control flow

Execution starts from Reset_Handler in Demo/CORTEX_STM32F103_Primer_GCC/ST_Code/crt0_STM32x.c - after performing the required run-time initializations to set up a proper environment for C code, it transfers control to main in Demo/CORTEX_STM32F103_Primer_GCC/main.c.

Demo/CORTEX_STM32F103_Primer_GCC/main.c/main

main invokes prvSetupHardware which starts the clocks and performs various other low-level initializations.

main creates various tasks by calling xTaskCreate.

The scheduler is invoked by calling vTaskStartScheduler.

Source/tasks.c/xTaskCreate

xTaskCreate starts out by allocating a task control block and stack.

tskTCB * pxNewTCB;
 
/* Allocate the memory required by the TCB and stack for the new task.
   checking that the allocation was successful. */
 
pxNewTCB = prvAllocateTCBAndStack( usStackDepth );
understanding_freertos_for_stm32_primer_code_control_flow.txt · Last modified: 2012/02/04 19:10 (external edit)