jangyouhua的个人空间 https://blog.eetop.cn/57837 [收藏] [复制] [分享] [RSS]

空间首页 动态 记录 日志 相册 主题 分享 留言板 个人资料

日志

关于Cortex M3的异常(中断)优先权分组

已有 483 次阅读| 2010-7-3 16:02

5.3.2 Priority grouping
To increase priority control in systems with large numbers of interrupts, the NVIC
supports priority grouping. You can use the PRIGROUP field in the Application
Interrupt and Reset Control Register on page 8-21 to split the value in every PRI_N
field into a pre-emption priority field and a subpriority field. The pre-emption priority
group is referred to as the group priority. Where multiple pending exceptions share the
same group priority, the sub-priority bit field is then used to resolve the priority within
a group. This is referred to as the sub-priority within the group. The combination of the
group priority and the sub-priority is referred to generally as the priority. Where two
pending exceptions have the same priority, the lower pending exception number has
priority over the higher pending exception number. This is consistent with the priority
precedence scheme.

Pre-emption New exception has higher priority than current exception priority or thread and interrupts current flow.
This is the response to a pended interrupt, causing an ISR to be entered if the pended interrupt is higher
priority than the active ISR or thread. When one ISR pre-empts another, the interrupts are nested.
On exception entry the processor automatically saves processor state, which is pushed on to the stack. In
parallel with this, the vector corresponding to the interrupt is fetched. Execution of the first instruction of
the ISR starts when processor state is saved and the first instruction of the ISR enters the execute stage of
the processor pipeline. The state saving is performed over the System bus. The vector fetch is performed
over either the System bus or the DCode bus depending on where the vector table is located, see Vector

Cortex M3的异常(中断)可以被分组为组优先权和子优先权。
组优先权具有抢占优先权特性,子优先权具有响应优先权特性。

具有高抢占优先权的异常(中断)可以打断目前正在处理的异常(中断)响应,形成中断嵌套。反之则不行。

相同优先级组的异常(中断)具有不同的响应优先权,即如果同组内两个异常(中断)都处于带处于待定状态,响应优先权高的异常(中断)会得到响应。

如果两个优先级组的异常(中断)具有相同的组优先权和子优先权,
在待定状态的时候,低异常(中断)编号的异常(中断)具有高的响应优先权,会得到响应。

CM3的Interrupt Priority Registers低8位用于指定优先权,高N位指定组优先权,低8-N为用于指定子优先权。

分组数目N由Application Interrupt and Reset Control Register的8-10位决定

点赞

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

  • 关注TA
  • 加好友
  • 联系TA
  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 0

    关注
  • 2

    粉丝
  • 0

    好友
  • 2

    获赞
  • 1

    评论
  • 837

    访问数
关闭

站长推荐 上一条 /1 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-5-1 11:43 , Processed in 0.013749 second(s), 6 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部