I am trying to place a data (access) watch-point on a global variable using OpenOCD which I have connected to STM32 through Amontec JTAG. However the watch-point is never hit (i.e. the program execution doesn't halt even when the variable is read/written or loaded/stored). Hence, I was wondering whether anyone has tried using the data-watch-point feature of Cortex M3 on STM32. Thanks and regards, Rahul
Thanks for your reply. Could you please elaborate as to which Menu-option in Keil, should I use for setting hardware data watch-points (read, write OR access). My intention is to set an access watchpoint data watchpoint on a global variable. Through the watch-window I can verify that the global variable (which is a loop_count) is changing with every iteration of the loop. Further I can get the memory location of the global variable (as 0x200000e8) from the map file. I can also see that in the memory window that this memory location is getting updated regularly. However I haven't been able to place a h/w watch-point for read/write/access on this variable. I have got ver-3.72 of Keil-uVision which I can connect to STM32 using ST-LINK JTAG debugger, through the DLLs provided by Keil. Thanks again, Best Regards, Rahul
Thanks again for your quick response. I can get the breakpoint-window (for entering watch-points) through the debug menu in the simulator mode. However when I am debugging on the actual hardware (with code in flash and data in RAM) this window doesn't appear. I have tried clicking on the ''Breakpoints'' icon as well as pressing ''Cntrl+B''. Hence could you please clarify which JTAG debugger you were using for testing watchpoints. I am using ST-LINK JTAG debugger. The associated dll files supplied by keil are: a) ST-LINKIII-KEIL.dll b) STLinkIIIUSBDriver.dll Thanks again for your help Regards, Rahul
Thanks for your suggestion regarding the monitor command. I did try the your suggestion with regards to openOCD (connected to stm32 through amontec JTAG). I am using gdb client (yagarto) for driving openOCD. The global variable which I need to track is located at 0x200000e8 (in RAM). I was able to send monitor command at this address:
(gdb) mon wp 0x200000e8 4 a 5 0
(gdb) c
Continuing.
Cannot watch data values
From the console output, I felt that there were some issues in handling this command. I tried the above command on GDB client without mon, but that gave the following error:
(gdb) wp 0x200000e8 4 a 5 0
Undefined command: ''wp''. Try ''help''.
Previously, I tried placing a data watch-point using awatch command, However that too didn't cause the program to halt (in the case below I had to stop the program by a Ctrl-C
From the transaction-logs, the RSP packet sent for the above command was:
z4,200000e8,4
My open-ocd version is the following: Open On-Chip Debugger 0.1.0 (2009-01-21-21:15) Release Do you think the watchpoint feature would work with the version or should I shift to a newer version -thanks and regards, Rahul
The watchpoint on a address does work - last time i tried it - you just use a mask of 0xffffffff, eg. to break on write.
mon wp 0x20000000 4 w 0 0xffffffff we have made quite a few changes over the last few months to openocd, so we may have upset a few things. This was mainly for cortex_a8 support. Cheers sjo PS. incase you are wondering i am an admin/dev on openocd.