Skip to content

ESP32-S3: Stray byte read on UART when first created #8890

@dhalbert

Description

@dhalbert

Rediagnosis of #8887:

When a busio.UART() device is first created on an ESP32-S3, a stray byte of some number of consecutive 1's may be read put into the input buffer. I saw this on both 8.2.9 and 9.0.0-beta.0, so it's not ESP-IDF version-dependent.

Adafruit CircuitPython 9.0.0-beta.0 on 2024-01-27; Adafruit QT Py ESP32-S3 no psram with ESP32S3
>>> import board
>>> board.UART().read()
b'\xc0'

The byte read may be b\x80 (seen at 9600 baud), or c0 or e0.

I see this when the RX pin is floating or is tied to 3.3V. It does not happen when RX is tied to ground. So it's some startup transition thing.

I don't see this on ESP32-S2. A workaround is to clear the input buffer immediately after creating the UART.

May be related to #6254, but that issue talks about ESP32-S2 as well.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions