Keil Logo

Simulation Use Case 1: Detecting Illegal Memory Accesses

This example project shows how the µVision Simulator detects various types of illegal memory accesses that are difficult to detect in real-world applications. The following illegal memory accesses are addresses:

  1. Unaligned Memory Accesses
    may create incorrect memory contents on ARM7TDMI devices. The MCU hardware itself does not detect such unaligned accesses. Subsequently, an unaligned memory access is hard to find when using a JTAG debugger since the wrong value might appear at a completely different program location.
  2. Memory Writes to Flash ROM
    do not modify memory contents. These can occur when a pointer to a ROM-based object is used for write access. During JTAG debugging, this situation is typically not detected. But, it may generate redundant code that might be incorrect.
  3. Access to Non-Existent Memory Locations
    create random results or, depending on the MCU hardware, a Data Abort (DABT) interrupt. While relatively easy to see during JTAG debugging, such situations may be hard to find when they occur randomly (for example, due to incorrect pointer initialization).

You may configure debug detection in µVision using the menu item Debug - Debug Settings.

Debug Settings Dialog

This dialog allows you to check for various conditions and allows you to:

  • Display an information message.
  • Halt simulation execution.
  • Ignore such accesses.

The simulator halts program execution or displays a message in the Output Window.

Illegal memory access messages in the Output Window.

UC1_MEMACCESS.ZIP (17K)
Thursday, October 5, 2006
  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.