LPUART1 not working with interrupts via HAL_UART_Transmit_IT(...) function
I'm using STM32CubeIDE 1.3.1 w/ a Nucleo L4R5ZI board. I can transmit via the lpuart1 with the polled version - HAL_UART_Transmit(...). The interrupt is enabled in the NVIC. Changing to the HAL_UART_Transmit_IT(...) and board stuck repeatedly calling HAL_UART_IRQHandler().
/* this works fine and output appears in serial terminal */
result = HAL_UART_Transmit(&hlpuart1, (uint8_t*)"GO-1\r\n", 6, 100);
/* this never returns. nothing appears on serial terminal */
result = HAL_UART_Transmit_IT(&hlpuart1, (uint8_t*)"GO-2\r\n", 6);
It never returns because it's stuck infinitely calling the HAL_UART_IRQHandler(). I haven't made any changes to the HAL_UART_IRQHandler(...), just using the default generated code.
HAL_UART_IRQHandler() at stm32l4xx_hal_uart.c:2,509 0x8003408
LPUART1_IRQHandler() at stm32l4xx_it.c:209 0x8000a52
<signal handler called>() at 0xfffffff9
HAL_UART_Transmit_IT() at stm32l4xx_hal_uart.c:1,301 0x8003128
main() at main.c:105 0x800053c
As a sanity check on myself I tried with a Nucleo-F103RB (because I had one sitting here), and the above steps works fine.
It's like the library and/or generated code is missing something. Not sure if it's lpuart1 or L4R5 related. The data isn't transmitted and the interrupt isn't cleared/handled.
Has anyone else run into this? Any work around?