-
Notifications
You must be signed in to change notification settings - Fork 8
Description
The line portENABLE_INTERRUPTS(); in the function xPortStartScheduler(void) should be removed.
This might cause the context to run in main() stack and crash the system.
See remark at function void vTaskStartScheduler( void ) lines 2064-2068:
/ Interrupts are turned off here, to ensure a tick does not occur
* before or during the call to xPortStartScheduler(). The stacks of
* the created tasks contain a status word with interrupts switched on
* so interrupts will automatically get re-enabled when the first task
* starts to run. /
BaseType_t xPortStartScheduler(void)
{
vPortSetupTimerInterrupt();
ulCriticalNesting = 0;
#if(configUSE_PREEMPTION == 1)
bPreemptive = 1;
#else
bPreemptive = 0;
#endif
portENABLE_INTERRUPTS();
portRESTORE_FIRST_CONTEXT();
// Should not get here!
return pdFAIL;
}