Keil Logo

ARM: HOW TO ANALYZE A DATA ABORT EXCEPTION


Information in this article applies to:

  • ARM Version any version

QUESTION

My application for an ARM7 or ARM9 based microcontroller 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 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.

Note: for Cortex-M devices, aborts and exceptions work differently. See Application Note 209: Using Cortex-M3/M4/M7 Fault Exceptions for details.

MORE INFORMATION

SEE ALSO

FORUM THREADS

The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Wednesday, December 19, 2018


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.