Embedded devices increasingly combine:
- networking,
- user applications,
- cryptographic keys,
- safety functions,
- secure firmware.
Running everything inside one flat memory and privilege domain increases risk.
A vulnerability in one application component may expose:
- credentials,
- secure services,
- critical peripherals.
Hardware isolation reduces that risk.
Arm TrustZone is one of the most important embedded processor technologies for creating this separation.
Fundamentals and Technology Overview
What Is TrustZone?
TrustZone divides processor resources into security domains.
For Cortex-M systems, the two primary states are:
- Secure,
- Non-secure.
Arm describes TrustZone for Cortex-M as a system-wide security foundation that can isolate:
- firmware,
- assets,
- private information
from the rest of the application.
Secure World
The Secure domain may contain:
- cryptographic keys,
- secure boot services,
- credential management,
- trusted peripherals.
Non-Secure World
The Non-secure domain runs the normal application.
Examples include:
- UI,
- networking,
- third-party libraries.
Why Isolation Matters
Application software may contain vulnerabilities.
If the network stack is compromised, TrustZone can help prevent direct access to:
- secure keys,
- trusted firmware.
Memory Isolation
Memory regions can be marked:
- Secure,
- Non-secure.
Non-secure code cannot directly read secure memory.
Peripheral Isolation
Peripherals can also be assigned to a security domain.
Examples:
- crypto engine,
- secure storage,
- debug interface.
Interrupt Isolation
Interrupts can be classified as Secure or Non-secure.
This helps trusted code maintain control over critical events.
Secure Gateway
Non-secure software may need legitimate access to secure services.
A controlled gateway provides approved entry points.
Example:
Non-secure app → secure signing service
The app requests an operation without receiving the private key.
Secure Callable Functions
Secure firmware can expose only narrowly defined services.
This reduces attack surface.
TrustZone for Cortex-M
TrustZone was extended to the Cortex-M architecture for embedded and IoT devices.
It provides hardware-enforced isolation without requiring a large virtualization system.
Cortex-M Security
TrustZone is available in selected Armv8-M and newer Cortex-M designs.
It is intended for low-power embedded systems.
System-Wide Security
TrustZone can protect more than CPU memory.
Arm notes that designers can make:
- debug,
- peripherals,
- interrupts,
- memory
part of the Secure world.
Safety, Security, and Reliability
Root of Trust
TrustZone is a strong runtime isolation mechanism.
It can also help create a root-of-trust architecture under Platform Security Architecture guidelines.
Secure Boot + TrustZone
These technologies solve different problems.
Secure Boot
Ensures trusted firmware is loaded.
TrustZone
Keeps trusted and untrusted runtime software separated.
Both are needed in strong designs.
Secure Element + TrustZone
A secure element can protect:
- external keys.
TrustZone can protect:
- software services,
- internal peripherals.
They complement each other.
Example: IoT Device
Secure World
- device credentials,
- TLS signing,
- update verification.
Non-Secure World
- sensor application,
- network stack,
- UI.
Example: Industrial Controller
Secure World
- firmware update service,
- key management.
Non-Secure World
- industrial protocol,
- diagnostics.
Example: Smart Lock
Secure World
- authentication keys,
- unlock policy.
Non-Secure World
- BLE stack,
- mobile-app interface.
Attack Surface Reduction
The secure world should contain only:
- small,
- auditable code.
Do not move the whole application into Secure state.
Least Privilege
TrustZone works best when each component receives only the access it needs.
Secure Memory Configuration
System designers must configure:
- flash regions,
- SRAM regions,
- peripheral attribution.
Incorrect setup can create security holes.
SAU
The Security Attribution Unit helps define security properties for memory regions in Cortex-M TrustZone systems.
Implementation-Defined Security Attribution
SoC vendors may combine processor security attribution with device-specific controllers.
Always follow the MCU reference manual.
Secure Interrupts
Critical security events can be routed directly to trusted firmware.
Implementation, Testing, and Optimization
Debug Security
Production devices should prevent non-secure debug from exposing Secure memory.
DMA Security
DMA engines must also respect isolation boundaries.
A CPU memory rule is useless if an unrestricted DMA peripheral can read Secure SRAM.
Peripheral Masters
All bus masters need security attribution:
- DMA,
- GPU,
- NPU,
- USB,
- Ethernet.
TrustZone and RTOS
An RTOS can run primarily in the Non-secure world while secure services remain isolated.
PSA Certified
Arm's Platform Security Architecture provides guidelines and certification frameworks for building secure IoT platforms around hardware security foundations.
Context Switching
Crossing between secure and non-secure worlds has overhead.
Secure service APIs should therefore be:
- simple,
- coarse enough to avoid excessive calls.
Performance
TrustZone isolation is much lighter than running two complete virtual machines.
It is designed for embedded resource constraints.
Security Boundaries
Isolation does not fix vulnerabilities inside the Secure world.
Secure code still needs:
- validation,
- bounds checking,
- careful API design.
Common Mistake: Large Secure World
More trusted code means:
- larger attack surface,
- harder auditing.
Common Mistake: Insecure Gateway API
A poorly validated secure service can become a privilege-escalation path.
Common Mistake: Ignoring DMA
Peripheral masters must obey the same security policy.
Common Mistake: No Secure Boot
TrustZone isolation does not help if malicious firmware can replace the secure world itself.
Design Workflow
- Identify sensitive assets.
- Define secure services.
- Keep Secure code minimal.
- Configure memory attribution.
- Configure peripheral attribution.
- Protect DMA and bus masters.
- Implement secure gateway APIs.
- Enable secure boot.
- Lock production debug.
- Perform penetration testing.
Conclusion
TrustZone brings hardware-enforced isolation into embedded processors.
It allows the system to separate:
- trusted security services,
- private assets,
- normal application software.
The most important principle is:
keep the trusted computing base small and protect it with hardware boundaries.
TrustZone is strongest when combined with:
- secure boot,
- hardware root of trust,
- protected key storage,
- signed firmware updates.