cancel
Showing results for 
Search instead for 
Did you mean: 

UART behavior on reception error, flags set, e.g. PE, NE, FE

apullin
Associate II

Alright, I am searching the STM32L4 reference manual (RM0351), and as far as I can see, there is no description of how the UART is expected to behave when various "reception error" flags are set. In my case, I am observing NE when resetting a modem, and I expect that NE, FE, or PE are happening somewhere in the field, stochastically.

Does UART function get blocked by the setting of any of the error flags? NE, PE, FE, ORE.

Maybe I am having selective blindness and I cannot see the part of the manual where this is described in detail ...

My observation (on STM32L496AG) is that when NE becomes set, TX no longer sends characters and RX no longer receives.

(But: I don't have access to the pins & a scope, so only one of those might be true, actually)

But since NE happens right at the time I reset the mode, I can clear the flag, and observe that then everything works as expected.

Autobaud is not in use, so I don't think the issue is the UART ending up at the wrong baud rate.

The interaction is being done is simple, just using the busywait `HAL_UART_Transmit` and `HAL_UART_Receive` functions.

There is a little bit of mention in the RM of DMA disablement on certain reception errors, but that's all I can see.

1 REPLY 1

AFAIK, PE, NE, FE don't block the UART itself. It may be that the Cube/HAL software is written so that it blocks - I don't use Cube.

ORE *does* block UART Rx.

JW