<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/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/"><channel><title>Cannot Single step though code</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/26192/cannot-single-step-though-code</link><description> 
OK, what silly mistake have I made this time..? 

 
I have just downloaded uVision4. Got a simple bit of code to flash
and LED on and off. 

 
However, I cannot single step through the code. When I hit
Start/Stop Debug session, all other option get</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Cannot Single step though code</title><link>https://community.arm.com/thread/139333?ContentTypeID=1</link><pubDate>Fri, 02 Oct 2009 06:03:03 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7c5e669a-4e20-4a0d-ab8f-eb484e75f0fd</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
In this case, the two lines just created a bit of extra delay,
similar to my mention of using volatile in a software loop with the
intention of stopping the compiler from optimizing away the loop.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot Single step though code</title><link>https://community.arm.com/thread/135948?ContentTypeID=1</link><pubDate>Fri, 02 Oct 2009 05:18:00 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:0902105a-faf7-4e1f-9e12-e8fc049a2a0d</guid><dc:creator>Jack Sprat</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;Hmmm. removing those lines made no difference.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
Sorry, I was making a general comment on the uses of volatile. It
wasn&amp;#39;t intended as a solution to your problem.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot Single step though code</title><link>https://community.arm.com/thread/139337?ContentTypeID=1</link><pubDate>Fri, 02 Oct 2009 01:16:41 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:912c1355-126c-4301-969d-a0887c19cc49</guid><dc:creator>Simon Bramble</dc:creator><description>&lt;p&gt;&lt;p&gt;
Just to conclude this thread, I now have my code single stepping
and free running.&lt;/p&gt;

&lt;p&gt;
Under the Target Options:&lt;/p&gt;

&lt;p&gt;
In the Linker Tab: Check the box &amp;#39;Use Memory Layout from Target
Dialog&amp;#39;&lt;/p&gt;

&lt;p&gt;
In the Debug Tab: Set the Use J-Link radio button (obvious) and in
the &amp;#39;Settings&amp;#39; select your Reset Strategy to Software, for Atmel
AT91SAM7 MCUs&amp;#39;&lt;/p&gt;

&lt;p&gt;
This seemed to fix all of my problems&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot Single step though code</title><link>https://community.arm.com/thread/135945?ContentTypeID=1</link><pubDate>Thu, 01 Oct 2009 10:06:35 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:a810d4ff-2644-4ab9-b46c-e3cde237ec10</guid><dc:creator>Simon Bramble</dc:creator><description>&lt;p&gt;&lt;p&gt;
the input variable was just for debugging&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot Single step though code</title><link>https://community.arm.com/thread/125757?ContentTypeID=1</link><pubDate>Thu, 01 Oct 2009 10:05:41 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:15778f83-f9f8-45bf-a0ed-6879f001017f</guid><dc:creator>Simon Bramble</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hmmm. removing those lines made no difference.&lt;/p&gt;

&lt;p&gt;
However, my Blinkey example works in the Keil example code
directory. Let me compare this with my code (and setup) and report
back...&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot Single step though code</title><link>https://community.arm.com/thread/118975?ContentTypeID=1</link><pubDate>Thu, 01 Oct 2009 03:41:03 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6dd7b6ed-39f9-46ce-bab8-53e2a2577070</guid><dc:creator>Jack Sprat</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;The only (questionable) reason for using volatile for an auto
variable is if attempting to implement a software loop, and you want
to try to stop the compiler from optimizing away the loop.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
This is an interesting comment. You might consider whether the
observable behaviour of the program would change if the first two of
the following lines of code were removed:&lt;/p&gt;

&lt;pre&gt;
        input = (pPIOA-&amp;gt;PIO_PDSR) &amp;amp; BUTTON1;
        input = 0;
        input = BUTTON1;
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot Single step though code</title><link>https://community.arm.com/thread/103472?ContentTypeID=1</link><pubDate>Thu, 01 Oct 2009 01:07:53 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:240b7d2f-a6f3-4c7e-a434-48816ce0710e</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
What you you use your &amp;quot;input&amp;quot; variable for? And why is it declared
volatile? Volatile is for variables that may be asynchronously
updated. Possibly by another task, if you have an RTOS. Possibly
between main loop and an ISR.&lt;/p&gt;

&lt;p&gt;
The only (questionable) reason for using volatile for an auto
variable is if attempting to implement a software loop, and you want
to try to stop the compiler from optimizing away the loop.&lt;/p&gt;

&lt;p&gt;
Next thing - you should consider debouncing your button read.
Depending on the mechanical construction of your button and the speed
of your processor, you may see the LED flicker a number of times when
you press and/or release the button. This flicker is too fast for you
to notice with your eye - you have to use an oscilloscope.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot Single step though code</title><link>https://community.arm.com/thread/77807?ContentTypeID=1</link><pubDate>Thu, 01 Oct 2009 00:57:12 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:bb74f147-9e96-46c7-9094-83e094a89218</guid><dc:creator>Simon Bramble</dc:creator><description>&lt;p&gt;&lt;p&gt;
I did do this - all my own work - with a large amount copied from
someone else.&lt;/p&gt;

&lt;p&gt;
I have tried erasing the flash - both with the jumper setting on
the board and using the &amp;#39;erase full chip&amp;#39; in the utilities menu.&lt;/p&gt;

&lt;p&gt;
Single stepping does not work at all. It looks like it is trying
to work if I do Debug -&amp;gt; Stop, once I have started a Debug
session. At least then, the Single Step mode is highlighted, but it
still does not single step. If I just hit Debug -&amp;gt; Start/Stop
Debug Session, then all options are greyed out.&lt;/p&gt;

&lt;p&gt;
Having said that, my LED is working per the code, but it is free
running, not under the single step control&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot Single step though code</title><link>https://community.arm.com/thread/56954?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2009 23:58:52 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:0f90e869-1880-41e5-aa7b-3c34d12ac3d5</guid><dc:creator>John Linq</dc:creator><description>&lt;p&gt;&lt;p&gt;
Did you do this?&lt;/p&gt;

&lt;p&gt;
&lt;b&gt;Erase the entire device&lt;/b&gt; and try it again.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>