# Memory Partitioning Overview

Depending on the feature set used by the bootloader, the amount of flash memory it occupies can change. This allows a bootloader with a lower feature set to be used in cases where, for instance, the Root of Trust or secure storage is not required. When a reduced feature set bootloader is used, the memory partitioning can be changed, allowing for larger user applications to be loaded.

For illustrative purposes, the "Build Configuration Memory Sizes" table shows the expected sizes of each optional build configuration, with expected allocations of memory for application and download areas depending on build options. The precise values are subject to change depending on the actual optimization levels and feature sets you select, but this provides some guideline figures to help you decide which configuration to use.

Table: Build Configuration Memory Sizes
|  | Bootloader | Secure Storage | Application | Download
--- | --- | --- | --- | --- | ---
|  | Start Address | Size (KB) | Start Address | Size (KB) | Start Address | Size (KB) | Start Address | Size (KB)
Debug | Basic Bootloader | 0x100000 | 24 | 0 | 0 | 0x106000 | 236 | 0x141000 | 236
| Secure Bootloader | 0x100000 | 52 | 0 | 0 | 0x10D000 | 224 | 0x145000 | 224
| Secure Storage | 0x100000 | 64 | 0x15A400 | 11 | 0x110000 | 212 | 0x145000 | 212
| Attestation | 0x100000 | 108 | 0x15A400 | 11 | 0x11B000 | 192 | 0x14B000 | 192
Release | Basic Bootloader | 0x100000 | 16 | 0 | 0 | 0x104000 | 240 | 0x140000 | 240
| Secure Bootloader | 0x100000 | 44 | 0 | 0 | 0x10B000 | 228 | 0x144000 | 228
| Secure Storage | 0x100000 | 52 | 0x15A400 | 11 | 0x10D000 | 220 | 0x144000 | 220
| Attestation | 0x100000 | 92 | 0x15A400 | 11 | 0x117000 | 200 | 0x149000 | 200

Derivation of these start addresses and sizes is available in bl_memory.h; this information is output to the RTT Viewer when debugging the secure bootloader in the onsemi IDE with the RTT Viewer connected. This is also shown in the "Memory Map Diagram" figure.

NOTE: There are variations for an RSL15 device with 284 KB of flash rather than 512 KB.

Figure: Memory Map Diagram