Datasheet
Copyright © 2013 ARM Ltd. All rights reserved
CAN: Controller Area Network Lab using ST STM32 Cortex-M processors. www.keil.com
26
Watchpoints: (also known as Access Breaks in Keil products)
Watchpoints provide breaks on data and address values. There are four Watchpoints in STM32 series.
1. Enter Debug mode. Do not run the program or stop if it is. The program must be stopped to configure Watchpoints.
2. Close the Exceptions window.
3. Open Debug/Breakpoints and an empty window below opens up. You can also use Ctrl-B.
4. Enter in the field Expression: val_tx == 0x6. Don’t hit Enter yet !
5. Check the Read and Write boxes in Access and
click on Define. The expression will move into
Current Breakpoints as shown here:
6. Click on Close.
7. Open Debug/Debug Settings and click on the Trace
tab. Select on Data R/W sample and unselect
EXCTRC. Click OK and then Close.
8. Confirm the val_Tx in the Watch window is not
equal to 0x6. Highlight val_Tx’s value and double-
click and change it to something else. 0x0 will do.
9. Double-click the Trace Records window to clear it.
10. RUN the program.
11. When val_Tx equals 0x6 the program will stop.
This is how a Watchpoint works.
12. The last entry in the Trace Records will be the write of 0x6 as shown here:
13. Open Debug/Breakpoints (or Ctrl-B) and remove the Watchpoint by using the Kill All button.
14. Click on Close to return to the main µVision menu.
TIP: If the SWV stops working: stop the program, leave debug mode and cycle the power on the Discovery board. Re-
enter Debug mode and click on RUN to repeat.
Number of Watchpoints:
The number of Watchpoints is normally
four in STM32 processors. There are four
comparators used by Watchpoints. These
are shared by the LA. µVision will warn
you if you have too many comparators
configured.
The same is true for the hardware
breakpoints. Eight are possible in
CoreSight and most STM32 have six
enabled.
Watchpoints and hardware breakpoints are
non-intrusive and do not slow your
program down during their tests…until
they become true and then, of course, they stop your program.
TIP: When the Breakpoints window is open you can modify a Watchpoint by double-clicking on it and it will move below
into the Expression: box. When you are finished editing it click on Define again.
Note that the old Watchpoint will still be listed. Click on it to highlight it and click on Kill Selected to remove it.
TIP: Click on Help while in the Breakpoints window and information will be displayed on other types of expressions. Not
all options are currently implemented in µVision.
TIP: You can temporarily “park” Watchpoints and Breakpoints by unselecting the appropriate box.