cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G4 UART Signal Handler Error

matthewshrike
Associate II

Hi there, 

I have firmware that uses UART1 and UART2 of the STM32G4 series. Both are intended to run on interrupts, but as soon as any signal is received by the MCU, an error occurs, causing HAL_UART_AbortCpltCallback to be called. Therafter, the interrupt no longer works. Are there any known issues with the interrupt on these STMs? Based on previous forums, people were limited by stack size and prefetch. However, different to those cases, my code doesnt enter a hard fault, rather it just hits the function: HAL_UART_AbortCpltCallback.

The error that comes up during debug starts here in the hal code:

/* Enable the UART Error Interrupt: (Frame error, noise error, overrun error) */

ATOMIC_SET_BIT(huart->Instance->CR3, USART_CR3_EIE);

 

/* Configure Rx interrupt processing */

if ((huart->FifoMode == UART_FIFOMODE_ENABLE) && (Size >= huart->NbRxDataToProcess))

Then returns a page saying <signal handler called> () at 0xfffffff9.

 

2 REPLIES 2
matthewshrike
Associate II

The configuration of UART I am using such as the chosen buffer sizes, and the general message structure has been used before. However, the only change is that the Tx and Rx pins were swapped in hardware by mistake. I had the Tx Rx pin swap enabled in the .ioc file when I had the issues above. Now, if i disable it to see what happens, the error no longer occurs, and the UART is initialised fine for both UARTs.

The UART lines for UART1 go through a level shifter. However, for UART2, it goes straight to a RS485 transceiever.

Also, I am able to send data from both UARTs, just cant receive.

Pavel A.
Super User

the error no longer occurs

If the issue is resolved, please mark your reply as solution.