Content originally posted in LPCWare by Brutte on Tue Jan 22 08:55:38 MST 2013
Quote: CodeRedSupport
To set a hardware breakpoint, using GDB, just use
hbreak *<address>
No need to go fiddling with DWT - that is what the debug driver is for!
I guess the remark refers to this:
Quote: Brutte
However, if you would like to use hardware breakpoint explicitly (for example to match on an op-code within range, like flash page, etc)
??
Well then - your hint does not set a breakpoint on a range but at specific address, it seems.
The hbreak *<address> gives nothing more than asm("0xbe13") within scope of the topic (SRAM breakpoints) so I wonder why would one use your hint in RAM when you just need a mouse click in IDE to set 0xbe13??
What I meant in a previous post is that if one needs a [B]non-trivial[/B] use of DWT or FPB (because of their much more sophisticated functionality than dumb 0xbe13), for example when you need to break on whole range of consecutive addresses or break on match of specific data, etc., then it is also doable (in RAM, wherever), but you need to configure mentioned hardware resources somehow.
AFAIK current GDB does not support whole DWT and FPB functionality except for the basic "bkpt xy" (for ARMv7, I didn't test ARMv6).
If you know how to set an instruction fetch breakpoint [B]on range of addresses[/B] (lets say 1k space) via GDB for example or if there is a tutorial showing that then please give a hint.
You can easily achieve most sophisticated breakpoints by configuring DWT (with core at run-time or EmbSysRegView or "via GDB scripts, accessing DWT", whatever).