Skip to main content

Module psram

Module psram 

Source
Available on crate feature unstable only.
Expand description

§PSRAM (Pseudo-static RAM, SPI RAM) driver

§Overview

This module provides support to interface with PSRAM devices connected to the MCU. PSRAM provides additional external memory to supplement the internal memory of the MCU, allowing for increased storage capacity and improved performance in certain applications.

The ESP32-S3 can use either Quad SPI or Octal SPI to interface with PSRAM. esp-hal will try to automatically detect the best option, but manual configuration is also possible and more reliable.

§Examples

§PSRAM as heap memory

This example shows how to use PSRAM as heap-memory via esp-alloc.

The PSRAM example must be built in release mode!
extern crate alloc;
use alloc::{string::String, vec::Vec};

// Add PSRAM to the heap.
esp_alloc::psram_allocator!(peripherals.PSRAM, esp_hal::psram);

let mut large_vec: Vec<u32> = Vec::with_capacity(500 * 1024 / 4);

for i in 0..(500 * 1024 / 4) {
    large_vec.push((i & 0xff) as u32);
}

let string = String::from("A string allocated in PSRAM");

Structs§

Psram
Enables externally-connected Pseudo-static RAM.
PsramConfig
PSRAM configuration

Enums§

FlashFreq
Frequency of flash memory
PsramMode
PSRAM interface mode
PsramSize
Size of PSRAM
SpiRamFreq
Frequency of PSRAM memory
SpiTimingConfigCoreClock
Core timing configuration