cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 LPUART only works with breakpoint.

SCabr.1
Associate II

Hi, I need your help, please:

I'm using a STM32 and the STM32CubeIDE and I want to communicate the MCU and a FPS module R502 through LPUART (Low Power UART). When I send the correct packages, the FPS answers correctly (I check that reading via serie with Saleae Logic) and follow my instructions (for example, led on).

The problem seems to be handling the interruption (is that different when the UART is low power???). It's weird, because when I write at the beginning of main() the function HAL_UART_Receive_IT(lpuart), the code doesn`t execute anymore, it keeps in the HAL_UART_IRQHandler() forever, where I can see that there aren`t errors but huart->RxISR = NULL.

What seems to make no sense is that when I set a breakpoint in the instruction  SET_BIT(huart->Instance->CR3, USART_CR3_EIE) inside of the HUART_Receive_IT(lpuart) and I do a "Step Into" and then "Resume", the code works perfectly, which I use all the FPS`s funcionalities in (removing the breakpoint previously).

Has someone any idea about why that's happening or has had a similar bug? It would be so good, because I've spent a week in that.

Thank you.

11 REPLIES 11

Anyway, I'll read of the MOOCs because I don't have experience.

Thank you

However, it`s work. But I know it's not the best solution,