Hi, I'm trying to develope an application with the STM32F4-Discovery Board, but I'm having problems when debugging. I don't know why I cannot see local variables, the y appear always as <not in scope>.
Does anyone knows what's happening?
Thank you for your answer. When you ask me the optimization level I was using, I started checking and reading about it and realised that there was the problem. I'm using now level 0 o level 1 for debugging purposes
Add "volatile" on local variable declaration. It is better than using "static".
AddZulkifli Sulton volatile is not "better" than static, it's just a completely different keyword with completely different purpose.
I guess he meant "a better solution to this problem". Using static will semantically change the code in ways that may change the behaviour of the code, while volatile will not. It is not however clear that volatile will solve the problem.
The problem has quite certainly become non-existant at some point during the 5 years that have passed since this thread went to sleep...
And that's assuming that there ever was an actual problem to speak of, rather than a lack of understanding of the language.