64.10. UART_RXLINE_STATUS
64.10.1. Overview
This sample show uart rxline status detection function, included Overrun errors, parity errors, framing errors, and line breaks
64.10.2. Board Setting
Except for the break tes, all others Use the usb2ttl module for testing,connect the tx pin of the module to rx pin of the board to be tested, connect the rx pin of the module to tx pin of the board to be tested,and connect th gnd pin of the module to gnd pin of the board to be tested
Please refer to Pin Description for specific board
64.10.3. Notice
According to each detection test, the uart configuration is different and needs to be configured according to the serial port configuration information output by the terminal.
64.10.4. Run steps
When the project runs correctly, the serial port terminal will output the information like:
---------------------------------------------------------------
* *
* uart rxline status demo *
* *
* 1 - overrun error test for rx line status *
* 2 - parity error test for rx line status *
* 3 - framing error test for rx line status *
* 4 - line break test for rx line status *
*-------------------------------------------------------------*
64.10.4.1. overrun error test
Manually input the ‘1’ character through the serial port, it will prompt that the uart of the sending end needs to be configured as follows in advance
Serial port baud rate is set to
115200bps,8 bits data lengthwithone stop bitandno parity bitThe data sent needs to be greater than the RXFIFO length, such as the 16 bytes shown in the following log.
Waiting for the corresponding error status to be detected
1
overrun error test start.......
##############################################################
step.1......
For the sender, please set the following uart configuration:
baudrate:115200
data bits:8
parity bits:none
stop bits:1bits
##############################################################
step.2......
Please send length more than 16 bytes
##############################################################
step.3......
waiting the rxline status detection......
overrun error status: true
##############################################################
64.10.4.2. parity error test
Manually input the ‘2’ character through the serial port, it will prompt that the uart of the sending end needs to be configured as follows in advance
Serial port baud rate is set to
115200bps,8 bits data lengthwithone stop bitandeven parity bitThe sender sends some bytes
Waiting for the corresponding error status to be detected
2
parity error test start.......
##############################################################
step.1......
For the sender, please set the following uart configuration:
baudrate:115200
data bits:8
parity bits:even
stop bits:1bits
##############################################################
step.2......
Please send some bytes
##############################################################
step.3......
waiting the rxline status detection......
parity error status: true
##############################################################
64.10.4.3. framing error test
Manually input the ‘3’ character through the serial port, it will prompt that the uart of the sending end needs to be configured as follows in advance:
Serial port baud rate is set to
115200bps,8 bits data lengthwithone stop bitandno parity bitThe sender sends some bytes
Waiting for the corresponding error status to be detected
3
framing error test start.......
##############################################################
step.1......
For the sender, please set the following uart configuration:
baudrate:115200
data bits:8
parity bits:none
stop bits:1bits
##############################################################
step.2......
Please send length more than 16 bytes
##############################################################
step.3......
waiting the rxline status detection......
framing error status: true
##############################################################
64.10.4.4. line break test
connect uart rx pin to break signal pin(Please refer to Pin Description)
Manually input the ‘4’ character through the serial port
If the uart rx pin is connected the break signal pin, enter ‘t’ to confirm
Waiting for the corresponding error status to be detected
4
line break test start.......
##############################################################
step.1......
Please connect uart rx pin to break signal pin. enter 't' to confirm.......
t
##############################################################
waiting the rxline status detection......
line break status: true
##############################################################