UART framing errors do not get cleared

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

UART framing errors do not get cleared

1,182 Views
pivkluka
Contributor III

We have a communication running over UART and we have issues with clearing framing errors.

If we communicate normally and do do not generate to many errors then we can clear S1[FE] flag without issues. ( we clear it by reading S1 and reading D ).

But we noticed that if we leave the UART running over longer times and produce lots of framing errors it becomes impossible to clear. S1 flag just wont reset any more after trying to clear it.

Did you observe anything similar?

Labels (3)
0 Kudos
4 Replies

762 Views
pivkluka
Contributor III

Hi,

my setup includes 


UART1 and 2 both operating in DMA  mode

Here are some registry entries -> 

RWFIFO & TWFIFO = 1

C3 = flags ORIE, FEIE and PEIE are set to 1

C2 = RE and TE are enabled. RIE and TIE are also enabled

C5 = TDMAS and RDMAS are set to 1

After some time running and creating lots of framing errors (thousands) it looks like S1[FE] does not get cleared again. 

To clear S1[FE] I do this -> 

Read register S1 and D.

0 Kudos

762 Views
jamesbone
NXP TechSupport
NXP TechSupport

Hello Pivk Luka,

Take in consideration that reading an empty data register to clear one of the flags of

the S1 register causes the FIFO pointers to become misaligned. A receive FIFO flush reinitializes the pointers.
A better way to prevent this situation is to always leave one byte in FIFO and this byte will be read eventually in
clearing the flag bit.
0 Kudos

762 Views
pivkluka
Contributor III

Any update on this?

0 Kudos

762 Views
pivkluka
Contributor III

Hi,

Well as I told you I use DMA, and its not possible to really leave 1 byte there. And DMA by it self does not clear FE flag so to clear it I have to read that 1 byte. If there is any other way please let me know I will try it.

0 Kudos