Environment
SIM type: SoftSIM
GitHub: nrf-softsim samples
Device: Nordic Semiconductor nrf91 Series
Question
Can I reduce the size of the
nvs_storage
partition in the SoftSIM file system?Can I reduce the size of
nvs_storage
since it's not limited by TF-M like the other region?
Answer
You can try to reduce it but it is generally not recommended to go below 32 KB.
While
nvs_storage
is configured to take up 32 KB of memory due to TF-M flash region constraints, not all of this space is necessarily used.You can repurpose unused space, as long as SIM-related data remains untouched.
For more details, check out Nordic’s NVS storage sizing guide.
Cause
The SoftSIM sample implementations for Nordic devices are designed to follow best practices for secure SIM storage using Trusted Firmware-M (TF-M).
Generally, reducing the nvs_storage
below 32 KB may cause excessive flash memory wear. Based on our tests, 32 KB tends to offer the best balance between space and reducing flash wear.
TF-M Flash Region Constraints
TF-M enforces specific flash alignment requirements.
This results in a minimum flash region size of 32 KB for
nvs_storage
.These constraints are structural, not indicative of how much data the SIM itself needs.
Developer Flexibility
The full 32 KB is not necessarily utilized by SIM-related operations.
If you're not modifying or overwriting the SIM data section, the remaining space within the
nvs_storage
partition can be used for custom application data or other non-critical storage needs.
More Information
To understand the underlying alignment rules imposed by TF-M, refer to Nordic's official documentation: TF-M Partition Alignment Requirements.
While you can't technically reduce the partition size below 32 KB without violating TF-M alignment requirements, you can make efficient use of the unused portion—just ensure the SIM data stays intact.