Hi TI,
I am using TMS570LC4357 with HalCoGen Generated free-RTOS.
In this, I configured one 10ms Task and 1ms Task. Inside the 10ms Task at some instance, I want to switch the CPU to Privileged mode.
I can do this using either "prvRaisePrivilege()" function or else asm( " CPS #0x1F").
But my problem is that I want to bring back my CPU to the Previous mode (whatever it is).
i.e: Before I do a change to Privilege mode, if CPU is in User Mode, then I have to bring back it to user mode after I did all my operations in Privileged mode.
In this case I know how to bring CPU to the mode whatever I want.
But how to know what is the Current mode, so that I can bring back it to the same mode after I make my changes.
Thanks in advance,
Regards,
Karthikeyan.K