<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Watch variables in Keil &amp;lt;not in scope&amp;gt;</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/6672/watch-variables-in-keil-not-in-scope</link><description>I often see that I cannot &amp;#39;watch&amp;#39; 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.
Th</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 28 Sep 2015 06:33:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/6672/watch-variables-in-keil-not-in-scope" /><item><title>RE: Watch variables in Keil &lt;not in scope&gt;</title><link>https://devzone.nordicsemi.com/thread/23410?ContentTypeID=1</link><pubDate>Mon, 28 Sep 2015 06:33:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f566b86-10bf-4c7e-a44b-9cae5e7056ff</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;setting volatile means that you are telling the compiler not to use optimization on that variable at all.
What differences do you notice when you say that you cannot set every variable as volatile? you expect variables to change and you do not see that change?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Watch variables in Keil &lt;not in scope&gt;</title><link>https://devzone.nordicsemi.com/thread/23409?ContentTypeID=1</link><pubDate>Sun, 27 Sep 2015 06:26:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57428f25-2cf6-45b4-9c22-5c289e2fdfec</guid><dc:creator>Papyrus</dc:creator><description>&lt;p&gt;I still have this problem, even at the level 0 optimization.  I cannot very well set every variable as volatile, what can I do?&lt;/p&gt;
&lt;p&gt;Not having the watch window REALLY makes debugging difficult.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Watch variables in Keil &lt;not in scope&gt;</title><link>https://devzone.nordicsemi.com/thread/23408?ContentTypeID=1</link><pubDate>Thu, 23 Apr 2015 11:40:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c39dd90-97e8-4729-982b-178e9bcc9eb7</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Keil is really not perfect with debug time watch variables as the compiler optimizes their information when it needs to.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;try to set the optimization to Level 0 in target settings
&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/3821.Capture.JPG" alt="image description" /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;make your variables volatile to tell your compiler about a strict rule of not optimizing any kind of information regarding that variable.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This will help get your watch variables visible while stepping.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>