Repository navigation
piolib: do not try to claim DMA channels that machine has already used - #65
Merged
Merged
Conversation
TinyGo machine always uses DMA channel 0 for SPI0 and channel 1 for SPI1. ClaimChannel started at channel 0, so I2S got the same channel as SPI0. The first SPI write then stopped the I2S DMA and the program hung. Start the search at channel 2.
Member
Author
|
@soypat I need this for https://github.com/hybridgroup/tinypod if you could PTAL? Thank you! |
soypat
approved these changes
Oct 11, 2026
Collaborator
|
Thank you for the contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TinyGo
machinealways uses DMA channel 0 for SPI0 and DMA channel 1 for SPI1. Seespi0DMAChannelinsrc/machine/machine_rp2.go.ClaimChannelin piolib started the search at channel 0. Thus a piolib driver can get the same channel as SPI0.Example:
piolib.I2Ssends audio and an SD card is on SPI0. The first SPI write changes the I2S DMA channel. Then the program stops.This change starts the search at channel 2.
Test on a xiao-rp2350 with
piolib.I2Sto a PCM5102 and a microSD card on SPI0: