We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,
is it possible (working with MDK version 3.4) to tell the debugger, if a part of the code (e.g. sdram addr 0x20000100) will be written by the program code, the debugger should stop at this command?
best regards Alan
In the simulator, under Debug->Memory Map, you can set a range of memory and enable/disable a read or write or execute option. In your case set the memory range and enable only execute or read. When an attempt to write to the selected memory range occurs, an exception will be thrown and the debugger will stop. Check the Debugger manual for more information. Bradford
is it only possible to do that in the simulator? It would be great if there's an soluation working with the real hardware and the ulink debugger.
as far as I know, it is possible to set a breakpoint on a memory location (I do that regularly) but not on a range of addressed.
it would be sufficient to set a breakpoint one a single memory location.
Could you give me some advice to set such a breakpoint (which will fire if the programm tries to execute / write or read this memory location)?
Of course I don't want to set a breakpoint anywhere in my code (I also do this regularly). In my situation I will use this method to find the position where my code wrongly writing / reading and so on a memory location.
see at the bottom of this page: http://www.keil.com/support/man/docs/uv3/uv3_dg_breakp.htm
Breakpoints on memory access or so called watchpoints can be used to stop the program execution after the memory access occurred. Number and types of watchpoints depends on the core (ARM7/9, Cortex-M).
Breakpoints/watchpoints can be configured in the debugger from the command window with BS command (http://www.keil.com/support/man/docs/uv3/uv3_cm_breakset.htm) or from the Debug\Breakpoints dialog. Debug symbols can be used or memory addresses can be specified directly.
Example: To configure the debugger that the program stops when address 0x20000000 was written: just enter "BS WRITE 0x20000000" into the command window.
thank you for your help. It's working!