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 known SPI issues #2179

Merged
merged 12 commits into from
Sep 19, 2024
Merged

Fix known SPI issues #2179

merged 12 commits into from
Sep 19, 2024

Conversation

bugadani
Copy link
Contributor

@bugadani bugadani commented Sep 17, 2024

Thank you for your contribution!

We appreciate the time and effort you've put into this pull request.
To help us review it efficiently, please ensure you've gone through the following checklist:

Submission Checklist 📝

  • I have updated existing examples or added new ones (if applicable).
  • I have used cargo xtask fmt-packages command to ensure that all changed code is formatted correctly.
  • My changes were added to the CHANGELOG.md in the proper section.
  • I have added necessary changes to user code to the Migration Guide.
  • My changes are in accordance to the esp-rs API guidelines

Extra:

Pull Request Details 📖

Description

Changes include:

  • Guarantee 4-byte alignment which is needed for some reason for PDMA
  • Use is_done in wait to actually wait for the DMA to finish transferring from SPI to memory. This prevents weird test failures where an assert fails, then prints that the buffer and the expected value match.
  • Clear interrupts after configuring DMA, which fixes the second call to dma_transfer
  • Reintroduces a short wait for ESP32, which doesn't have an update bit so it starts transferring data before the DMA engine is ready.

Fixes #2098
Fixes #2186

Testing

yes

esp-hal/src/dma/mod.rs Outdated Show resolved Hide resolved
esp-hal/MIGRATING-0.20.md Outdated Show resolved Hide resolved
@bugadani bugadani marked this pull request as ready for review September 18, 2024 08:12
@liebman liebman mentioned this pull request Sep 18, 2024
6 tasks
esp-hal/src/dma/mod.rs Show resolved Hide resolved
esp-hal/src/dma/mod.rs Outdated Show resolved Hide resolved
@bugadani
Copy link
Contributor Author

Ah finally CI reproduces my local issues with ESP32. Fun!

@bugadani bugadani changed the title Fix asymmetric SPI issues Fix known SPI issues Sep 18, 2024
esp-hal/CHANGELOG.md Outdated Show resolved Hide resolved
esp-hal/CHANGELOG.md Outdated Show resolved Hide resolved
esp-hal/src/dma/mod.rs Show resolved Hide resolved
esp-hal/src/spi/master.rs Show resolved Hide resolved
esp-hal/CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@bugadani
Copy link
Contributor Author

I solemnly wov that the ESP32 tests pass locally.

Copy link
Member

@jessebraham jessebraham left a comment

Choose a reason for hiding this comment

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

@bugadani Sounds good 😁 Changes LGTM, thanks!

@jessebraham jessebraham added this pull request to the merge queue Sep 19, 2024
Merged via the queue into esp-rs:main with commit 5de267a Sep 19, 2024
27 of 28 checks passed
@bugadani bugadani deleted the s2-spi branch September 19, 2024 18:28
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.

ESP32: test_symmetric_dma_transfer test broken ESP32-S2: SPI DMA test_asymmetric_dma_transfer fails
6 participants