调试 Cortex M3 (ARM) 嵌入式 - 如何判断 xPSR.ISR 正在运行哪个 ISR?

发布于 2024-09-08 17:46:40 字数 482 浏览 2 评论 0原文

我正在arm系列CPU(Cortex M3)上调试一个固件。

调试器显示 CPU 寄存器,其中包括一个名为“xPSR”的寄存器,其中包含一个名为“ISR”的子字段。 CPU 寄存器中的模式是“Mode=Handler”,这意味着 m3 cpu 处于中断处理程序而不是“线程”模式。我知道的就这么多。

我在那里看到字段 xPSR.ISR = 15 的值。我认为这一定是十六进制的 15(12 月 21 日)。通过查看 ISR 向量表注释,我猜测这是“系统定时器 Tick 0B”中断。实际上,我现在猜测它是十进制的 15。我正在查看 SysTick 定时器中断处理程序。(请注意,因为代码是汇编程序单行默认处理程序情况,其中大约 100 个不同的 asm 标签位于一个位置,所以很难从代码中判断谁调用了 ISR。 )

但是,我对 Cortex M3 芯片还很陌生,而且我对 ARM7TDMI 的了解因不使用它而变得模糊,以至于我无法在任何地方的文档中找到它,

谁能告诉我如何计算 。这出?

I am debugging a piece of firmware on an arm-family cpu (Cortex M3).

The debugger shows the CPU registers, including one called 'xPSR' which includes a sub-field called 'ISR'. The mode in the CPU registers is 'Mode=Handler", which means that the m3 cpu is in interrupt handler instead of 'thread' mode. This much I know.

I see the value for the field xPSR.ISR = 15 in there. I think that must be hexadecimal 15 (dec 21). And I am guessing that this is the "System Timer Tick 0B" interrupt from looking at the ISR vector table comments. Actually, I'm now guessing it's 15 decimal, and it's the SysTick timer interrupt handler I'm looking at.(Note that because the code is assembler one-liner default-handler case, where about 100 different asm labels land at one place, it's hard to tell from the code, who invoked the ISR.)

However, I am pretty new to Cortex M3 chips, and my knowledge of ARM7TDMI is so faded from not using it that I can't remember. And I can't find this in my docs anywhere.

Can anyone tell me how to figure this out?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

滥情稳全场 2024-09-15 17:46:40

异常编号 15 十进制是 Cortex M3 上的 SYSTICK 中断。

ARM Cortex M3 技术参考手册表格(表 5-1 - 异常类型)列出了 M3 使用的各种中断号。

Exception type    Position       Priority       Description
--------------    ------------   --------       ------------------------------------
Reset               1             –3 (highest)  Invoked on power up and warm reset. On first instruction, 
                                                drops to lowest priority (Thread mode). This is asynchronous.
Non-maskable Int    2             –2            Cannot be stopped or pre-empted by any exception but reset. 
                                                This is asynchronous.
Hard Fault          3             –1            All classes of Fault, when the fault cannot activate because of 
                                                priority or the Configurable Fault handler has been disabled. 
                                                This is synchronous.
Memory Management   4             Configurable  Memory Protection Unit (MPU) mismatch, including access 
                                                violation and no match. This is synchronous. This is used 
                                                even if the MPU is disabled or not present, to support the 
                                                Executable Never (XN) regions of the default memory map.
Bus Fault           5             Configurable  Pre-fetch fault, memory access fault, and other 
                                                address/memory related. This is synchronous when precise 
                                                and asynchronous when imprecise.
Usage Fault         6             Configurable  Usage fault, such as Undefined instruction executed or illegal 
                                                state transition attempt. This is synchronous.
  -                 7-10            -           Reserved
SVCall              11            Configurable  System service call with SVC instruction. This is 
                                                synchronous.
Debug Monitor       12            Configurable  Debug monitor, when not halting. This is synchronous, but 
                                                only active when enabled. It does not activate if lower priority 
                                                than the current activation.
  -                 13              -           Reserved
PendSV              14            Configurable  Pendable request for system service. This is asynchronous 
                                                and only pended by software.
SysTick             15            Configurable  System tick timer has fired. This is asynchronous.

External Interrupt  16 and above  Configurable  Asserted from outside the core, INTISR[239:0], and fed 
                                                through the NVIC (prioritized). These are all asynchronous.

Exception number 15 decimal is the SYSTICK interrupt on the Cortex M3.

The ARM Cortex M3 Technical Reference Manual has a table (Table 5-1 - Exception types) that lists the various interrupt numbers used by the M3.

Exception type    Position       Priority       Description
--------------    ------------   --------       ------------------------------------
Reset               1             –3 (highest)  Invoked on power up and warm reset. On first instruction, 
                                                drops to lowest priority (Thread mode). This is asynchronous.
Non-maskable Int    2             –2            Cannot be stopped or pre-empted by any exception but reset. 
                                                This is asynchronous.
Hard Fault          3             –1            All classes of Fault, when the fault cannot activate because of 
                                                priority or the Configurable Fault handler has been disabled. 
                                                This is synchronous.
Memory Management   4             Configurable  Memory Protection Unit (MPU) mismatch, including access 
                                                violation and no match. This is synchronous. This is used 
                                                even if the MPU is disabled or not present, to support the 
                                                Executable Never (XN) regions of the default memory map.
Bus Fault           5             Configurable  Pre-fetch fault, memory access fault, and other 
                                                address/memory related. This is synchronous when precise 
                                                and asynchronous when imprecise.
Usage Fault         6             Configurable  Usage fault, such as Undefined instruction executed or illegal 
                                                state transition attempt. This is synchronous.
  -                 7-10            -           Reserved
SVCall              11            Configurable  System service call with SVC instruction. This is 
                                                synchronous.
Debug Monitor       12            Configurable  Debug monitor, when not halting. This is synchronous, but 
                                                only active when enabled. It does not activate if lower priority 
                                                than the current activation.
  -                 13              -           Reserved
PendSV              14            Configurable  Pendable request for system service. This is asynchronous 
                                                and only pended by software.
SysTick             15            Configurable  System tick timer has fired. This is asynchronous.

External Interrupt  16 and above  Configurable  Asserted from outside the core, INTISR[239:0], and fed 
                                                through the NVIC (prioritized). These are all asynchronous.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文