Skip to main content
OGarc.1
Associate
October 3, 2022
Question

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

  • October 3, 2022
  • 2 replies
  • 1582 views

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

This topic has been closed for replies.

2 replies

Guenael Cadier
ST Employee
October 5, 2022

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.

OGarc.1
OGarc.1Author
Associate
October 5, 2022
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,