Repository navigation
Conversation
…e next frame An overflow of the UART RX FIFO loses bytes at an unknown place in the stream. The handler had code for it (reset the FIFO) but RXFIFO_OVF was not in the enable mask of my_uart_init, so it never ran, and it came after the receive code anyway: the frame in progress carried on with whatever arrived next. It was delivered cut short, or glued to the next frame when its closing 0xC0 was lost, or the rest of a frame was taken for a frame, and the dispatcher ran a command nobody sent. Enable RXFIFO_OVF and handle it first in the pass: the FIFO is emptied and not read, the open frame is thrown away, and everything up to the next 0xC0 is skipped (it ends the damaged frame or starts the next). With no frame open there is nothing to skip. Seen on a C64U with the module's RTS flow control forced off for a hold under load: frames that began in the middle of an echo payload were answered as commands, and the link was dead afterwards. With flow control on, this needs a sender overrunning RTS (the margin is 6 characters); the same my_uart.c is in raw_u64, raw_c3 and u64ctrl, all three change. Host tests (software/wifi/tests, `make isr`): 5 cases, RED on this file's parent, plus five models of the code before the fix (`make isr-red`). The module identity is bumped as a placeholder; the maintainers assign the number at merge. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
GideonZ#1041 (wifi-fixes) adds its own software/wifi/tests; the two trees would collide on Makefile and stub/. Nothing else changes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Two fixes edited the same lines of the Makefile; each now adds a file, and the Makefile includes isr_*.mk. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…er does (raw status in the RX branch) The first version enabled the RXFIFO_OVF interrupt and handled it at the top of the pass. The mechanism that ran on hardware (a C64U, an RX overflow forced by switching the module's RTS flow control off for a hold under load: the module stayed alive, rx_fifo_ovf counted 1) keeps the interrupt disabled and looks at the raw status inside the RX branch, at the interrupt the full FIFO brings. This takes that mechanism, so the hardware result applies to what is merged: same detection point, same actions (the FIFO emptied and not read, the open frame thrown away, skip to the next 0xC0). The enable mask is as on master; the dead overflow branch at the end of the pass is as on master. Only the bench's counter is left out (master has no link counters). Host harness: the stub offers the raw status (uart_hal_get_intraw_mask); the cases are the same and still fail on master; the models of the old handler follow the new detection (isr_ovf.mk). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The CI step "make host_tests" runs the other host suites; this one is added to it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…1078) Brings in GideonZ#1077 (updated onto master). Module IDENT renumbered after master: raw_u64 1.19, raw_c3 1.12, u64ctrl 1.30. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Brings in GideonZ#1078 and GideonZ#1077 (updated onto master). Module IDENT renumbered after master and GideonZ#1078: raw_u64 1.20, raw_c3 1.13, u64ctrl 1.31. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…u64 1.23, raw_c3 1.15, u64ctrl 1.33 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…dule identity raw_u64 1.24, raw_c3 1.16, u64ctrl 1.34 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
@JC-000 thanks for this. #1077 is merged, and I re-reviewed this PR at head 7866cfb. Code review. The overflow handling in Host red/green at head.
Thresholds in the IDF 6 stack. The plan was to check whether that stack changes the margin this was tested under. #1028 keeps the UART thresholds (RX full 120, TX empty 10, flow control 122). #996 sets RX full and TX empty to 64. On the RX side, 64 leaves 64 bytes of FIFO headroom instead of 8. Overflows become rarer, and this handling still applies. The host cases inject bytes directly and do not model the threshold. The TX value is not applied in either tree, as #1079 says. In Hardware. Your hardware rows ran bench build 7b15448a7, which none of the PR heads contain. I want to repeat the forced overflow red/green on master + this PR on the Ultimate 64 Elite (raw_u64, flashed) and the U2+L (raw_c3, CI build). Could you share the bench change that turns module RTS flow control off for the hold, as a patch or a branch? I will apply it to both the red and the green build and not add it here. Our C64 Ultimate is not available for module flashing, so the u64ctrl leg will rest on your runs and on the shared code. I will say so in the final review. |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
@JC-000 thanks for dropping the sentence in 49074a0. To save you some time, I'm happy to help with the hardware side. I'll write the small bench-only change that turns module RTS off for the hold and run the overflow red/green on our devices. I'll post the patch and the results here, and none of it will be added to this PR. Our C64 Ultimate can now take module builds after all, so the u64ctrl leg can run there as well as on the Ultimate 64 Elite and the U2+L. I'll do the same on #1079 and #1071. I'm also glad to take care of the module version renumbering on #1080 and #1042 once #1078 and #1079 are in. If you already have any of this underway, just say so and I'll use yours. |
|
Thanks. We have this underway: one bench-only hold command for both #1071 and #1078 (an optional RTS-off flag for the forced overflow, plus an end-of-hold event that reports whether the RX FIFO overflowed), ported onto current master for raw_u64, u64ctrl and raw_c3. It applies cleanly to master, to this PR's head and to #1078's head, and it builds and passes host tests. It has not run on hardware yet; that happens on our Elite today. I'll post the branch link with the results afterwards. If you'd rather not wait, go ahead with your own. Written with Claude Sonnet 5.5 and Claude Opus 5.5 in Claude Code. |
|
@JC-000 thanks, that's great. I'll wait for your hold command and results rather than run my own; see my note on #1071. The module version renumbering on #1080 and #1042 is also yours. I only offered in case it helped. If you'd like the C64 Ultimate or U2+L leg run with your branch, I'm glad to do it. |
|
The hold branch is up: https://github.com/JC-000/1541ultimate/tree/45bb9428bea4778857bdff5b1c0650878dfa9aec/repro/module-hold (branch What ran on our Ultimate 64 Elite, on our bench image plus this branch. That image still has the waiting TX code, so these are #1071's "before" numbers, under a steady 600 packets/s UDP stream to the WiFi address:
Every hold answered Written with Claude Sonnet 5.5 and Claude Opus 5.5 in Claude Code. |
Fixes #1074
Problem
An overflow of the module's UART RX FIFO loses bytes at an unknown place in the stream. The frame in progress then carried on with whatever arrived next: it was delivered cut short, glued to the next frame when its closing 0xC0 was lost, or the rest of a frame was taken for a frame, and the dispatcher ran a command nobody sent. Seen on a C64 Ultimate with the module's RTS flow control forced off for a hold under load: frames that began in the middle of an echo payload were answered as commands and the link was dead afterwards.
What changed and why
On the full-FIFO interrupt the handler looks at the raw overflow status first: the FIFO is emptied without reading it, the open frame is thrown away, and everything up to the next 0xC0 is skipped (it ends the damaged frame or starts the next). With no frame open there is nothing to skip. Same
my_uart.cin raw_u64, raw_c3 and u64ctrl; all three change. The overflow interrupt stays disabled, as on master.This branch contains the UART interrupt handler tests PR (#1077, the harness), which goes in first. The TX-FIFO fill PR (#1079) in turn contains this one, so the three merge in that order.
Products. the ESP32 WiFi modules: raw_u64 (Ultimate 64 / Ultimate 64 Elite), raw_c3 (Ultimate-II+L) and u64ctrl (Ultimate 64 Elite II / C64 Ultimate); the same
my_uart.cis in all three. Tested on the C64 Ultimate.How I tested it
Host: macOS, with the device-free tests run in an Ubuntu 24.04 container (g++ 13.3). The hardware runs used the test harness from the same machine.
Host tests (device-free, run before and after the change):
make -C software/wifi/uart_tests isr; make -C software/wifi/uart_tests isr-redHardware.
Forcing an overflow (module RTS flow control off for a hold under load) on the C64 Ultimate: before, the link was dead after the overflow — the module stopped answering and never came back. With the change the overflow is counted once, the module keeps answering (no wedge) and the device stays reachable at 0% ping loss. With RTS flow control on, no overflow occurs (the Ultimate is held off) and the module answers as normal.
Standard profile / soak: not reported here — this change is module-side (ESP32) firmware, which the host-driven
./run-testsstandard profile and soak suites do not exercise. The module build is flashed and checked on its own (see above).Untested
Written with Claude Opus 5.5 in Claude Code.