Login

Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.

ARM Community: How to enter USR mode from SVC mode? - ARM Community

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How to enter USR mode from SVC mode? Rate Topic: -----

#1 User is offline   Jerry Fan 

  • Contributor
  • PipPip
  • Group: Members
  • Posts: 56
  • Joined: 10-January 11

Posted 01 August 2011 - 07:35 AM

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
0

#2 User is offline   Christophe31 

  • Member
  • Pip
  • Group: Members
  • Posts: 17
  • Joined: 06-July 11

Posted 01 August 2011 - 08:13 AM

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
1

#3 User is offline   Jerry Fan 

  • Contributor
  • PipPip
  • Group: Members
  • Posts: 56
  • Joined: 10-January 11

Posted 02 August 2011 - 03:01 AM

瀏覽文章引用框(Christophe31 @ 01 August 2011 - 08:13 AM)

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
0

#4 User is offline   Christophe31 

  • Member
  • Pip
  • Group: Members
  • Posts: 17
  • Joined: 06-July 11

Posted 02 August 2011 - 06:53 AM

Hi Jerry,

Hum, it is strange, because Cortex-A8 and R4 seem to share the same architecture !? What is your compiler ? (for me, it works with both RVCT 4.0 and CCS v4)

did you also try
msr cpsr, r1
?

cpsr_c is a sub mask for writing only specific bits... maybe not available for cortex-A8

Regards

Christophe

This post has been edited by Christophe31: 02 August 2011 - 09:13 AM

1

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic