__mst built-in variable

__mst is a special built-in variable in which you can access hardware register content of the current thread. This built-in variable cannot be used in the systrace, BEGIN, and END probes. Also, this built-in variable can be used in the interval probes only if PID is mentioned. The information can be accessed using the -> operator on the __ublock built-in. The registers that can be accessed follow:

r1-r10
General purpose register r1 to r10
r14-r31
General purpose register r14 to r31
iar
Instruction address register
lr
Link register
isisr
Set if in interrupt or exception context.

Usage Example

To access the lr value in a probe, use the following command:
__mst->lr