This happens before the vTaskStartScheduler() is called (during the
creation of the tasks / hardware etc)
You should not allow tick interrupts to execute until the scheduler has
started. If they are executing then something else is enabling the
SysTick interrupt. Simply calling taskENTER_CRITICAL() will prevent
that happening (assuming all interrupt priorities are set correctly) -
the critical section will be exited when the scheduler starts.
You need to find why the SysTick interrupt, which executes the tick
interrupt, is executing before you have started the scheduler.
Thanks, that is what I wanted to know. The HAL_ResumeTick() is starting the ticks (is needed in hardware initialization).
For now I will do it like I did specify, with a flag (in my example: freeRTOSstarted)
Will look at your suggestion with taskENTER_CRITICAL() later as well.