Arm Community
Site
Search
User
Site
Search
User
Groups
Education Hub
Distinguished Ambassadors
Open Source Software and Platforms
Research Collaboration and Enablement
Forums
AI and ML forum
Architectures and Processors forum
Arm Development Platforms forum
Arm Development Studio forum
Arm Virtual Hardware forum
Automotive forum
Compilers and Libraries forum
Graphics, Gaming, and VR forum
High Performance Computing (HPC) forum
Infrastructure Solutions forum
Internet of Things (IoT) forum
Keil forum
Morello forum
Operating Systems forum
SoC Design and Simulation forum
SystemReady Forum
Blogs
AI and ML blog
Announcements
Architectures and Processors blog
Automotive blog
Graphics, Gaming, and VR blog
High Performance Computing (HPC) blog
Infrastructure Solutions blog
Internet of Things (IoT) blog
Operating Systems blog
SoC Design and Simulation blog
Tools, Software and IDEs blog
Support
Arm Support Services
Documentation
Downloads
Training
Arm Approved program
Arm Design Reviews
Community Help
More
Cancel
Support forums
Architectures and Processors forum
Question : The Definitive Guide to the ARM Cortex-M3
Jump...
Cancel
State
Not Answered
Locked
Locked
Replies
33 replies
Subscribers
346 subscribers
Views
22265 views
Users
0 members are here
Cortex-M3
Cortex-M
Options
Share
More actions
Cancel
Related
How was your experience today?
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
Question : The Definitive Guide to the ARM Cortex-M3
Kenichi Kenichi
over 11 years ago
Note: This was originally posted on 11th December 2007 at
http://forums.arm.com
Dear, all.
I am new in this forum.
Recently I studying Cortex-M3 core, so I bought book "The Definitive Guide to the ARM Cortex-M3" by Joseph Yiu.
This book is very good book and this explains most of unaswered questions by TRM or AALRM.
As I found some mistake in this book, I would like to feedback, but I could not find publisher's homepage. Then I found Josephe's name in this forum, I would like to ask here.
In page 42, there is fig 3.11 and 3.12 but this contents is same as fig 3.8 and 3.9.
Fig 3.8 and 3.9 should be some program list.
Can I get correct figure? Or where I should contact?
Please advise.
Kenichi
Parents
0
guestposter guestposter
over 11 years ago
Note: This was originally posted on 23rd January 2010 at
http://forums.arm.com
Hi Miro,
Good questions!
In the case of having an IRQ running, and if the IRQ is lower priority than SysTick, then proceeding on context switching usually means the PSP is changed to point to the stack frame of a a different task.
As a result, when you execute exception return, the PC value of another task will be used and you will end up executing the other tasks with privilege level of the IRQ, which can be bad (user task running at privileged level, and all other IRQs at the same or lower priority level will be blocked). Therefore context switching code could modify LR to ensure it is switching to unprivileged level, but then it lead to usage fault due to trying to run in Thread mode with an active IRQ.
In practice I believe Cortex-M3 will flag a usage fault even if LR is not modified because it has various system integrity checkings. When switching to the other task with IPSR equal 0 (which is unstacked from the other task's stack frame) and having an active IRQ should trigger a fault (need double check).
Lower the SysTick priority is one solution, but if an IRQ handler is not function properly (e.g. accidental software deadloop) the SysTick will not be able to preempt and the system will be frozen.
Yes, it if possible to have a mid-priority level SVC so that an OS aware IRQ handler can use the SVC function. But instead of using SVC, you might able to call the SVC function directly rather than using SVC exception. This is better if you need to port the software to Cortex-M0, which has 4 levels of priority levels.
Hope this answered your questions and feel free to let me know if you need further explanations.
regards,
Joseph
Cancel
Up
0
Down
Cancel
Reply
0
guestposter guestposter
over 11 years ago
Note: This was originally posted on 23rd January 2010 at
http://forums.arm.com
Hi Miro,
Good questions!
In the case of having an IRQ running, and if the IRQ is lower priority than SysTick, then proceeding on context switching usually means the PSP is changed to point to the stack frame of a a different task.
As a result, when you execute exception return, the PC value of another task will be used and you will end up executing the other tasks with privilege level of the IRQ, which can be bad (user task running at privileged level, and all other IRQs at the same or lower priority level will be blocked). Therefore context switching code could modify LR to ensure it is switching to unprivileged level, but then it lead to usage fault due to trying to run in Thread mode with an active IRQ.
In practice I believe Cortex-M3 will flag a usage fault even if LR is not modified because it has various system integrity checkings. When switching to the other task with IPSR equal 0 (which is unstacked from the other task's stack frame) and having an active IRQ should trigger a fault (need double check).
Lower the SysTick priority is one solution, but if an IRQ handler is not function properly (e.g. accidental software deadloop) the SysTick will not be able to preempt and the system will be frozen.
Yes, it if possible to have a mid-priority level SVC so that an OS aware IRQ handler can use the SVC function. But instead of using SVC, you might able to call the SVC function directly rather than using SVC exception. This is better if you need to port the software to Cortex-M0, which has 4 levels of priority levels.
Hope this answered your questions and feel free to let me know if you need further explanations.
regards,
Joseph
Cancel
Up
0
Down
Cancel
Children
No data