SPU provides a register interface to control the various internal logic blocks that monitor access to memory-mapped slave devices (RAM, flash, peripherals, etc) and other resources (device pins, DPPI channels, etc).
For memory-mapped devices like RAM, flash, and peripherals, the internal logic checks the address and attributes (e.g. read, write, execute, secure) of the incoming transfer to block it if necessary. A secure resource can be accessed by a given master based on the following factors:
- CPU-type master – By the security state of the CPU and the security state reported by SPU, for the address in the bus transfer.
- Non-CPU master – By the security attribute of the master that initiates the transfer, defined by a SPU register.
The Simplified view of SPU protection shows a simplified view of the SPU registers controlling several internal modules.
- A blocked read operation will always return a zero value on the bus, preventing information leak.
- A write operation to a forbidden region or peripheral will be ignored.
An error is reported through dedicated error signals. For security state violations from an M33 master this will be a SecureFault exception, for other violations this will be an SPU event. The SPU event can be configured to generate an interrupt towards the CPU.
Other resources like pins and DPPI channels are protected by comparing the security attributes of the protected resource with the security attribute of the peripheral that wants to access it. SPU is the only place where those security attributes can be configured.