Skip to content

diag(teensy4/flexio-rx): dump mCaptureBuffer[0..7] on both wait() paths (refs #3066 phase 1) - #3068

Merged
zackees merged 1 commit into
masterfrom
diag/3066-iter4-buffer-dump
Jun 15, 2026
Merged

zackees merged 1 commit into
masterfrom
diag/3066-iter4-buffer-dump

Conversation

@zackees

@zackees zackees commented Jun 15, 2026 •

Copy link
Copy Markdown
Member

Summary

Loop iter 4 of #3066. Extends the wait()-timeout diagnostic block from PR #3067 to dump the first 8 words of mCaptureBuffer on both the TIMEOUT and SUCCESS exits. Distinguishes 'shifter never fired' from 'shifter fired but all samples were zero' without an oscilloscope.

Iter 4 finding that this dump made visible

Trying TIMENA=0 + TIMRST=0 + TIMCMP=10 (free-running 5.5 MHz sample mode) produced:

[FlexIO RX] wait() SUCCESS: transfers_done=0/6064
[FlexIO RX] mCaptureBuffer[0..7]: 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0

DMA channel reported completion (CITER reloaded to BITER) without ever copying a non-zero word into RAM. Either the shifter never fired or the ISR misfired. The TIMENA=0/TIMCMP=10 experiment itself is reverted; only the diagnostic stays.

Test plan

  • Live: diagnostic fires correctly on both paths.
  • CI

Refs #3066

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Enhanced diagnostic logging for Teensy 4.x FlexIO RX channel operations to provide better visibility into data transfer behavior and help troubleshoot timeout issues.

…hs (refs #3066 phase 1)

Extends the wait()-timeout diagnostic block introduced by PR #3067 to
also dump the first 8 words of mCaptureBuffer on both the TIMEOUT and
SUCCESS exits. Distinguishes 'shifter never fired' from 'shifter fired
but all samples were zero' without an oscilloscope.

Surfaced by loop iter 4 (sub-task 1.6 investigation): trying TIMENA=0 +
TIMRST=0 + TIMCMP=10 free-running sample mode produced
`wait() SUCCESS: transfers_done=0/6064` with mCaptureBuffer all zero —
DMA channel signalled completion (CITER reloaded to BITER) without ever
copying a non-zero word into RAM. The dump turns this into actionable
data the next iteration can use.

The TIMENA=0/TIMCMP=10 experiment itself is reverted; only the
diagnostic stays. The Phase 1 active blocker is still 'wire up FlexIO RX
edge capture', the new puzzle is 'why does DMA report complete with
zero transfers'.

Refs #3066

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Jun 15, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 27b40c2e-fe4e-4dc8-bb7c-049010dd7f17

📥 Commits

Reviewing files that changed from the base of the PR and between 09e46e8 and 2661f26.

📒 Files selected for processing (1)
  • src/platforms/arm/teensy/teensy4_common/rx_flexio_channel.cpp.hpp

📝 Walkthrough

Walkthrough

FlexIoRxChannelImpl::wait() in the Teensy 4.x FlexIO RX path gains 38 lines of diagnostics: on timeout it dumps the first 8 mCaptureBuffer words; on success it computes transfers_done from DMA TCD CITER/BITER and dumps the same buffer slice.

FlexIO RX wait() Diagnostics

Layer / File(s) Summary
Timeout and success path buffer dumps
src/platforms/arm/teensy/teensy4_common/rx_flexio_channel.cpp.hpp
Timeout path logs mCaptureBuffer[0..7] (size-guarded) to distinguish "DMA never ran" from "DMA copied zeros." Success path additionally logs transfers_done derived from DMA TCD CITER/BITER before the same buffer dump.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐇 A timeout arrives with a curious stare,
"Did DMA copy data, or leave nothing there?"
Eight words from the buffer, now logged with delight,
And transfers_done glows on the success-path bright.
The rabbit inspects every byte with great care! ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch diag/3066-iter4-buffer-dump

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zackees
zackees merged commit 789724c into master Jun 15, 2026
5 of 6 checks passed
@zackees
zackees deleted the diag/3066-iter4-buffer-dump branch June 15, 2026 11:33
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jun 15, 2026
zackees added a commit that referenced this pull request Jun 18, 2026
…iter 9) (#3214)

* docs(flexio-rx): document iMXRT FlexIO architectural mismatch (#3066 iter 9)

Adds a top-of-file warning block to rx_flexio_channel.cpp.hpp capturing the
iter-9 root-cause finding from #3066: iMXRT FlexIO shifters cannot snapshot a
peer timer's count into SHIFTBUF, and SMOD=1+TIMOD=3 collides shift-and-store
on the same compare event per NXP's own documentation ('shift registers
cannot shift and store on the same clock, so input data may be lost').

This explains the all-zero captures that PRs #3067/#3068/#3069/#3070/#3071
chased without success and the loop's pause at the 5-PR cap. Future readers
should know not to twist more knobs on this file — the path forward is
FlexPWM RX (Phase 4 of #3066), which has dedicated SMx_CAPTCTRL input-capture
silicon.

Pure comment change. Verified compiles via 'bash compile teensy40 --examples
AutoResearch'. References issue comment #3066/4740201201 for the full
register-by-register NXP cross-check.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* fix(flexio-rx): drop emoji per C++ style (CodeRabbit on #3214)

Replace the warning-triangle emoji with a 'WARNING:' text prefix per
the FastLED C++ guideline against emoji in source files.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant