About debugging TrustZone enabled targets
ARM TrustZone® is a security technology designed into some ARM processors. For example, the Cortex™-A class processors. It segments execution and resources such as memory and peripherals into secure and normal worlds.
When connected to a target that supports TrustZone and where access to the secure world is permitted, then the debugger provides access to both secure and normal worlds. In this case, all addresses and address-related operations are specific to a single world. This means that any
commands you use that require an address or expression must also specify the world that they apply to. :
For an address in Normal World memory.
For an address in Secure World memory.
If you want to specify an address in the current world, then you can omit the prefix.
When loading images and debug information it is important that you load them into the correct world. The debug launcher panel does not provide a way to directly specify an address world for images and debug information, so to achieve this you must use scripting commands instead. The Debugger tab in the debugger launcher panel provides an option to run a debug initialization script or a set of arbitrary debugger commands on connection. Here are some example commands:
Load image only to normal world (applying zero offset to addresses in the image)
load myimage.axf N:0
Load debug information only to secure world (applying zero offset to addresses in the debug information)
file myimage.axf S:0
Load image and debug information to secure world (applying zero offset to addresses)
loadfile myimage.axf S:0
When an operation such as loading debug symbols or setting a breakpoint needs to apply to both normal and secure worlds then you must perform the operation twice, once for the normal world and once for the secure world.
Registers such as
$PC have no world. To access the content of memory from an address in a register that is not in the current world, you can use an expression,
N:0+$PC. This is generally not necessary for expressions involving debug information,
because these are associated with a world when they are loaded.