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

support dma chunk sizes other than 4092 #1758

Merged
merged 6 commits into from
Jul 15, 2024
Merged

Conversation

liebman
Copy link
Contributor

@liebman liebman commented Jul 4, 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 📖

This PR will allow dma "chunk sizes" other than the default 4092.

Description

This is needed to support DMA to/from psram on the esp32s3 where it requires that the size and address pointer fields in each DmaDescriptor are required to be "block" aligned where the block alignment is selectable from the set of 16, 32, or 64 bytes. (support for DMA to/from psram will be a seperate PR)

  • the dma_buffer type macros were refactored to remove code duplication and to add _chunk_size variants.
  • the DmaDescripterChain was changed to support specifing the chunk size.

Testing

tests were added for all of the dma_ macros
added an additional mem2mem test using a different CHUNK_SIZE

@liebman liebman marked this pull request as ready for review July 4, 2024 19:59
@liebman
Copy link
Contributor Author

liebman commented Jul 5, 2024

@bjoernQ In my previous PR I fixed a HIL test issue by Insuring that the test dropped the Mem2Mem struct and in the drop explicitly reset the "memory to memory" bit. Thinking on this I think we should utilize the RegisterAccess::init() function to initialize all bits that are known cause undefined behavior. Thoughts? (could be done in a separate PR)

liebman added 5 commits July 5, 2024 09:27
- `.div_ceil()`
- return errors for bad chunk size and buffer sizes in Mem2Mem constructors
- correct 0 chunk size check in descripter macros
@bjoernQ
Copy link
Contributor

bjoernQ commented Jul 6, 2024

@bjoernQ In my previous PR I fixed a HIL test issue by Insuring that the test dropped the Mem2Mem struct and in the drop explicitly reset the "memory to memory" bit. Thinking on this I think we should utilize the RegisterAccess::init() function to initialize all bits that are known cause undefined behavior. Thoughts? (could be done in a separate PR)

Sounds good to me! Better to not hope for defaults being always set

@liebman
Copy link
Contributor Author

liebman commented Jul 6, 2024

Sounds good to me! Better to not hope for defaults being always set

Added.

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

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.

LGTM, thanks!

@JurajSadel JurajSadel added this pull request to the merge queue Jul 15, 2024
Merged via the queue into esp-rs:main with commit 1631f22 Jul 15, 2024
30 checks passed
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.

4 participants