Hi,
I was wondering if it was possible to configure a peripheral to be in non-secure mode and have the interrupt handler associated with the peripheral run in secure mode?
Basically by not setting the appropriate bit in NVIC_ITNSn.
Best,
Rajiv
Hi Uma,
Thank you for your reply.
That's correct. Sorry I forgot to mention about CONTROL.nPRIV.
Yes, within the interrupt handler, besides changing the EXC_RETURN.Mode, I would also need to do something like -
mov r0, #0
msr control_ns, r0
Before doing a bx lr.
This should get me back to non-secure privileged thread with MSP_NS. Isn't it?
There is no need to change the CONTROL and EXC_RETURN if the mode and state before and after the ISR are the same. The EXC_RETURN has been extended to support additional information about security states, so all the Secure ISR can be implemented as normal C function.
regards,
joseph