Page 1 of 1

UART Response Issue

Posted: Wed Jan 17, 2018 12:14 am
by Rx-365
I am working with the ESP-IDF and am having a vast amount of difficulty accomplishing a task with the UART.

I am trying to speak the LIN protocol over my UART. To do this I have to sense a frame break on the UART RX. (I can do this fine). Once the frame break comes through the device needs to parse in the next available character (the frame header) and then respond to the header using the TX.

My problem is in configuring the UART to be able to be flushed and read within 100 us. After the flush the next characters I get are never correct. I am wondering if I am misunderstanding some of the finer points of the function:

int uart_read_bytes(uart_port_t uart_num, uint8_t* buf, uint32_t length, TickType_t ticks_to_wait);

The data in my buffer after my flush then read call never makes sense.

Re: UART Response Issue

Posted: Thu Jan 18, 2018 9:50 pm
by Rx-365
I have solved this problem. If anyone is interested in a solution please DM me.

Re: UART Response Issue

Posted: Thu Jan 20, 2022 10:04 pm
by Gianlu
Rx-365 wrote:
Wed Jan 17, 2018 12:14 am
My problem is in configuring the UART to be able to be flushed and read within 100 us. After the flush the next characters I get are never correct. I am wondering if I am misunderstanding some of the finer points of the function:

int uart_read_bytes(uart_port_t uart_num, uint8_t* buf, uint32_t length, TickType_t ticks_to_wait);

The data in my buffer after my flush then read call never makes sense.
Hello!

I'm experiencing the same issue.. How were you able to solve this?

Thx and greetings!