Hello, I'm trying to test the CPU compare module.
I want to run its self-test and propagate a error from it to the ESM.
I'm stucked in getting in privileged mode to write in the CCMKEYR register.
I've tried to write it inside a Interruption to test if it is the privileged mode, but keeps reading zero.
I'm missing something ? There is a way to get in supervisor mode ?
Thanks,
Cristiano
Hello Cristiano,
You can use the SuperVisor Call (SVC) instruction (formerly SWI) to enter Supervisor mode,
Please be aware that the use of SWI is deprecated on the v7R architecture (Cortex-R4(f)). It should be replaced by the SVC instruction in any code.
To be able to cover both cases, following code snippet can be used:
Can you verify the answer so that i can close the post