1

I am developing a STM32F2 device using GCC 4.7.4 and a Lauterbach Combiprobe JTAG debugger. In my code, I have the following statement to always break at a certain spot for testing purposes:

asm volatile ("BKPT #0");

This is the only breakpoint. When I run the program, I can see that my program reaches the breakpoint, but I cannot step beyond this breakpoint using my JTAG debugger. Instead, I have to move the PC counter past this instruction to get the program to execute.

This was working in the past, but I am at a loss to figure out why the behavior is different now. Any clues or hints would be appreciated.

artless noise
  • 21,212
  • 6
  • 68
  • 105
Bryan C.
  • 347
  • 1
  • 12

2 Answers2

1

There are so many broken JTAG debuggers. Probably you installed an update for the JTAG adapter?

When you have GDB as Debugger you might check if you can add a macro set PC=PC+4 to a button or key. But if this is possible depends on your IDE.

harper
  • 13,345
  • 8
  • 56
  • 105
1

There is no general rule what happens with the program counter if you have a breakpoint instruction in you application code. Some CPUs stop at the address containing the breakpoint instruction, others stop after the breakpoint instruction.

Since you use the tag "lauterbach" I assume you are using a TRACE32 debugger from Lauterbach.

If you think the debuggers behavior was different in the past, I think you should contact the Lauterbach support.

For now you can workaround the issue with the following TRACE32 command

Break.Set T:0x1000 /Program /CMD "Register.Set PP r(PP)+2"

(where 0x1000 stands for the address, where your BKPT instruction is located.)

Holger
  • 3,920
  • 1
  • 13
  • 35