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-M / M-Profile forum
Abort some questions of arm interrupt
Blogs
Forums
Videos & Files
Help
Jump...
Cancel
New
State
Not Answered
Replies
14 replies
Subscribers
6 subscribers
Views
10810 views
Users
0 members are here
Cortex-M3
Cortex-M
Interrupt
Related
Abort some questions of arm interrupt
Offline
josh zhao
over 7 years ago
Note: This was originally posted on 20th June 2008 at
http://forums.arm.com
I try to understand arm interrupt,there are some questions I don't know,
1. Why the nested interrupt has to switch out of irq mode to svc mode? I think it only pushes the r14_irq into the irq stack.
2. The basic difference between a reentrant interrupt handler and a nested interrupt han-dler is that the interrupts are reenabled early on in the reentrant interrupt handler, which can reduce interrupt latency.
I can't understand that ?
thanks!
Parents
0
Offline
Simon Craske
over 7 years ago
Note: This was originally posted on 25th June 2008 at
http://forums.arm.com
Sean,
For clarity, the definitions I use are as follows;
Interrupt nesting
: interrupt A can preempt handling of interrupt B; both interrupt A and interrupt B's handlers can be "active" at the same time.
Re-entrant interrupt
: interrupt A can preempt handling of interrupt A; interrupt A's handler can be active concurrently with itself.
Interrupt chaining
: (an overloaded term) means one of two things; firstly checking for a new pending interrupt before returning from interupt context (i.e. a scenario which would could waste time by unstacking and then straight away restacking the same registers); or secondly, linking handlers together (typically by replacing the interrupt vector with the new handler to run, followed by the new handler calling the original handler). I assume you mean the first.
Interrupt nesting on ARM7 typically requires some degree of re-entrancy (ignoring FIQ vs IRQ) due to all handlers hanging off the IRQ vector. Cortex-M3 has greater flexibility in interrupt handling, priorities and number of vectors, so the ability/requirement for re-entrancy is signficiantly less.
Re-entrancy on ARM7 requires code to exit from the "true" interrupt context and to drop priority, i.e. switch out of IRQ mode, and re-enable interrupts via a small code stub; the same is true for Cortex-M3. Unlike ARM7, the same isn't true for interrupt nesting (ignoring FIQ), if the priority of A is higher than the currently running interrupt B, then A will preempt automatically on Cortex-M3.
Implementing re-entrancy on Cortex-M3 requires, as I eluded to earlier, the pushing of a thread stack frame containing the ReturnPC of the re-entrant interrupt handler, a suitable Thread xPSR and some initial register values onto the stack, followed by performing an interrupt return to Thread mode. Whilst this part of the code clearly isn't re-entrant, the part "returned" to is. Exiting from a re-entrant handler written like this is less trivial - and left as an exercise for the reader :-)
hth
s.
Cancel
Up
0
Down
Reply
Accept answer
Cancel
Reply
0
Offline
Simon Craske
over 7 years ago
Note: This was originally posted on 25th June 2008 at
http://forums.arm.com
Sean,
For clarity, the definitions I use are as follows;
Interrupt nesting
: interrupt A can preempt handling of interrupt B; both interrupt A and interrupt B's handlers can be "active" at the same time.
Re-entrant interrupt
: interrupt A can preempt handling of interrupt A; interrupt A's handler can be active concurrently with itself.
Interrupt chaining
: (an overloaded term) means one of two things; firstly checking for a new pending interrupt before returning from interupt context (i.e. a scenario which would could waste time by unstacking and then straight away restacking the same registers); or secondly, linking handlers together (typically by replacing the interrupt vector with the new handler to run, followed by the new handler calling the original handler). I assume you mean the first.
Interrupt nesting on ARM7 typically requires some degree of re-entrancy (ignoring FIQ vs IRQ) due to all handlers hanging off the IRQ vector. Cortex-M3 has greater flexibility in interrupt handling, priorities and number of vectors, so the ability/requirement for re-entrancy is signficiantly less.
Re-entrancy on ARM7 requires code to exit from the "true" interrupt context and to drop priority, i.e. switch out of IRQ mode, and re-enable interrupts via a small code stub; the same is true for Cortex-M3. Unlike ARM7, the same isn't true for interrupt nesting (ignoring FIQ), if the priority of A is higher than the currently running interrupt B, then A will preempt automatically on Cortex-M3.
Implementing re-entrancy on Cortex-M3 requires, as I eluded to earlier, the pushing of a thread stack frame containing the ReturnPC of the re-entrant interrupt handler, a suitable Thread xPSR and some initial register values onto the stack, followed by performing an interrupt return to Thread mode. Whilst this part of the code clearly isn't re-entrant, the part "returned" to is. Exiting from a re-entrant handler written like this is less trivial - and left as an exercise for the reader :-)
hth
s.
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
Using STM32H7 ETM without external tool
0
CoreSight ETM7
STM32
331
views
0
replies
Started
3 months ago
by
GuillaumeP
Not Answered
How to realise Real-time detection of access of memory beyond the bounds of an allocation block, instead of period detection in Cortex-M4. Please give me any idea.
0
Cortex-M4
1052
views
3
replies
Latest
3 months ago
by
42Bastian Schick
Not Answered
Getting Dummy character while receiving UART data,How to fix it ?
0
732
views
2
replies
Latest
3 months ago
by
Jerome Decamps - 杜尚杰
Not Answered
Timer not working in stm32f401re
0
Keil MDK Cortex-M Edition
STM32
Cortex-M
STM32 F4
618
views
1
reply
Latest
3 months ago
by
42Bastian Schick
Not Answered
Is there an FPGA image for the MPS2+AN521 with an FPU?
0
Cortex-M33
Cortex-M Prototyping System (V2M-MPS2)
343
views
0
replies
Started
3 months ago
by
erickroane
<
>
View all questions in Cortex-M / M-Profile forum