[SOLVED] How to use breakpoints

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • How to use breakpoints

    Hi everyone,

    I am trying to learn the basics of debugging using SEGGER. I am using a very simple blinky example to start learning debugging.
    I have declare and initialize two variables x & y. When I run the debugger and use the "watch" window to monitor the value of each variable, I can see the y variable but neither the x or i variables.. It sais "symbol not found" as shown on screenshot_69

    The strange thing is that if I initialize x=0 then I can see the x variable on "watch" window as shown on screenshot_70. But again I cannot see the i variable.
    Moreover if I delete both x and y variables then I can monitor i variable while debugging as shown in screenshot_71.

    I cannot figure out what I am doing wrong with the breakpoints.. Any help?
    Images
    • Screenshot_69.png

      101.05 kB, 1,708×1,014, viewed 348 times
    • Screenshot_70.png

      73.18 kB, 1,701×769, viewed 323 times
    • Screenshot_71.png

      73.71 kB, 1,699×806, viewed 314 times
  • [SOLVED] How to use breakpoints

    Ok I figured out what was going wrong,

    I was compiling in release mode :) After switching to debugging mode everything was fixed!!

    I lost two hours of searching yesterday [img]https://cboard.cprogramming.com/images/smilies/biggrin.png[/img] but that was I good lesson since now I have a clearer view of release and debugging modes.

    So in general while developing a firmware you have to compile in debugging mode and as soon as you're ready to flash the firmware to the target you have to compile into release mode for optimization right?
  • Hi,
    Good to hear that you are up and running again.

    Yes, in release mode, compiler optimization is active.
    Since x and y are not actually used besides counting up, they are optimized away.

    As you already mentioned: "Release" builds are in most cases only used to optimize a finished firm- or software.

    Best regards,
    Fabian
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.