2025-10-27 6:04 AM
Hi all,
I have an STM32L071VBT6 and want to test the UART functionality. I configured UART4 RX and TX and physically connected them to do a loopback test.
I define 2 arrays to start with
Anyone knows why I manage to receive only a single character each time?
Thanks!!
Solved! Go to Solution.
2025-10-27 6:06 AM - edited 2025-10-27 6:06 AM
There is no automatic buffer. You need to be ready to receive when characters come in, not after.
That means you need to use a non-blocking receive call.
HAL_UART_Receive_IT or HAL_UART_Receive_DMA with appropriate data handling. Called before characters are transmitted.
2025-10-27 6:06 AM - edited 2025-10-27 6:06 AM
There is no automatic buffer. You need to be ready to receive when characters come in, not after.
That means you need to use a non-blocking receive call.
HAL_UART_Receive_IT or HAL_UART_Receive_DMA with appropriate data handling. Called before characters are transmitted.
2025-10-27 6:21 AM - edited 2025-10-27 6:29 AM
Yes perfect thanks!
2025-10-27 6:30 AM
Are interrupts enabled and set up?
There's nothing wrong with the code you presented. Issue is elsewhere.