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 PSRAM in DmaTxBuf #2161

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

Conversation

liebman
Copy link
Contributor

@liebman liebman commented Sep 15, 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

This PR adds support for PSRAM in DmaTxBuf allowing DMA transfers out from PSRAM.

Some observations:

  • it seems to only work with octal PSRAM
  • there seem to be some edge cases where
    • changing the CHUNK_SIZE makes it work or fail
    • changing the BUFFER_SIZE makes it work or fail

Testing

-The example now works with log (actual issue was my confusion)

  • I added a hardware test that fails :-(
  • this mostly works on esp32s3 with opsram-8m and one with psram-2m

@bugadani
Copy link
Contributor

(and 100% fails on an esp32s3 with psram-2m)

Lovely, maybe it has something to do with the reduced bandwidth of QSPI vs OSPI?

esp-hal/src/dma/mod.rs Outdated Show resolved Hide resolved
@liebman
Copy link
Contributor Author

liebman commented Sep 15, 2024

(and 100% fails on an esp32s3 with psram-2m)

Lovely, maybe it has something to do with the reduced bandwidth of QSPI vs OSPI?

Actually I think it was because one of my modules only has quad psram-2m and I had it configured for opsram-2m

example seems to work now

esp-hal/src/dma/mod.rs Outdated Show resolved Hide resolved
esp-hal/src/dma/mod.rs Outdated Show resolved Hide resolved
esp-hal/src/dma/mod.rs Outdated Show resolved Hide resolved
esp-hal/src/dma/mod.rs Outdated Show resolved Hide resolved
@liebman liebman marked this pull request as ready for review September 18, 2024 22:55
esp-hal/src/dma/mod.rs Outdated Show resolved Hide resolved
// no need for block size if the buffer is in DRAM
if is_slice_in_dram(buf.buffer) {
buf.block_size = None;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

There should be a check here to make sure block_size is provided when the buffer is in PSRAM

Copy link
Contributor Author

@liebman liebman Sep 19, 2024

Choose a reason for hiding this comment

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

I tested dma from psram with all of the block sizes and they all worked on octal psram. I think even none worked - that would have used the default register value. But yea - maybe we should force users to be specific.

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.

3 participants