This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to enter USR mode from SVC mode?

Note: This was originally posted on 1st August 2011 at http://forums.arm.com

I changed CPSR to 0x1D0(which means USR mode )in SVC mode in cortex-a8 platform(freescale imx51), but a perfetch_error occured, the PC hung at 0x0c.  Could anybody help me figure this issue out, please?
OR anybody has some code some hwo to enter USR mode from SVC mode?

Best Regards
Jerry
Parents
  • Note: This was originally posted on 2nd August 2011 at http://forums.arm.com


    Hi Jerry,

    Here is how I do for Cortex-R4F :

            mrs r1, cpsr
            orr r1, r1, #0x0010
            bic r1, r1, #0x000F
            msr cpsr_c, r1

    Hope it helps

    Best regards

    Christophe


    Thank, Chris
    I tried the code on Cortex-a8(freescale i.mx51), it does not work. Once "msr cpsr_c, r1" , a undefined instruction exception occured.

    BR
    Jerry
Reply
  • Note: This was originally posted on 2nd August 2011 at http://forums.arm.com


    Hi Jerry,

    Here is how I do for Cortex-R4F :

            mrs r1, cpsr
            orr r1, r1, #0x0010
            bic r1, r1, #0x000F
            msr cpsr_c, r1

    Hope it helps

    Best regards

    Christophe


    Thank, Chris
    I tried the code on Cortex-a8(freescale i.mx51), it does not work. Once "msr cpsr_c, r1" , a undefined instruction exception occured.

    BR
    Jerry
Children
No data