How to watch variables in CubeMX
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-03-23 12:53 AM
Posted on March 23, 2015 at 08:53
Hello.
I'd like to know how to refer values of variables. My understanding is all of variables are seen in a variable scope when I stop a program, but at the moment, I can't look at some variables I defined. Could someone teach me how to figure out the problem ? Regards
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-03-23 1:57 AM
Posted on March 23, 2015 at 09:57
Use optimization level 0 (-O0).
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-03-27 3:07 AM
Posted on March 27, 2015 at 11:07If using optimization Level 0(-O0) doesn't work you can try making the variables you want to watch volatile./*declaration*/volatile uint8_t var;You could also have a define specifically for debugging:#define _DEBUGGING_#ifdef _DEBUGGING_volatile uint8_t var;#elseuint8_t var;#endifLevel 0 shouldn't optimize out variables but I have seen it happen.
