modify pddb size on key testing

this allows for faster reboots through CI cycles as a state
transition from secure->insecure always triggers a PDDB format
This commit is contained in:
bunnie 2026-02-04 15:57:09 +08:00
parent 0aeb9daa37
commit f6bf8f9bf1
2 changed files with 6 additions and 1 deletions

View file

@ -26,6 +26,9 @@ arbitrary-int = "1.2"
num_enum = { version = "0.5", default-features = false }
[features]
# testing flag that causes the PDDB to be small
key-testing = []
std = ["derive-rkyv", "xous-names", "xous-ipc"]
derive-rkyv = ["rkyv"]
bio = []

View file

@ -2,7 +2,6 @@ use xous::arch::PAGE_SIZE;
use crate::offsets::{PartitionAccess, RwPerms, SlotIndex};
// we actually have 16MiB on the initial prototypes, but constraining to smaller for cost reduction
pub const SPI_FLASH_LEN: usize = 8192 * 1024;
pub const SPI_FLASH_ID_MASK: u32 = 0xff_ff_ff;
@ -29,7 +28,10 @@ pub const SWAP_HEADER_LEN: usize = PAGE_SIZE;
// PDDB takes up "the rest of the space" - about 4MiB envisioned. Should be
// "enough" for storing a few hundred, passwords, dozens of x.509 certs, dozens of private keys, etc.
pub const PDDB_ORIGIN: usize = SWAP_FLASH_ORIGIN + SWAP_FLASH_RESERVED_LEN;
#[cfg(not(feature = "key-testing"))]
pub const PDDB_LEN: usize = SPI_FLASH_LEN - PDDB_ORIGIN;
#[cfg(feature = "key-testing")]
pub const PDDB_LEN: usize = 256 * 1024; // 256k - big enough to do something with, but much faster to init
// Location of on-chip application segment, as offset from RRAM start
pub const APP_RRAM_OFFSET: usize = 0;