Question
System freezes, stuck in USART interrupt
The MCU is STM32F469, using RTOS: AZURE ThreadX and FatFS.
The system is fetching data through 3 UART ports and doing logging (saving data into a file).
Logging is setup to run once one hour, about 1000 bytes.
UART read and write both use DMA.
The system sometimes gets into frozen state after 1~2 days.
Here frozen means the UI becomes unresponsive (not responding to keypresses). Logging also stops.
Note the freezing only happens when logging is running.
If logging is turned off, the system can keep running for very long time.
Using debugger, it shows this stack:
HAL_UART_IRQHandler() at stm32f4xx_hal_uart.c:2,489
<signal handler called>() at 0xfffffffd
HAL_UARTEx_ReceiveToIdle_DMA() at stm32f4xx_hal_uart.c:1,855
ReceiveProbeMsg()
WaitCmdResponseState()
StartPortBTask()
...
Also the USART_SR value is 0xd8, which means there is ORE error.
Watched a few freezing cases, the stack is always the same, stuck in HAL_UART_IRQHandler().
It looks like the USART interrupt happens again and again, cannot be cleared.
A very interesting thing is, if a system is frozen, then I connect a debugger to it to check information (with a special setting to not reset the target), once I press the resume button, the system recovers from freezing and runs normally: UI unresponsive, logging continues.
Could anyone have any ideas how this could happen?
