cancel
Showing results for 
Search instead for 
Did you mean: 

UART frame error, STM32L476, HAL

steve239955_st
Associate II
Posted on October 29, 2015 at 16:58

Hello.

I have configured a UART using HAL. For most things, the same Setup that I've already had working when using blocking mode, using Transmit only.

But now I tried to use Receive also.

When the program starts to *transmit*, using the HAL function, i.e. Receive was *not* yet called, the HAL_UART_ErrorCallback is called, with ErrorCode equalling 4, i.e. HAL_UART_ERROR_FE, frame error.

When this happens, in the error handler, I clear the flag: __HAL_UART_CLEAR_FLAG( huart, UART_CLEAR_FEF );

But I keep getting the error.

As I understand, frame error is a reception error.

So why could I be getting it, as soon as I start transmission, not reception?

Btw., the RX pin of the uart is tied to VCC, so there can be no wrong Signal.

I previously configured the RX pin as regular GPIO and polled it, to see that it's the correct pin. Now the RX pin is configured as Input, and alternate is set to the GPIO_AF*_UART* of the uart used.

Regards
0 REPLIES 0