Skip to content

SERCOM async/DMA with SAME5x support - #395

Open
crabel99 wants to merge 84 commits into
adafruit:masterfrom
crabel99:sercom-async-dma-merge-same5x
Open

SERCOM async/DMA with SAME5x support#395
crabel99 wants to merge 84 commits into
adafruit:masterfrom
crabel99:sercom-async-dma-merge-same5x

Conversation

@crabel99

@crabel99 crabel99 commented Aug 22, 2026

Copy link
Copy Markdown

Summary

  • Extend the existing SERCOM asynchronous/DMA work across SAMD21 and SAME5x.
  • Retain asynchronous Wire, SPI, and UART transaction support.
  • Add SAME53/SAME54 core, interrupt, timing, USB, and peripheral-family guards.
  • Add multimaster Wire role transitions, slave DMA, transaction chaining, and bounded error recovery.
  • Pin the reviewed TinyUSB and ZeroDMA dependency revisions.

This replaces #385. The original PR remains available for its discussion and history, but its sercom-async-dma head diverged before the SAME5x integration work. This replacement allows CI and review to run against the branch containing the SAME5x integration without rewriting the old public branch.

Validation

Automated validation

  • GitHub Actions: all required checks pass.
  • Native and contract tests: 32 of 32 pass against the pinned dependency revisions.
  • Metro M0 example matrix: 24 passed, 0 failed, 37 skipped.
  • Metro M4 example matrix: 20 passed, 0 failed, 41 skipped.
  • SAME54 Xplained production configuration builds successfully.
  • SparkFun Qwiic Micro SAMD21 production configuration builds successfully.

Hardware validation

  • MCUs: SAMD21G18A and SAME54P20A.
  • Configuration: two-node I2C bus with dynamic master/slave role reversal.
  • Covered asynchronous writes and reads, combined write/read transactions, repeated START, DMA and byte-driven transfers, queued transfers, and error-recovery paths.
  • The complete 17-case hardware matrix passed with the pinned dependency revisions.

Dependencies

  • Adafruit TinyUSB Arduino: 08e7e9cd22ad5dcd5465536caa6f0b200eb12486
  • Adafruit ZeroDMA: 25e92a0811b364a068989c43788727c18803fc77

crabel99 added 30 commits June 20, 2026 09:46
…added stopTransmissionWIRE to allow sync closeout, handle errors and continue processing the transaction queue
- Fix misleading indentation in retry logic (lines 847, 857)
- Remove ambiguous overload for Wire.begin() with integer literals
  (uint16_t version now requires explicit enableGeneralCall parameter)
- Remove unused variable in SPI.cpp
- Remove redundant unsigned < 0 check in setPending()
- Add __attribute__((weak)) to all SPI interrupt handlers (SERCOM4, SPI1, etc)
  This allows variants to override them when SERCOM is used for other
  peripherals (e.g., MKR variants use SERCOM4 for Serial2/UART)

- Explicitly cast slave addresses to uint8_t in Wire examples to avoid
  any potential overload resolution issues on different compiler versions
crabel99 added 27 commits July 24, 2026 15:05
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