Hi,
I have been developing a C application using an RT1170 for several months now and keep coming up against a problem when debugging: When I try to view the values of variables many appear as <optimized out>.
I have turned off optimization within the MCUXpresso IDE, trying both -O0 and -Og.
I have also tried declaring specific variables as 'volatile', which is one other suggestion I found, buy no luck.
Doe anyone have any other suggestions?
Is it really the case that some optimization cannot be turned off?
Thanks.
Solved! Go to Solution.
Hi Kerry,
Thank you for your reply.
It took me a while to reproduce the problem, but I think I have worked out what was going on.
Originally I must have had the optimization level as '-O0' (none) which often results in variables being displayed in MCUXpresso as "<optimized out>".
With the optimization level set to '-Og' (debug) then it looks like only uninitialised variables appear as <optimized out> until they are set. That probably confused me!
Regards,
Robert
Hi @robert_s
Could you please give me some screenshot about your issues?
Do you also can reproduce issues on the RT SDK project or not?
Even you add the variable to the Expressions window, still have this issues?
Please give me more details about it, thanks.
Best Regards,
Kerry
Hi Kerry,
Thank you for your reply.
It took me a while to reproduce the problem, but I think I have worked out what was going on.
Originally I must have had the optimization level as '-O0' (none) which often results in variables being displayed in MCUXpresso as "<optimized out>".
With the optimization level set to '-Og' (debug) then it looks like only uninitialised variables appear as <optimized out> until they are set. That probably confused me!
Regards,
Robert
Hi @robert_s ,
Thank you for your updated information.
So, now your issue is solved, right?
If your question is solved, please help to mark the correct answer, just to close this case, thanks.
Any new issues, welcome to create the new question post.
Best Regards,
Kerry