ESP32 UART event UART_DATA size -1

elektrofuzzis
Posts: 2
Joined: Sat Dec 19, 2020 2:32 am

ESP32 UART event UART_DATA size -1

Postby elektrofuzzis » Sat Sep 23, 2023 7:35 am

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

MicroController
Posts: 1552
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: ESP32 UART event UART_DATA size -1

Postby MicroController » Sat Sep 23, 2023 11:40 am

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.

Who is online

Users browsing this forum: No registered users and 206 guests