Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DMA starving SPI #2152

Merged
merged 4 commits into from
Sep 13, 2024
Merged

Fix DMA starving SPI #2152

merged 4 commits into from
Sep 13, 2024

Conversation

bugadani
Copy link
Contributor

Fixes #2151

Thank you, Dominic

@bugadani bugadani added the skip-changelog No changelog modification needed label Sep 12, 2024
@bugadani bugadani force-pushed the spi branch 2 times, most recently from 53f7373 to 1c56efe Compare September 12, 2024 18:13
@bugadani bugadani force-pushed the spi branch 2 times, most recently from ef8d448 to 308a979 Compare September 12, 2024 18:35
@JurajSadel
Copy link
Contributor

I tried to run spi_loopback_dma on C6 and I'm getting this:

I (125) boot: Disabling RNG early entropy source...
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] .. [73, 74, 75, 76, 77, 78, 79, 7a, 7b, 0]
[1, 0, 0, 0, 1, 1, 1, 1, 1, 1] .. [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
[2, 0, 0, 0, 1, 1, 1, 1, 1, 1] .. [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
[3, 0, 0, 0, 1, 1, 1, 1, 1, 1] .. [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]

@bugadani
Copy link
Contributor Author

Oh wow you're right. Previously even my first iteration was bad so I assumed that fixing the test was enough, but alas, not.

@bugadani bugadani marked this pull request as draft September 12, 2024 19:01
esp-hal/src/spi/master.rs Outdated Show resolved Hide resolved
@bugadani bugadani marked this pull request as ready for review September 12, 2024 20:23
@Dominaezzz
Copy link
Collaborator

Will it still work if you skip the first call to self.update()?

@bugadani
Copy link
Contributor Author

You mean line 2234? Apparently it does, yes. Funnily enough we had a start_operation that did the update for us, not sure why it wasn't used :D

@Dominaezzz
Copy link
Collaborator

Yeah that one. Nice! At least that matches esp-idf's code, which works.

Copy link
Contributor

@bjoernQ bjoernQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - great we have this tested now

Copy link
Contributor

@JurajSadel JurajSadel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@JurajSadel JurajSadel added this pull request to the merge queue Sep 13, 2024
Merged via the queue into esp-rs:main with commit 2a74add Sep 13, 2024
26 of 27 checks passed
@bugadani bugadani deleted the spi branch September 13, 2024 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog No changelog modification needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ESP32-C6: spi_loopback_dma example broken (but apparently not just the example)
4 participants