How to enable the supervisor mode in the ARMv7 processor?

Hi, at the end of this article RTOS for ARM Cortex-A says:

how could I enable the supervisor mode?, I am using the Vitis IDE from Xilinx for ptogramming the RPU(real time processor unit - cortex R5) with freertos


This is my first post in reply to another user’s question ! FreeRTOS experts, please correct me if I erred ! Thanks in advance !


The above file does it like this:

#define ARM_MODE_SVC     0x13

#define I_BIT            0x80
#define F_BIT            0x40



The above file does it like this:

	mrs	r0, cpsr			/* get the current PSR */
	mvn	r1, #0x1f			/* set up the supervisor stack pointer */
	and	r2, r1, r0
	orr	r2, r2, #0x13		/* supervisor mode */
	msr	cpsr, r2

Thanks Siddhartha.

As Siddhartha points out, the examples in the FreeRTOS download (for all supported architectures, not just Cortex-R) are always a good first reference point.

1 Like