This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Watch variables in Keil <not in scope>

I often see that I cannot 'watch' variables in the watch window, and they just show as - even when I am stepping through a function and actually working with them. Is there any reason for this? Perhaps there is a setting somewhere I have missed. Thanks

Parents
  • Keil is really not perfect with debug time watch variables as the compiler optimizes their information when it needs to.

    1. try to set the optimization to Level 0 in target settings image description

    2. make your variables volatile to tell your compiler about a strict rule of not optimizing any kind of information regarding that variable.

    This will help get your watch variables visible while stepping.

Reply
  • Keil is really not perfect with debug time watch variables as the compiler optimizes their information when it needs to.

    1. try to set the optimization to Level 0 in target settings image description

    2. make your variables volatile to tell your compiler about a strict rule of not optimizing any kind of information regarding that variable.

    This will help get your watch variables visible while stepping.

Children
Related