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

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

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.

esp-hal/src/soc/esp32/psram.rs Outdated Show resolved Hide resolved
esp-hal/src/soc/esp32/psram.rs Outdated Show resolved Hide resolved
esp-hal/src/soc/esp32/psram.rs Outdated Show resolved Hide resolved
@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

esp-hal/build.rs Outdated Show resolved Hide resolved
@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
xtask/src/lib.rs Outdated Show resolved Hide resolved
esp-hal/src/soc/mod.rs Outdated Show resolved Hide resolved
esp-hal/src/soc/esp32/psram.rs Outdated Show resolved Hide resolved
esp-hal/Cargo.toml Outdated Show resolved Hide resolved
@bjoernQ bjoernQ force-pushed the esp-hal/remove-psram-features branch from 03a10f7 to f1d0a51 Compare September 19, 2024 11:20
esp-hal/MIGRATING-0.20.md Outdated Show resolved Hide resolved
esp-hal/src/soc/mod.rs Outdated Show resolved Hide resolved
}

/// Provide exclusive access to the protected data to the given closure
pub(crate) fn with<R>(&self, f: impl FnOnce(&mut T) -> R) -> R {
Copy link
Member

Choose a reason for hiding this comment

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

With this API you can call with inside with and LockState is not reentrant, so we'll get a panic if we do that. I suppose it's an internal API so maybe it's okay to live with this limitation.

Copy link
Contributor

Choose a reason for hiding this comment

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

Panicking is kind of the point here, that's what allows the mutable access.

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.

4 participants