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

Remove most PSRAM features #2178

Merged
merged 8 commits into from
Sep 20, 2024

Conversation

bjoernQ
Copy link
Contributor

@bjoernQ bjoernQ 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

This gets rid of most of the PSRAM related features. We still need psram and octal-psram however

This also adds auto-detection of PSRAM size (by using the RAM chip id on S2/S3, just probing memory on ESP32 since reading the chip id didn't work as expected)

The user now needs to pass a configuration parameter to psram_initialize - this way they could avoid RAM size auto-detect and configure things like the PSRAM SPI frequency

Testing

Examples still work

@bjoernQ bjoernQ changed the title Esp hal/remove psram features Remove most PSRAM features Sep 17, 2024
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.

Really nice to make this runtime configurable!

Do you think we could write some basic tests? It might depend on what's currently on the runners but I'm sure we can swap out some bits if we need to.

@bjoernQ bjoernQ force-pushed the esp-hal/remove-psram-features branch from f28878a to 161c546 Compare September 18, 2024 12:28
@bjoernQ bjoernQ added the skip-changelog No changelog modification needed label Sep 18, 2024
@bjoernQ
Copy link
Contributor Author

bjoernQ commented Sep 18, 2024

skip-changelog because of esp-alloc

@bjoernQ bjoernQ force-pushed the esp-hal/remove-psram-features branch from fde90d5 to 3fe55f6 Compare September 18, 2024 14:23
@bjoernQ bjoernQ marked this pull request as ready for review September 18, 2024 14:23
@bjoernQ bjoernQ force-pushed the esp-hal/remove-psram-features branch from 03a10f7 to f1d0a51 Compare September 19, 2024 11:20
@MabezDev
Copy link
Member

Let's rebase this on @bugadani's lock changes, after that this looks good to go!

@bjoernQ bjoernQ force-pushed the esp-hal/remove-psram-features branch from f9977a4 to 06f8606 Compare September 20, 2024 13:34
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.

Just a doc fixup and LGTM, thanks! I'm really glad we're nuking all those feature flags :D.

Co-authored-by: Scott Mabin <[email protected]>
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.

LGTM, thanks for doing this!


let guessed_size = unsafe {
let ptr = (EXTMEM_ORIGIN + 4 * 1024 * 1024 - 36 * 1024) as *mut u8;
for i in 0..(36 * 1024) {
Copy link
Contributor

@bugadani bugadani Sep 20, 2024

Choose a reason for hiding this comment

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

Why 36K? Please explain the choice, and can we do away with scanning these blocks fully?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Idea is to write and read more than fits the cache

Ideally we get reading the chip id to work - that would be the best solution

@jessebraham jessebraham added this pull request to the merge queue Sep 20, 2024
Merged via the queue into esp-rs:main with commit 37fa662 Sep 20, 2024
27 of 28 checks passed
@bjoernQ bjoernQ deleted the esp-hal/remove-psram-features branch November 26, 2024 08:41
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.

5 participants