Files
rebbarb/gc_bba_test/source
Roflin 19044307bf Make the DMA descriptor test follow RRP instead of hardcoding 0x100
t_dma reported "descriptor len implausible (ring empty?)" and skipped on a
board that had just PASSED the RX test, so a frame had certainly arrived --
RWP advanced and RI fired.  The test was looking in the wrong place.

RWP/RRP are PAGE pointers into the 15-page ring, so the next unconsumed
frame's descriptor lives at RRP*256.  Reading SPRAM_BASE (0x0100)
unconditionally only works while nothing has been consumed and the ring has
not wrapped; once RRP has moved, 0x100 holds a stale or overwritten page.

t_dma now reads RRP, streams from RRP*256, and distinguishes the cases it used
to lump together:
  - RRP == RWP      -> genuinely empty, SKIP, and says to send it a frame
  - page outside 1-15 -> FAIL, with the page number
  - implausible len  -> FAIL, and reports RWP too so it is diagnosable

The old message could not tell "no frame yet" from "looked in the wrong
place", which is exactly why the skip was mysterious.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-10-09 10:55:15 +02:00
..