µVISION DEBUGGER: Error 65: Access Violation
When trying to write to a variable or memory location, the Keil µVision Debugger issues an Error 65 message:
*** Error 65: Access violation at 0x00000004
I have specified this memory area in the Target options, but I still receive this error. Other versions of the error could be:
When the µVision Debugger loads an executable program, the µVision Simulator uses the loaded program and data segments to create a memory map:
While executing, the debugger checks that memory accesses are only made to objects that are defined in the program, i.e., the debugger by default only allows memory accesses to valid data objects. For any access that is outside of a defined C object, the µVision debugger generates an error message.
Usually, there is a programming error when you try to access unexpected locations. For example:
Note: If debugging on a target, Access Violation could mean a bus issue, device lockup, or memory remap is preventing the debugger from reaching the memory.
If the error is memory region that should be accessed, update the memory map the simulator uses. Define all the memory ranges that your program is permitted to access. Ensure each memory range has the proper permissions (read, write, execute) that match the memory of the actual hardware.
Use the Memory Map Dialog
Use the MAP Command in the Command Window
MAP C:0xF800, C:0xF8FF READ WRITE // allow R/W access to IO space
Use a Debug Initialization File
Any memory map changes could be lost during the next debug session. Once you find the correct memory put the required MAP commands into a debugger INI file.
MAP 0x40000000, 0x4000003F READ WRITE EXEC // allow code execution for interrupt vector fetch
This should resolve the error.
Last Reviewed: Monday, February 8, 2021
of your data.