FreeRTOS CMSIS_V2: osDelayUntil go to HardFaulHandler only with optimization -O0
Helo,
I'm discovering CUBE IDE with FREERTOS (CMSIS_V2) I work on a Nucleo STM32F401RE.
When I use the fonction osDelayUntil in -O0 optimization the execution go to HardFaultHandler just after the execution of osDelayUntil.
This problem disappears with other level of optimization.
****** in main ******
const osThreadAttr_t defaultTask_attributes = {
.name = "defaultTask",
.priority = (osPriority_t) osPriorityNormal,
.stack_size = 128
};
defaultTaskHandle = osThreadNew(StartDefaultTask, NULL, &defaultTask_attributes);
void StartDefaultTask(void *argument)
{
/* USER CODE BEGIN 5 */
uint32_t tick;
tick = osKernelGetTickCount();
/* Infinite loop */
for(;;)
{
tick += 1000U; // delay 1000 ticks periodically
osDelayUntil(tick);
HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_5);
}
/* USER CODE END 5 */
}
Thanks,
Léon
