<alp/storage.h> — Block Storage
Generic block storage over flash, eMMC, or SD. Optional inline AES encryption on AEN SecAES targets.
Header
#include <alp/storage.h>
Read / write a block
alp_storage_t *st = alp_storage_open(&(alp_storage_config_t){
.device = ALP_STORAGE_DEVICE_OSPI_FLASH,
});
uint8_t block[256];
alp_storage_read(st, /* offset */ 0x1000, block, sizeof(block));
alp_storage_write(st, 0x1000, block, sizeof(block));
alp_storage_close(st);
Inline AES (AEN OSPI / HexSPI)
On AEN's OSPI / HexSPI controllers, inline AES decryption can be enabled at storage open time:
alp_storage_t *st = alp_storage_open(&(alp_storage_config_t){
.device = ALP_STORAGE_DEVICE_OSPI_FLASH,
});
alp_storage_inline_aes_t aes = {
.key_slot = 0,
.iv = { /* 16 bytes */ },
};
alp_storage_configure_inline_aes(st, &aes);
After this, reads return decrypted data transparently. Useful for protected firmware images and credential blobs.
File systems
For higher-level access, declare your partitions in board.yaml's storage: block — the orchestrator emits the fixed-partitions DTS overlay and the per-fs Kconfig (CONFIG_FILE_SYSTEM_LITTLEFS=y / _FAT_FILESYSTEM_ELM=y / _FILE_SYSTEM_EXT2=y) plus an optional static fs_mount_t alp_storage_mounts[] table for boot-time iteration.
See also
Questions about this page? Discuss in Community Forum