STM32L4+ issues when using UART with interrupts
- May 15, 2020
- 1 reply
- 751 views
Dear community,
I am using the Nucleo-L4R5ZI board with STM32L4R5ZI chip embedded to experiment UART.
Unfortunately, I am facing an issue when using interrupts.
I looked up through the BSP (STM32Cube_FW_L4_V1.15.1) provided by ST if examples were using the UART but I did find examples for my board ...
I have configured my UART as follow (115200-8N1). My UART instance is LPUART1. Interrupts are enabled like below whithin the
HAL_UART_MspInit function :
/* LPUART1 interrupt Init */
HAL_NVIC_SetPriority(LPUART1_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(LPUART1_IRQn);
I used STM32CubeMX to generate the code.
I am using the same UART to print "debug" traces and the STLINK.
When I use a printf(...) I got my traces without any problems.
Now, I would like to send from my terminal, for example, an "Hello World!", once the transfer is done, I send from the board a TxBuffer containing "****UART_TwoBoards_ComIT**** ****UART_TwoBoards_ComIT**** ****UART_TwoBoards_ComIT****".
The problem is that I never got the UART ready to step forward and send the TxBuffer.
When using the debugger I always got at the end of HAL_UART_Receive_IT function a HAL_OK ...
The Rxbuffer is not populated and the HAL_UART_RxCpltCallback is never called.
I don't understand what's happening and I am stuck with this issue...
On the other side, when I use HAL_UART_Receive without interrupts, everything works well.
Who has already faced this kind of issue and tips are very appreciated to help me to step forward.
PS: I attached to the post my test project if it could help.
Thank you n advance for your help,
Regards
