Intermittent HardFault Occurrence

I am encountering an intermittent HardFault issue during system testing, and I would appreciate any help in identifying the cause. As shown in the picture below, the HardFault occurs sporadically while the TimerSvc is running. The occurrence of the HardFault is not periodic, and it happens randomly and infrequently.

When examining the call stack, it appears that pvContainer is set to 0xffffffff, and the HardFault happens when uxListRemove is called.

To address this, I increased the stack size for the TimerSvc, but the issue still occurs intermittently.

What could be the reason for pvContainer becoming 0xffffffff?

I would appreciate any advice on how to approach debugging this issue.

The MCU is STM32H5, and the RTOS version is 10.5.1.

One common cause of this kind of corruption on STM32 is interrupt priorities set too high (numerically too low). FreeRTOS uses configASSERT() statements to catch this configuration problem. How is configASSERT() defined in your project? It’s typically found in FreeRTOSConfig.h.

1 Like