AnsweredAssumed Answered

help: HAL_Delay and FreeRTOS cause HardFault_Handler

Question asked by yy.hh on Oct 15, 2015
Latest reply on Oct 15, 2015 by yy.hh
I'm using HAL libraries, its HAL_Delay with FreeRTOS will cause HardFault

my stack backtrace:
#0  HardFault_Handler ()
    at ./system/stm32f4xx_it.c:83
#1  <signal handler called>
#2  0x0800343a in xTaskIncrementTick () at freertos/tasks.c:2056
#3  0x0800064a in SysTick_Handler () at freertos/portable/GCC/ARM_CM4F/port.c:498
#4  <signal handler called>
#5  0x0800573a in HAL_GetTick () at ./st_hal/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c:324
#6  0x08005764 in HAL_Delay (Delay=1)
    at ./st_hal/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c:342
#7  0x08004704 in main () at main.c:95

Source code:
   while(1) {}
I found STM32Cube examples FatFs_uSD_FreeRTOS uses CMSIS_OS , it defines SysTick_Handler in stm32f4xxx_it.c, but when I define it in my _it.c, it complained multiple defined SysTick_Handler.

I found a maybe related discussion:


comment xPortSystickHandler macro as comment says.
implement SysTick_Handler like what in freeRTOS/CMSIS_OS/cmsis_os.c.