cancel
Showing results for 
Search instead for 
Did you mean: 

Data Watchpoint on Cortex M3

kr_rahul
Associate II
Posted on August 15, 2009 at 11:59

Data Watchpoint on Cortex M3

12 REPLIES 12
kr_rahul
Associate II
Posted on May 17, 2011 at 13:19

Hi,

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

st3
Associate II
Posted on May 17, 2011 at 13:19

Quote:

I was wondering whether anyone has tried using the data-watch-point feature of Cortex M3 on STM32.

Yes, I have had this working with Keil; so it must be down to the tools and/or your usage of them - it's not a limitation of the chip itself

kr_rahul
Associate II
Posted on May 17, 2011 at 13:19

Dear st7,

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

sjo
Associate II
Posted on May 17, 2011 at 13:19

It can be done in openocd:

# break when variable @ adr 0x20000000 is 5

mon wp 0x20000000 4 a 5 0

if you are not using gdb then remove the mon (monitor) cmd

Cheers

sjo

st3
Associate II
kr_rahul
Associate II
Posted on May 17, 2011 at 13:19

Dear st7,

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

sjo
Associate II
Posted on May 17, 2011 at 13:19

My reply we in relation to openocd, as this was your original question?

Cheers

sjo

kr_rahul
Associate II
Posted on May 17, 2011 at 13:19

Dear sjo,

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

 

(gdb) awatch loop_count

 

Hardware access (read/write) watchpoint 1: loop_count

 

(gdb) c

 

Continuing.

 

 

Program received signal SIGINT, Interrupt.

 

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

sjo
Associate II
Posted on May 17, 2011 at 13:19

Just had a quick look through the code, looks like it has not been implemented for cortex_m3 yet.

I will look into adding it.

Cheers

sjo