10.2 Linker Macros Controlling Memory Regions for TrustZone®
Linking either the secure or non-secure application requires that the linker know the
address and length of secure, non-secure, and non-secure callable memory regions. The
following are the preprocessor definitions that are used to set and control memory zones
for TrustZone when linking TrustZone applications. They are passed as
-Wl,-DNAME[=value]
.
When building a non-secure application, the following preprocessor definitions affect the linker script.
BOOTPROT=size
(optional): Defines the boot protections size in bytes. The default value is 0 if not provided.AS=size
(recommended): Defines the flash secure application size, in bytes. Defaults to 50% of ROM if not provided.RS=size
(recommended): Defines the size of secure RAM, in bytes. Defaults to 50% of RAM if not provided.
When building a secure application, the following preprocessor definitions affect the linker script.
SECURE
(required): Use the memory layout for a secure application.BOOTPROT=size
(optional): Defines the boot protections size in bytes. The default value is 0 if not provided.AS=size
(recommended): Defines the flash application secure size, in bytes. Defaults to 50% of ROM is not provided.- ANSC=
size
(recommended): Defines the flash application non-secure callable size, in bytes. Defaults to 0 if not provided. RS=size
(recommended): Defines the size of secure RAM, in bytes. Defaults to 50% of RAM if not provided.
In all cases, if a recommended value is not provided it will result in a warning message from the linker preprocessor.