Page 1 of 1

BREAK-Detection using UART for LIN-Bus

Posted: Mon Feb 09, 2026 7:21 am
by wifitier
Hello, i'm trying to use UART of my ESP32-S3 die sniff packets on a LIN Bus. Therefore i connected a Transceiver to GPIO4 and use this as RX-Pin for UART_NUM_1 to receive data.
LIN has that special BREAK signal (13 Low-Bits) which usually bringts UART into trouble. But i've read that ESP UART has a Break-Detection included and found it fires an UART_BREAK event. But for my surprise the UART or the library adds a frame-error-byte 0x00 into the RX-Buffer as well. And it seems that it is not to be guaranteed that UART_BREAK will occure always immediately before and UART_DATA and will also not trigger UART_DATA if RX FULL is set to more than 1 Byte (default is 120 Bytes).

I'm looking for a way to defintiviely detect the BREAK without reading a 0x00 and know for sure that bytes that follows now belong to this frame and the former one is finished. I think i can only do this by reading byte-by-byte.