On my Device ARM-CortexM0 / STM32F030RC all interrupts are disabled until
i start the scheduler with vTaskStartScheduler().
Even the Systick_Handler is not called until the start of the scheduler.
When the scheduler is started all interrupts are called as expected.
In my current software-architecture i do some initialisation stuff before the scheduler ist started.
For example i want to Transfer a interrupt controlled UART-message before i start the scheduler, but not a single interrupt is executed.
Is it in general possible to execute interrupts before the start of the scheduler ?
If it is possible how do i have to enable the interrupts?
I Enable the interrupts via ARM-core CMSIS e.g. NVIC_EnableIRQ(USART3_4_IRQ).
I tried not to call the FreeRTOS-API before i create the tasks and start the scheduler.
Theoretically you could do that, but it is very error prone. For example, if your ISR uses OS services, it must be able to distinguish between OS operational or not so the services are not used as long as the scheduler has not started.
Also, during the startup sequence there is very likely a sequence where interrupts are globally disabled, so your isr will be blocked for that amount of time.
I would not do it, too many potential pitfalls. You can always create a “root task” that does all vital initializations before creating all other tasks. Many architectures are designed around that concept.
Simply enabling the interrupts on the device and NVIC level is not enough, you will also need to set the MCU’s interrupt mask as in cpsie/cpsid.
Thanks for this detailed explanation.
I do now start the scheduler at a very early state.
Directly after initializing the System-Clock.