This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS570LS3137: How to into the User mode

Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN

I have a rudimentary question.

I can not find an explanation of how to switch to user mode.

How do I switch to user mode?

Best Regards.

  • Arriy,

    You can look at HalCoGen's FreeRTOS example to see how to switch to user mode.

    Any exception will put you in user mode. Under software control you could either use the SVC call (used to be named SWI) which is an opcode and puts you into the Supervisor mode. Or you can use the SSI interrupt which is a software triggered IRQ.

    You should also get a copy of ARM DEN 0042A which is the programmer's guide for the core. In this case there isn't a lot of info on switching to user mode in that doc but there is good low level info there about managing the core.
  • Thank you for your support.

    By enabling OS with HalCoGen, I could find a code that seems to be in user mode.

    I think below,this is correct ? 

     <     #define portRESET_PRIVILEGE( xRunningPrivileged ) if( xRunningPrivileged == 0 ) portSWITCH_TO_USER_MODE()   >

    However, this code can not be found on disabling OS.
    I do not want to use OS in my system.

    Can I change the mode to the user while OS is disabled?

  • Hello Charles.

    I know you are very busy,but I am waiting for advice.

    Best Regards
  • Hi,

    You can use the following assembly instruction to switch to user mode

    CPS  #0x10

    You can use the CPS instruction to switch to any mode. Refer Cortex R4 Technical Reference Manual for more details.

    Note: This instruction cannot be used in user mode. So, if you want to switch from User mode to any other privileged mode, you may need to do a SWI call, enter the supervisor mode and then do the switch in the SWI handler.

    Hope this helps!

    Thanks and Regards,

    Veena

  • Hello Veena.

    I appreciate support very much.
    My system was able to transition to user mode!

    Best Regards