ARM: HOW TO ANALYZE A DATA ABORT EXCEPTION

QUESTION

My ARM application does not work. When I run it in the simulatoror 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. Yourapplication is trying to read or write an illegal memorylocation. You can calculate the illegal memory location using bysubtracting 8 from the value in R14 (link register). Subtracting 8adjusts for the instruction queue giving you the address of theinstruction 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 the Command 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.   

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值