Skip to content

Zephyr: longer pastes over UART, and only the console stops code on Ctrl-C - #11587

Merged
mikeysklar merged 2 commits into
adafruit:mainfrom
mikeysklar:zephyr-uart-console
Oct 14, 2026
Merged

mikeysklar merged 2 commits into
adafruit:mainfrom
mikeysklar:zephyr-uart-console

Conversation

@mikeysklar

Copy link
Copy Markdown
Collaborator

What

Bigger receive buffer for the UART console, and Ctrl-C only from the console.

Why

Long lines and pastes overflowed the 64-byte UART console buffer.

Any UART or usb_cdc.data receiving byte 0x03 stopped code.py.

The console-only Ctrl-C mentioned in #11578.

Pastes over 1 KB still fail; these UARTs have no flow control.

A second hardware UART was not tested.

Board Test Before After
SiWx917-DK2605A, UART (before: main) Ctrl-C after 0, 200, 1000 unread bytes 30/30 60/60
Ctrl-C during time.sleep(10) 10/10 10/10
1000-byte line 0/5 20/20
1000-byte paste 0/5 20/20
ESP32-S31-Korvo-1, UART (before: 11.0.0-alpha.1 + board, not upstream) Ctrl-C after 0, 200, 1000 unread bytes 30/30 30/30
Ctrl-C during time.sleep(10) 10/10 10/10
1000-byte line 5/5 5/5
1000-byte paste 0/5 5/5
nRF54LM20 DK, USB (before: main) Ctrl-C after 0, 200 unread bytes 20/20 20/20
nRF54LM20 DK, USB (before: #11549, pre-merge) 0x03 on usb_cdc.data stops while True: pass 5/5 0/5
then Ctrl-C on the console 5/5
the 0x03 arrives as data (in_waiting) 0/5 5/5
native_sim tests/ except the display tests (need PIL) 98/98 pass
SiWx917-DK2605A, ESP32-S31-Korvo-1 RAM used +960 bytes

Written with Claude; tested on hardware by me.

🤖 Generated with Claude Code

mikeysklar and others added 2 commits October 11, 2026 20:21
At 115200 baud the REPL echo cannot keep up with a long line or paste,
and the 64-byte queue overflowed. With 1 KB, 1000-byte lines and pastes
of up to about that size go through on SiWx917-DK2605A and
ESP32-S31-Korvo-1. Costs 960 bytes of RAM.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
serial_cb() raised KeyboardInterrupt on 0x03 from every UART, including
busio.UART, board UARTs and usb_cdc.data, so a sensor sending 0x03 would
stop code.py. Pass sigint_enabled into construct_from_device, as the stm
and silabs ports store it, and set it only for the UART and USB CDC
consoles. TinyUSB ports likewise watch only the console CDC.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@tannewt tannewt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@mikeysklar
mikeysklar merged commit 5a7a2ea into adafruit:main Oct 14, 2026
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants