The flash memory space is divided into 64 regions of 16 KiB, each with configurable permissions settings.
For each region, the following types of permissions can be configured:
- Read
- Allows data read access to the region. The code fetch from this region is not controlled by the read permission but by the execute permission described below.
- Write
- Allows write or page erase access to the region.
- Execute
- Allows code fetch from this region, even if data read is disabled.
- Secure
- Allows only bus accesses with the security attribute set to access the region.
Permissions can be set independently. For example, it is possible to configure a flash region to be accessible only through secure transfer, being read-only (no write allowed) and non-executable (no code fetch allowed). For each region, permissions can be set and then locked by using the FLASHREGION[n].PERM.LOCK bit, to prevent subsequent modifications.
The debugger can step through execute-protected memory regions.
The following figure shows the N=64 flash regions, each of size 16 KiB.