Arm Community
Site
Search
User
Site
Search
User
Groups
Arm Research
DesignStart
Education Hub
Graphics and Gaming
High Performance Computing
Innovation
Multimedia
Open Source Software and Platforms
Physical
Processors
Security
System
Software Tools
TrustZone for Armv8-M
中文社区
Blog
Announcements
Artificial Intelligence
Automotive
Healthcare
HPC
Infrastructure
Innovation
Internet of Things
Machine Learning
Mobile
Smart Homes
Wearables
Forums
All developer forums
IP Product forums
Tool & Software forums
Support
Open a support case
Documentation
Downloads
Training
Arm Approved program
Arm Design Reviews
Community Help
More
Cancel
Developer Community
IP Products
Processors
Jump...
Cancel
Processors
Cortex-A / A-Profile forum
Cortex-A8 - accessing banked registers from monitor mode
Blogs
Forums
Videos & Files
Help
Jump...
Cancel
New
State
Not Answered
Replies
6 replies
Subscribers
273 subscribers
Views
5694 views
Users
0 members are here
Armv7-A
Cortex-A
Cortex-A8
Debugger
Related
Cortex-A8 - accessing banked registers from monitor mode
Offline
Jitesh Shah
over 7 years ago
Note: This was originally posted on 20th March 2012 at
http://forums.arm.com
Hi Group,
I am working on a Cortex A-8 Processor (ARMv7-a architecture). I am in the monitor mode and trying to access SP of the SVC mode.
I know two ways I can do it:
1) Using the "mrs" instruction.
eg. mrs r0, sp_svc
However, my compiler (code sourcery) says:
Error: Banked registers are not available with this architecture. -- `mrs r0,sp_svc'
My architecture manual does say that banked registers are accessible via this method, so I suppose this is a compiler issue. Anyway.
2) Changing the mode to svc, reading sp and getting back to the monitor mode.
eg. cps MODE_SVC
mov r0, sp
cps MODE_MON
where MODE_SVC = 0x13 and MODE_MON = 0x16
But, as soon as I execute "cps MODE_SVC" in monitor mode, my CPU hangs. There is no more activity.
So my question is this: Is SVC mode not accessible from Monitor mode? If thats not the case, how can I access SVC version of the registers from Monitor mode?
Thanks,
Jitesh
Parents
0
Offline
Peter Harris
over 7 years ago
Note: This was originally posted on 20th March 2012 at
http://forums.arm.com
Have you initialized the SVC mode, and is the NS-bit configured as secure before you call cps?
If you are in monitor mode when you do the "cps MODE_SVC" are you are effectively switching into SVC mode, using it's banked registers, so if you haven't initialized them you are probably going to have problems.
My best guess is that you've got the NS-bit set to 1 (i.e. non-secure) and you switch modes, which drops the core in to non-secure SVC mode, because the NS-bit takes effect as soon as you drop out of monitor mode. It is quite possible that the PC you are using doesn't exist in the non-secure world, so it faults, but the non-secure exception table is also not set up, so that faults. Infinite loop of faults = hung CPU.
Iso
Cancel
Up
0
Down
Reply
Accept answer
Cancel
Reply
0
Offline
Peter Harris
over 7 years ago
Note: This was originally posted on 20th March 2012 at
http://forums.arm.com
Have you initialized the SVC mode, and is the NS-bit configured as secure before you call cps?
If you are in monitor mode when you do the "cps MODE_SVC" are you are effectively switching into SVC mode, using it's banked registers, so if you haven't initialized them you are probably going to have problems.
My best guess is that you've got the NS-bit set to 1 (i.e. non-secure) and you switch modes, which drops the core in to non-secure SVC mode, because the NS-bit takes effect as soon as you drop out of monitor mode. It is quite possible that the PC you are using doesn't exist in the non-secure world, so it faults, but the non-secure exception table is also not set up, so that faults. Infinite loop of faults = hung CPU.
Iso
Cancel
Up
0
Down
Reply
Accept answer
Cancel
Children
No data
More questions in this forum
By title
By date
By reply count
By view count
By most asked
By votes
By quality
Descending
Ascending
All recent questions
Unread questions
Questions you've participated in
Questions you've asked
Unanswered questions
Answered questions
Questions with suggested answers
Questions with no replies
Not Answered
Regarding Visibility of Multi Master ACE-Lite System
0
11911
views
1
reply
Latest
2 months ago
by
Zhifei Yang
Not Answered
The certification for the development of Trusted Applets
0
OP-TEE
Trusted Execution Environment (TEE)
TrustZone
9861
views
1
reply
Latest
2 months ago
by
Zhifei Yang
Not Answered
Core_n System Timer reset behaviour
0
Cortex-A35
Armv8-A
9830
views
1
reply
Latest
2 months ago
by
Zhifei Yang
Answered
Use Cortex-A53 Cryptography Extension to optimize crypto operations.
+1
7822
views
1
reply
Latest
2 months ago
by
Zhifei Yang
Answered
why descriptions of SAU_RLAR is different in two user duides?
0
Armv8.1-M
Cortex-M33
4619
views
6
replies
Latest
2 months ago
by
Harland
<
>
View all questions in Cortex-A / A-Profile forum