<?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>nRF51 RAM retention after System Reset question.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/12641/nrf51-ram-retention-after-system-reset-question</link><description>Hello, I looked througth the devzone but didn&amp;#39;t find direct answer. So created new one. 
 RM v3.0 states chapter 12.1.19 &amp;quot;Reset behavior&amp;quot; with table. However, it is not clear for me what crosses in table mean.
In general, I want to use filled data array</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 18 Mar 2016 10:19:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/12641/nrf51-ram-retention-after-system-reset-question" /><item><title>RE: nRF51 RAM retention after System Reset question.</title><link>https://devzone.nordicsemi.com/thread/48025?ContentTypeID=1</link><pubDate>Fri, 18 Mar 2016 10:19:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a52c332e-1fc2-4a37-bfd7-50e0e887db41</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I believe you&amp;#39;re &amp;quot;almost&amp;quot; there. I suspect that you&amp;#39;ve not set &amp;quot;NoInit&amp;quot; on the RAM-block in your settings.
A &amp;quot;Soft reset&amp;quot; is the same as doing a nvic_systemreset(); and it shall not clear your RAM as per our datasheet (be aware that the startup file may do so anyway!)&lt;/p&gt;
&lt;p&gt;Attached is a modified example (based on SDK11) that shows how to utilize this in a simple manner.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ram_5F00_retention.zip"&gt;ram_retention_example.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Cheers,
Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51 RAM retention after System Reset question.</title><link>https://devzone.nordicsemi.com/thread/48024?ContentTypeID=1</link><pubDate>Fri, 18 Mar 2016 10:09:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee5f1708-e561-4e89-8832-8cbbaa22f00a</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Most likely thing is that myarray is being zero-filled as part of the startup &lt;em&gt;despite&lt;/em&gt; the attribute you&amp;#39;re setting. Depending on the IDE you&amp;#39;re using, there may be more you have to set to really stop those sections being initialised. I&amp;#39;d work out where myarray is, put a breakpoint right at the start of the reset_handler and see what it is before &lt;em&gt;any&lt;/em&gt; code runs at all. If it&amp;#39;s full of data, you know the startup code is zeroing it and then you can work out how to stop that.&lt;/p&gt;
&lt;p&gt;Code for NVIC_SystemReset is in the CMSIS headers, it just performs a standard Cortex M0 reset, so yes, a soft reset. The table you mention however is nothing to do with memory, that&amp;#39;s for retained &lt;em&gt;registers&lt;/em&gt;. If you look underneath the table it tells you that RAM is never reset but may be corrupted. So technically you can&amp;#39;t really do what you&amp;#39;re trying to do, because there&amp;#39;s no guarantee that RAM doesn&amp;#39;t get corrupted. I&amp;#39;ve yet however to see a case in which it does get corrupted, but the manual does state it can, so you better have a way to detect that and recover.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;__STATIC_INLINE void NVIC_SystemReset(void)   
{
  __DSB();                                                          /* Ensure all outstanding memory accesses included
                                                                   buffered write are completed before reset */
  SCB-&amp;gt;AIRCR  = ((0x5FAUL &amp;lt;&amp;lt; SCB_AIRCR_VECTKEY_Pos) |
             SCB_AIRCR_SYSRESETREQ_Msk);
  __DSB();                                                          /* Ensure completion of memory access */

  for(;;)                                                           /* wait until reset */
  {
    __NOP();
  }
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>