From e0b0aded7be2ab04b450f9d1b115aa104da2ff59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Hlusi=C4=8Dka?= Date: Sat, 28 Feb 2026 01:52:38 +0100 Subject: [PATCH] Allocate ekv buffer in PSRAM --- firmware/acid-firmware/src/db/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/firmware/acid-firmware/src/db/mod.rs b/firmware/acid-firmware/src/db/mod.rs index d8d1e97..0549f7c 100644 --- a/firmware/acid-firmware/src/db/mod.rs +++ b/firmware/acid-firmware/src/db/mod.rs @@ -16,6 +16,8 @@ use esp_hal::rng::Trng; use esp_storage::FlashStorage; use log::{debug, info}; +use crate::ram::PSRAM_ALLOCATOR; + pub type PartitionAcid = Partition<'static, CriticalSectionRawMutex, BlockingAsync>>; @@ -25,7 +27,7 @@ struct AlignedBuf(pub [u8; N]); pub struct EkvFlash { flash: T, - buffer: Box>, + buffer: Box, &'static esp_alloc::EspHeap>, } impl EkvFlash { @@ -34,7 +36,7 @@ impl EkvFlash { flash, buffer: { // Allocate the buffer directly on the heap. - let buffer = Box::new_zeroed(); + let buffer = Box::new_zeroed_in(&PSRAM_ALLOCATOR); unsafe { buffer.assume_init() } }, }