<?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>Software reset and RAM</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/42789/software-reset-and-ram</link><description>Hi! 
 
 I am using IAR compiler for my project 
 I declare global variable 
 __no_init u32 uPowernResetSignature; 
 
 in my code I assign value to this variable 
 uPowernResetSignature=0x11223344; 
 
 After that I perform software reset using 
 NVIC_SystemReset</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 30 Apr 2019 13:09:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/42789/software-reset-and-ram" /><item><title>RE: Software reset and RAM</title><link>https://devzone.nordicsemi.com/thread/184594?ContentTypeID=1</link><pubDate>Tue, 30 Apr 2019 13:09:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e010c9f6-829f-42e4-b267-6ce8ad5e64cf</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for the update. It is always good to know what happened.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Software reset and RAM</title><link>https://devzone.nordicsemi.com/thread/184500?ContentTypeID=1</link><pubDate>Tue, 30 Apr 2019 09:21:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f63db723-a677-4788-8a05-38b201525120</guid><dc:creator>PMichael</dc:creator><description>&lt;p&gt;No. I changed concept. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Software reset and RAM</title><link>https://devzone.nordicsemi.com/thread/184496?ContentTypeID=1</link><pubDate>Tue, 30 Apr 2019 09:18:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce9b27d4-343b-4471-afd5-d9331ab708a6</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;This one seems to have slipped between the cracks, but for anyone still interested:&lt;/p&gt;
&lt;p&gt;Did you find a solution to the issue?&lt;/p&gt;
&lt;p&gt;If not, might it have been a case of code optimization leading to the variable not actually being written to memory? If so then declaring it volatile should solve the issue.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Software reset and RAM</title><link>https://devzone.nordicsemi.com/thread/167053?ContentTypeID=1</link><pubDate>Tue, 22 Jan 2019 10:53:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:501325fe-7599-405a-8f16-4995d0a1315b</guid><dc:creator>PMichael</dc:creator><description>&lt;p&gt;It also happen without debugger&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Software reset and RAM</title><link>https://devzone.nordicsemi.com/thread/167052?ContentTypeID=1</link><pubDate>Tue, 22 Jan 2019 10:53:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ee361fc-f098-475a-a67f-fc863d1ce747</guid><dc:creator>PMichael</dc:creator><description>&lt;p&gt;When I do it staitc&lt;/p&gt;
&lt;p&gt;__no_init static u32 uPowernResetSignature;&lt;/p&gt;
&lt;p&gt;In icf file&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;initialize by copy { readwrite };&lt;br /&gt;do not initialize&amp;nbsp; { section .noinit };&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;in map file appears .noinit section that was not before I add static&lt;/p&gt;
&lt;p&gt;&amp;quot;P2&amp;quot;, part 2 of 3:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xa04&lt;br /&gt;&amp;nbsp; .noinit&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uninit&amp;nbsp;&amp;nbsp; 0x2000370c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x4&amp;nbsp; SO_SystemOperations.o [1]&lt;br /&gt;&amp;nbsp; CSTACK&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x20003710&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x800&amp;nbsp; &amp;lt;Block&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CSTACK&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uninit&amp;nbsp;&amp;nbsp; 0x20003710&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x800&amp;nbsp; &amp;lt;Block tail&amp;gt;&lt;br /&gt;&amp;nbsp; HEAP&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x20003f10&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x200&amp;nbsp; &amp;lt;Block&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; HEAP&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uninit&amp;nbsp;&amp;nbsp; 0x20003f10&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x200&amp;nbsp; &amp;lt;Block tail&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - 0x20004110&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xa04&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;But after software reset variable still become zero. Any ideas?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Software reset and RAM</title><link>https://devzone.nordicsemi.com/thread/166970?ContentTypeID=1</link><pubDate>Mon, 21 Jan 2019 19:32:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb17b5e2-1656-4316-9826-a825386ee97e</guid><dc:creator>PMichael</dc:creator><description>&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;this is already in link file.&lt;/p&gt;
&lt;p&gt;do not initialize&amp;nbsp; { section .noinit };&lt;/p&gt;
&lt;p&gt;But as I wrote my variables are not static. They are global variables. I will declare static and try again..&lt;/p&gt;
&lt;p&gt;But as I know static only restrict scope. Or I missed something? Can you advice?&lt;/p&gt;
&lt;p&gt;ABout debuger I will try without.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Software reset and RAM</title><link>https://devzone.nordicsemi.com/thread/166917?ContentTypeID=1</link><pubDate>Mon, 21 Jan 2019 15:34:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab8f3d65-d5e2-4b82-8629-9fba7fe72b7a</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You are correct that on soft reset RAM does not change, and that the compiler will not initialize a __no_init variable.&lt;/p&gt;
&lt;p&gt;We did something similar to this in the DFU bootloader of nRF5 SDK v11, in order to allow the application to leave messages when rebooting into the bootloader. From &amp;lt;sdk folder&amp;gt;/examples/dfu/bootloader/dfu_ble_svc.c:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;__no_init static dfu_ble_peer_data_t m_peer_data     @ 0x20003F80;                               /**&amp;lt; This variable should be placed in a non initialized RAM section in order to be valid upon soft reset from application into bootloader. */
__no_init static uint16_t            m_peer_data_crc @ 0x20003F80 + sizeof(dfu_ble_peer_data_t); /**&amp;lt; CRC variable to ensure the integrity of the peer data provided. */&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;While I cannot explain why it did not work in your case, I have some suggestions for what to look at: Is uPowernResetSignature a global static variable? Are you sure the issue is not with the debugger? Does adding a fixed location help?&lt;/p&gt;
&lt;p&gt;You may also want to have a look at the linker file of the SDK 11 bootloader example (&amp;lt;sdk folder&amp;gt;/examples/dfu/bootloader/pca10040/dual_bank_ble_s132/iar/dfu_iar_nRF5x.icf),I think you may need this line in your linker file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;do not initialize  { section .noinit };&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Please note that I am not an expert on this, and so others may have better tips for how to get it working.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>