Page 1 of 1

ESP32 UART event UART_DATA size -1

Posted: Sat Sep 23, 2023 7:35 am
by elektrofuzzis
Hi,

I'm working with the standard UART driver. My event-task gets events using xQueueReceive.

UART_DATA events are processed without any trouble.

UART_BREAK events show some data and event's size is realistic. But sometimes I get very high values, e.g. 1070515788 or 4294967295.

What's wrong?

Stefan

Re: ESP32 UART event UART_DATA size -1

Posted: Sat Sep 23, 2023 11:40 am
by MicroController
UART_BREAK events don't have any data.
The size values you are seeing in UART_BREAK events are just 'random' values from the stack.
uart_event_t::size is only valid if and when uart_event_t::type is UART_DATA and must be ignored for all other event types.