Skip to content

Commit

Permalink
Add support for 80Mhz psram, selected using 'psram-80mhz' feature (#1073
Browse files Browse the repository at this point in the history
)

* Add support for 80Mhz psram, selected using 'psram-80mhz' feature

Default stays 40 MHz

* Added changelog regarding 80MHz PSRAM support

* Add 80Mhz support also to octal psram

* Add documentation for 80Mhz psram in lib.rs

* Linker script adjustments needed for wifi drivers (#1074)

* Add `embedded-io` feature to each chip-specific HAL (#1072)

* Add `embedded-io` feature to each chip-specific HAL

* Update `CHANGELOG.md`

* Update to `1.0.0` releases of `embedded-hal-*` packages (#1068)

* Update to `1.0.0` releases of `embedded-hal-*` packages

* Update `CHANGELOG.md`

* Added changelog regarding 80MHz PSRAM support

---------

Co-authored-by: Björn Quentin <bjoernQ@users.noreply.github.com>
Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 12, 2024
1 parent 944ce9a commit 0f9e246
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add `rt-riscv` and `rt-xtensa` features to enable/disable runtime support (#1057)
- ESP32-C6: Implement deep sleep (#918)
- Add `embedded-io` feature to each chip-specific HAL (#1072)
- ESP32-S3: Added support for 80Mhz PSRAM (#1069)

### Changed

Expand Down
3 changes: 3 additions & 0 deletions esp-hal-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ opsram-4m = []
opsram-8m = []
opsram-16m = []

# PSRAM 80Mhz frequency support
psram-80mhz = []

# USB OTG support (ESP32-S2 and ESP32-S3 only! Enabled by default)
usb-otg = ["esp-synopsys-usb-otg", "usb-device"]

Expand Down
18 changes: 16 additions & 2 deletions esp-hal-common/src/soc/esp32s3/psram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,14 @@ pub(crate) mod utils {
const SPI_TIMING_CORE_CLOCK: SpiTimingConfigCoreClock =
SpiTimingConfigCoreClock::SpiTimingConfigCoreClock80m;
const FLASH_FREQ: FlashFreq = FlashFreq::FlashFreq80m;
const SPIRAM_SPEED: SpiRamFreq = SpiRamFreq::Freq40m;

cfg_if::cfg_if! {
if #[cfg(feature = "psram-80mhz")] {
const SPIRAM_SPEED: SpiRamFreq = SpiRamFreq::Freq80m;
} else {
const SPIRAM_SPEED: SpiRamFreq = SpiRamFreq::Freq40m;
}
}

#[allow(unused)]
enum FlashFreq {
Expand Down Expand Up @@ -800,7 +807,14 @@ pub(crate) mod utils {
const SPI_TIMING_CORE_CLOCK: SpiTimingConfigCoreClock =
SpiTimingConfigCoreClock::SpiTimingConfigCoreClock80m;
const FLASH_FREQ: FlashFreq = FlashFreq::FlashFreq80m;
const SPIRAM_SPEED: SpiRamFreq = SpiRamFreq::Freq40m;

cfg_if::cfg_if! {
if #[cfg(feature = "psram-80mhz")] {
const SPIRAM_SPEED: SpiRamFreq = SpiRamFreq::Freq80m;
} else {
const SPIRAM_SPEED: SpiRamFreq = SpiRamFreq::Freq40m;
}
}

#[allow(unused)]
enum FlashFreq {
Expand Down
3 changes: 3 additions & 0 deletions esp32s3-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ opsram-4m = ["esp-hal-common/opsram-4m", "psram"]
opsram-8m = ["esp-hal-common/opsram-8m", "psram"]
opsram-16m = ["esp-hal-common/opsram-16m", "psram"]

# PSRAM 80Mhz frequency support
psram-80mhz = ["esp-hal-common/psram-80mhz"]

[profile.release]
debug = true

Expand Down
1 change: 1 addition & 0 deletions esp32s3-hal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
//! - `psram-2m` - Use externally connected PSRAM (2MB)
//! - `psram-4m` - Use externally connected PSRAM (4MB)
//! - `psram-8m` - Use externally connected PSRAM (8MB)
//! - `psram-80mhz` - Use faster 80Mhz PSRAM frequencty instead of default 40Mhz
//! - `rt` - Runtime support
//! - `ufmt` - Implement the [`ufmt_write::uWrite`] trait for the UART driver
//! - `vectored` - Enable interrupt vectoring
Expand Down

0 comments on commit 0f9e246

Please sign in to comment.