Hi @pasu
IPSR is accessible in both Thread Mode and Handler mode.
The following is from the official ARM documentation :
When the processor is executing an exception handler, holds the exception number of the exception being processed. Otherwise, the IPSR value is zero.
The processor writes to the IPSR on exception entry and exit. Software can use an MRS instruction, to read the IPSR,
but the processor ignores writes to the IPSR by an MSR instruction. The IPSR Exception Number field is defined as
follows:
• In Thread mode, the value is 0.
• In Handler mode, holds the exception number of the currently-executing exception.
An exception number indicates the currently executing exception and its entry vector.
Also, read of IPSR in unprivileged mode returns zero.
If unprivileged code attempts to read any stack pointer, the priority masks, or the IPSR, the read returns zero.