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

dma: add Mem2Mem to support memory to memory transfer #1738

Merged
merged 20 commits into from
Jul 3, 2024

Conversation

liebman
Copy link
Contributor

@liebman liebman commented Jun 28, 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.
  • My changes are in accordance to the esp-rs API guidelines

Extra:

Pull Request Details 📖

Implement memory to memory copy via DMA

Description

Utilize hardware support for memory copy via DMA.

  • Internal memory to internal memory
  • Resolve how to choose what dma "slot" to use for why see
  • Safety information for Mem2Mem::new_unsafe()
  • Test on all chips that support GDMA
  • Implement safe constructor
  • Implement test

External memory support for esp32s3 will be a separate PR.

Testing

new dma_mem2mem example:

  • esp32s3
  • esp32c2 (esp8684)
  • esp32c3
  • esp32c6
  • esp32h2

esp-hal/src/dma/mod.rs Outdated Show resolved Hide resolved
esp-hal/src/dma/gdma.rs Outdated Show resolved Hide resolved
Copy link
Member

@SergioGasquez SergioGasquez left a comment

Choose a reason for hiding this comment

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

I think we could add a test for this, it could be very very similar to the example. This could be added in this PR or in a following PR.

@liebman
Copy link
Contributor Author

liebman commented Jul 2, 2024

I think we could add a test for this, it could be very very similar to the example. This could be added in this PR or in a following PR.

Test added

esp-hal/src/dma/gdma.rs Outdated Show resolved Hide resolved
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 - Thanks! Feel free to address or ignore the nit-pick comment

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.

Thanks, LGTM!

@jessebraham jessebraham added this pull request to the merge queue Jul 3, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 3, 2024
Copy link
Member

@SergioGasquez SergioGasquez left a comment

Choose a reason for hiding this comment

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

For some reason, on S3, the new test passes but makes other DMA tests fail and leaves it on a weird state that even subsequent runs fail (unless we erase the flash).

Merge queue action run: https://github.com/esp-rs/esp-hal/actions/runs/9779910668/job/27001936414

We have two options: Investigate the issue and fix it or cfg the mem2mem test for S3 and add the issue in #1524

@liebman
Copy link
Contributor Author

liebman commented Jul 3, 2024

I think I have a fix - will push shortly.

@jessebraham jessebraham added this pull request to the merge queue Jul 3, 2024
Merged via the queue into esp-rs:main with commit cc70776 Jul 3, 2024
30 checks passed
@liebman liebman deleted the dns-m2m-esp-hal branch July 3, 2024 18:10
@SergioGasquez SergioGasquez mentioned this pull request Jul 4, 2024
5 tasks
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.

5 participants