Repository navigation
Fix classic ESP32 I2S EOF address register latching - #3
Conversation
|
Thanks for this. I reproduced your results on Linux ARM64 with GCC 14.2 (24 failures without the fix, 343 passing with it), and CI is green. For your other core corrections, please open a separate PR for each fix. Your |
|
You're welcome, thanks for the response. Will send more along as my robot prepares them and I have had time to review so I don't unwittingly deluge you with AI slop. BTW, this is becoming a handy tool for correctness testing new code on my end, thanks for putting it together, and giving the Agon some love! |
Prepared by Codex on behalf of Brandon
In downstream Agon VDP testing, the initial correction improved a vertical
video judder symptom. Later intermittent scanline-refill symptoms remain unresolved;
this PR addresses the independently reproduced register defect.
After an EOF transmit descriptor A completes, a subsequent non-EOF descriptor B
overwrites
I2S_OUT_EOF_DES_ADDRandI2S_OUT_EOF_BFR_DES_ADDR. Software handlingthe earlier interrupt then sees B's addresses instead of A's, even while the
EOF interrupt remains pending.
The ESP32 Technical Reference Manual, registers 22.15 and 22.17
defines these as the descriptor and buffer that produced EOF. Current DMA
progress has separate OUTLINK_DSCR registers.
Move the two address updates into the existing
I2S_DESC_EOFbranch. Descriptorprogress, payload delivery, OUT_DONE and interrupt acknowledgement retain their
existing behavior. The production change is confined to that branch in
i2s_process_tx_descriptor; the other changed file adds a peripheral regression.The regression sends EOF A → non-EOF B → EOF C → non-EOF D on both classic
I2S ports, with the first EOF interrupt either pending or already cleared.
It checks retained EOF addresses, current descriptor progress, ordered payloads,
interrupt state and read-only register behavior. It uses public memory and
peripheral APIs, with no firmware image or application assets.
Validated against current master
c3259fcd1483ed881a21adf42e27e71753d736d1on Linux ARM64 with GCC 14.2.0:
assertions, 188 passing assertions.
After applying the patch:
cmake -S . -B build-eof -DCMAKE_BUILD_TYPE=Release \ -DFLEXE_LTO=OFF -DNATIVE_ARCH=OFF -DFLEXE_CCACHE=OFF \ -DCMAKE_C_FLAGS=-Wno-error=stringop-truncation cmake --build build-eof --target xtensa-tests --parallel 1 ./build-eof/xtensa-tests --quiet i2sThe GCC warning flag keeps an existing
rom_stubs.ctruncation warning visiblewithout treating it as an error; the default strict build stopped there before
any tests ran. No ROM-stub source change is included.
The original correction and regression are MIT licensed. We maintain a few
other core corrections and can follow your preferred process for those.