cancel
Showing results for 
Search instead for 
Did you mean: 

Problems when using USART and LPUART via RXNE interrupt (STM32WB55)

OGarc.1
Associate II

I use a GNSS connected to LPUART and a LoRaWAN module connected to USART1.

I use the two UARTs via the RXNE interrupt.

If I initialise and enable the two UART interrupts, USART1 no longer interrupts me and I do not receive any data. The problem is only in reception, as the transmission via USART1 is done correctly.

The LPUART, on the other hand, continues to interrupt and I receive data constantly.

I have tried to disable the LPUART and its RXNE interrupt to see if it interrupts the USART1 but I can't get anything.

0693W00000UnCI5QAN.png0693W00000UnCHvQAN.png0693W00000UnCH2QAN.png0693W00000UnCHlQAN.png

2 REPLIES 2
Guenael Cadier
ST Employee

Dear @OGarc.1​ 

Maybe the problem could be in your callback : UART_CharReception_Callback()

Once init phase is done, both hlpuart1 and huart1 handles are initialised.

So hlpuart1.Instance is set to LPUART1 and huart1.Instance is set to USART1.

Then when entering the callback, first test is always true (if hlpuart1.Instance == LPUART1), and you get no way to reach the else part that should manage the USART1 case, i guess.

Hope this helps.

Thank you for your help,

Yes the problem was in the Callback.
Lpuart1 has its own callback -> UART_CharReception_Callback
Usart1 has its own callback ->USART_CharReception_Callback

Solved, thank you very much,