Author Topic: Kinestis UART responds 0x17 (DEVICE CONTROL) when receiving  (Read 173 times)

Offline Raffaele

  • Newbie
  • *
  • Posts: 42
    • View Profile
Hi,
I setup a UART interface on a kinetis KL03 to Tx an Rx. The device can both receive and transmit. But I'm having a problem. Every time I receive a message, the device also sends back a sequence of 0x17 or 0x11 with some 0x19?
These seem to be control commands but I am not sure why, and if there is any way to remove them

Thank you

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3060
    • View Profile
    • uTasker
Re: Kinestis UART responds 0x17 (DEVICE CONTROL) when receiving
« Reply #1 on: May 26, 2020, 03:26:58 PM »
Hi

The command line interface will tend to echo input characters:
fnEchoInput(ucInputMessage, Length);
so if this is causing the transmission on each reception it could be that the baud rate is not matching and so multiple receive characters are detected and the 'strange' values detected are being echoed back (maybe at a different speed(?)).

Regards

Mark

Offline Raffaele

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: Kinestis UART responds 0x17 (DEVICE CONTROL) when receiving
« Reply #2 on: May 26, 2020, 03:55:53 PM »
thanks Mark.

I'll check that.
Since I define my own interface, which task or function could be echoing the characters? application.c does this but I don't call the task. Can I uncomment the fnEchoInput somewhere?

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3060
    • View Profile
    • uTasker
Re: Kinestis UART responds 0x17 (DEVICE CONTROL) when receiving
« Reply #3 on: May 26, 2020, 05:10:07 PM »
The task scheduled on each character reception is defined by tInterfaceParameters.Task_to_wake when the interface is opened.
How this task reacts to the input depends on its content.

Regards

Mark

Offline Raffaele

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: Kinestis UART responds 0x17 (DEVICE CONTROL) when receiving
« Reply #4 on: May 26, 2020, 11:33:52 PM »
Mark

is there a way to flush the Tx/Rx UART buffers?

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3060
    • View Profile
    • uTasker
Re: Kinestis UART responds 0x17 (DEVICE CONTROL) when receiving
« Reply #5 on: May 28, 2020, 10:06:16 PM »
As long as
SUPPORT_FLUSH
is enabled the TTY queues can be flushed with

fnFlush(serial_handle, FLUSH_RX);
fnFlush(serial_handle, FLUSH_TX);


The flush is only of SW queues and not the HW peripheral.

Regards

Mark