<?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>.noinit variable value not retained after sys off</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/17441/noinit-variable-value-not-retained-after-sys-off</link><description>I&amp;#39;m using SDK 12.1.0, gcc, nRF51822, no SD init&amp;#39;ed or enabled at the time this code is running. I need to retain the values of a bunch of variables across a sys off. 
 Here&amp;#39;s my test variable: 
 static int8_t retained_ram_test_int __attribute__ ((section</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 10 Nov 2016 10:17:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/17441/noinit-variable-value-not-retained-after-sys-off" /><item><title>RE: .noinit variable value not retained after sys off</title><link>https://devzone.nordicsemi.com/thread/67008?ContentTypeID=1</link><pubDate>Thu, 10 Nov 2016 10:17:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4d01cc8-9486-43b5-907c-8d36b7956f58</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;Here&amp;#39;s the issue:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;RAM (rwx) :     ORIGIN = 0x20002008, LENGTH = 0x5FF8
NOINIT (rwx) :  ORIGIN = 0x20007F5C, LENGTH = 0xA4
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;These two overlap. &lt;code&gt;NOINIT&lt;/code&gt; should come after &lt;code&gt;RAM&lt;/code&gt;, not within it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: .noinit variable value not retained after sys off</title><link>https://devzone.nordicsemi.com/thread/67007?ContentTypeID=1</link><pubDate>Wed, 02 Nov 2016 08:55:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:936e8ec0-fe0b-4460-b55c-17a74d694e5b</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;Thanks. The bootloader isn&amp;#39;t even flashed at the time I&amp;#39;m running this, despite the linker script I posted above, so I don&amp;#39;t think that&amp;#39;s my issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: .noinit variable value not retained after sys off</title><link>https://devzone.nordicsemi.com/thread/67006?ContentTypeID=1</link><pubDate>Tue, 01 Nov 2016 11:27:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b36d873f-d0e7-4eb0-835c-b14ee4086ae9</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;I&amp;#39;m not familiar with gdb and my situation probably different from yours but I will explain it so you may find solution. Basically with IAR in debug mode when I run my code it jumps to main() and if I restart debugger I didn&amp;#39;t have problem so startup code didn&amp;#39;t init my arrays. But in normal mode I had corruption. In the end I realised that my bootloader used RAM overlaped with noinit area in main code. Compare map files of bootloader and main.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>