<?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>FlashCode memory write in UAM fails</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/25483/flashcode-memory-write-in-uam-fails</link><description> 
Anybody got any experience with writing to Flash Code Memory in
User Application Mode? 
I&amp;#39;m trying to write code to upgrade firmware in the field, but am
unable to successfully overwrite more than just a few pages of new
firmware into the MSC1210 flash</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: FlashCode memory write in UAM fails</title><link>https://community.arm.com/thread/114960?ContentTypeID=1</link><pubDate>Sun, 24 May 2009 17:59:53 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:a46f7526-6397-40ee-83b9-fd731ab04d69</guid><dc:creator>Rod Swan</dc:creator><description>&lt;p&gt;&lt;p&gt;
&amp;quot;User Application Mode&amp;quot; here relates (as the thread subject
implies) to the programming of the internal flash memory - other
modes in this respect are Serial Programming mode and Parallel
programming mode.&lt;br /&gt;
Nothing at all to do with the mode of the processor - though whilst
in either the Parallel or Serial programming modes the processor is
to all intents and purposes idle.&lt;/p&gt;

&lt;p&gt;
Rod.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FlashCode memory write in UAM fails</title><link>https://community.arm.com/thread/103132?ContentTypeID=1</link><pubDate>Sun, 24 May 2009 05:05:23 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:4358af2f-cc00-4920-bcda-a79934bee936</guid><dc:creator>erik  malund</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;not a C51 issue&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;Oh yes it is!!&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
never heard of &amp;quot;User Application Mode&amp;quot; for a &amp;#39;51.&lt;/p&gt;

&lt;p&gt;
some larger processors have &amp;quot;system mode&amp;quot; and &amp;quot;application
mode&amp;quot;&lt;/p&gt;

&lt;p&gt;
Erik&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FlashCode memory write in UAM fails</title><link>https://community.arm.com/thread/77464?ContentTypeID=1</link><pubDate>Sat, 23 May 2009 10:45:57 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:73f609de-0a6e-4799-aabf-947ae10b2502</guid><dc:creator>Rod Swan</dc:creator><description>&lt;p&gt;&lt;p&gt;
Oh yes it is!!&lt;/p&gt;

&lt;p&gt;
After a day of searching I have finallly resolved the problem.&lt;/p&gt;

&lt;p&gt;
It is, specifically, C51&amp;#39;s rather agressive optimization.&lt;br /&gt;
Taking the default level of 8, described as &amp;quot;Reuse common entry code&amp;quot;
in the &amp;quot;Options&amp;quot; dialog and &amp;quot;Common Tail Merging&amp;quot; in the online
documentation, created a helper function that it placed in the code
space I was writing to. Even though the two &amp;quot;common&amp;quot; calls were
syntacticaly different C51 optimized them and placed a helper routine
in memory where I was loading new code to.&lt;/p&gt;

&lt;p&gt;
The two calls, which were located in seperate modules are:&lt;/p&gt;

&lt;pre&gt;
 write_flash_byte(add++,*ptr++,0);
&lt;/pre&gt;

&lt;p&gt;
and&lt;/p&gt;

&lt;pre&gt;
 write_flash_byte(add,*ptr,0);
 add++;
 ptr++;
&lt;/pre&gt;

&lt;p&gt;
In the second instance I had deliberately placed the increments
outside the parameter list as I wanted to ensure the code was as
&amp;quot;simple&amp;quot; as possible, and I had used the userclass pragma so I could
direct the linker to place high in memory, way from where I was
writing the new code to.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FlashCode memory write in UAM fails</title><link>https://community.arm.com/thread/56126?ContentTypeID=1</link><pubDate>Thu, 21 May 2009 12:32:23 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:10424b5b-93c2-4370-a570-7d2c05ed6301</guid><dc:creator>erik  malund</dc:creator><description>&lt;p&gt;&lt;p&gt;
.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>