Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dhalbert opened this issue Feb 7, 2024 · 1 comment · Fixed by #9193
Closed

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

dhalbert opened this issue Feb 7, 2024 · 1 comment · Fixed by #9193
Assignees
Milestone

Comments

@dhalbert
Copy link
Collaborator

dhalbert commented Feb 7, 2024

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.

@dhalbert
Copy link
Collaborator Author

dhalbert commented Apr 5, 2024

retest in 9.1.x

EDIT: still happens in 9.1.0-beta.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant