Code analyse: question 1 - which is the main entrance? how works freertos?

Hello, dear friends:
I am tring to figure out the basic structure of the program. My first confuse is the MAIN entrance.
there are two “MAIN” files in this project, namely,
“int main(void)” in main.c
and
“int odrive_main(void)” in main.cpp
I understand main.c is generated by CubeMX and thus the programme starts here, while the main loop of motor control is under odrive_main().
I cann’t see a clear clue how the function “odrive_main()” is called.

Maybe it is related to the freertos which is started in main.c?
however I doesn’t see any Task or thread has been created…
(sorry, I have less experience&knowlege with freertos)

Someone could explain me ?

thank you
George

Hi George,

Odrive_main() is called from the StartDefaultTask in freeRTOS.c

I believe FreeRTOS will always start a default task so there’s something in the shceduler.

Cheers
Simon