imx6ul uart stop bit validation

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

imx6ul uart stop bit validation

433 Views
stamatispoulios
Contributor I

 

Dear all,

I am trying to figure out how is UART peripheral handling and validating the incoming data. According to the reference manual of imx6ul:
"Once the start bit is found, the data bits, parity bit (if enabled), and stop bits (either 1 or 2 depending on user selection) are shifted in. Parity is checked and its status reported in the URXD register when parity is enabled. Frame errors and BREAKs are also checked and reported."
Yet I cannot figure out if the incoming frame is validated as correct or not.

There is a use case where I would expect the incoming bits to be validated (according to setup of parity, stop bits, baud rate) and if one of the conditions is not met, to discard the data and reset the receiver. To test that I tried to send data from Device 1 (with a baud rate of 38400) to Device 2 (with UART peripheral set in 115200 baud rate), both set as 8N1. Sending the character 'a' (0x61 or b'01100001) via minicom from Device 1, two characters are received in Device 2 (0x1C and 0xFC in that sequence).

What is probably happening is explained in the attached image. On the top part of the image (blue), is the data sent by Device 1 via Tx signal. On the bottom (yellow) is the data as received by Rx of Device 2. Since Device 2 is set in higher baud rate, data are read in higher rate (x3) with respect to data sent by Device 1 resulting in false reading of the input due to higher sampling. Based on the setup, after the 8th bit (yellow A7) there should be a stop bit (which apparently is not present since the signal should be read in 38400 rate). Shouldn't the UART peripheral discard that character, since there is stop bit violation? I couldn't find any related setting that would permit that. I am pretty sure that it should be there, but can't find it! Could it possibly be a driver issue?

 

UART_char_validation.png

 

Any hint would be kindly appreciated.

Thank you in advance!

0 Kudos
Reply
0 Replies