ARM处理器怎样处理DATA ABORT异常

本文解释了当ARM应用程序在模拟器或JTAG调试器中运行时遇到数据异常中断的情况,如何通过查看程序计数器(R15)跳转到DAbt_Handler的默认异常处理程序来定位问题。通过从R14链接寄存器的值中减去8,可以计算出导致异常的非法内存位置。使用Unassemble调试命令反汇编该指令,确定具体位置并显示源代码,可能发现错误的指针加载。
AI助手已提取文章相关产品:
ARM Technical Support Knowledge Articles
  •  Document Merge (0)
  •  Favorite Articles (0)

HOW TO ANALYZE A DATA ABORT EXCEPTION

Applies to: ARM Development Tools

Answer


Information in this article applies to:

  • ARM Version any version

QUESTION

My ARM application does not work. When I run it in the simulator or with my JTAG debugger (ULINK), I see that the program counter (R15) jumps to the label DAbt_Handler?A. What does that mean? How can I find the location where my application crashes?

ANSWER

This is the default Data Abort exception handler. Your application is trying to read or write an illegal memory location. You can calculate the illegal memory location using by subtracting 8 from the value in R14 (link register). Subtracting 8 adjusts for the instruction queue giving you the address of the instruction that caused this exception. For example:

  • R14 value is 0x0000021e
  • 0x0000021e - 8 = 0x00000216.  The instruction which caused the exception is at address 0x00000216
  • Disassemble the instruction using the Unassemble debug command. For this example, type U 0x00000216 in theCommand window (View - Command Window). 
  • The disassembly window shows the instruction STRB R3,[R1,#0x00] at this address with R1=0x000001bc. The value in R1 points to an on-chip flash area (Philips LPC2000) and cannot be written. In the assembly window, right click on this line and select Show Source Code for current Address to display your source code. Probably a pointer was loaded with a bad address.

MORE INFORMATION

  • Getting Started User's Guide for ARM Powered Microcontrollers
  • Refer to Debug Windows and Dialogs in the µVision4 User's Guide.

SEE ALSO

您可能感兴趣的与本文相关内容

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值