I have been trying to debug my code and realized that my watchpoints for variable never execute. When I looked into this problem online, I encountered similar situations and the response they received was their microcontroller may not be supported. I have an STM32F4 and I am using GDB on Ubuntu with st-util. Breakpoints currently work but watchpoints don't. How can I add support for it?

  • 2
    \$\begingroup\$ Watch points should be supported with stlink and STM32F4. Have you tried using another GDB server, like OpenOCD? \$\endgroup\$ – Tony K Jul 3 '17 at 4:09
  • \$\begingroup\$ Also note that the C/C++ code in question may have been optimized out or inlined, so the debugger was not able to find it. Try compiling with -Og -g3 which optimizes for debug and includes extra debug info. \$\endgroup\$ – Tony K Jul 3 '17 at 4:12
  • \$\begingroup\$ @TonyK I haven't tried using OpenOCD. I will make sure to try that. I added both those options for compiling but with no prevail. I also tried using st-util v2. \$\endgroup\$ – h3y4w Jul 3 '17 at 11:33
  • \$\begingroup\$ @TonyK Using OpenOCD seems to have worked. If you make an answer I will be glad to accept it. Thanks again! \$\endgroup\$ – h3y4w Jul 3 '17 at 11:59

It seems that st-until has issue with setting watchpoints on STM32F4, even though it is supposed to be supported. As I previously noted, OpenOCD is an alternative and it looks like switching to it has resolved the issue for you.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.