AnsweredAssumed Answered

K64F UART LF (\n) problem

Question asked by Stefan Mitic on Jul 5, 2016
Latest reply on Jul 8, 2016 by Jorge_Gonzalez


Hi,

 

we are having a problem with the UART on a FRDM-K64F board. We are trying to communicate with a device that returns LF (line feed) as part of its data and the UART seems to be having problems processing the LF when it is located in some parts of the message.

 

We are using the KSDK fsl_uart driver, the UART configuration is as follows: 9600 8N1.

We are also using the blocking functions for write and read.

 

The data we are expecting to receive is: "set uart mode 0x11\r\r\nOK\r<1.00> \r\n" (without the quotes).

The data we receive is: "set uarts0x11\r\r\nOK\r<1.00> \r"

 

We turned on the Flow Control on the K64F and that's how we determined that the "\n" is making the problems.

Provided below are captures of the oscilloscope with for the messages "set uart mode 0x11\r\r\nOK\r<1.00> \r\n" and "set uart mode 0x11\r\rOK\r<1.00> \r\n". As you can see the message without the "\n" in the middle goes through as expected.

 

The yellow signal represents the RTS from the K64F and the cyan signal represents the data going to the RX of the K64F.

 

The RTS was not connected to the CTS of the device we are trying to communicate with as we don't intend to use it on such low baud.

 

We presume that the problem is with the K64F as the RTS signal goes high for a long time.

 

     Image for "set uart mode 0x11\r\r\nOK\r<1.00> \r\n":

 

ewFile1.png

 

     Image for "set uart mode 0x11\r\rOK\r<1.00> \r\n":

NewFile1.png

 

If anyone has any idea why this is happening, or any way to fix it, that would be nice.

 

Thanks in advance,

Stefan Mitic.

Outcomes