<?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>Transfering data from the App to the bootloader</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/14900/transfering-data-from-the-app-to-the-bootloader</link><description>Hi, 
 I&amp;#39;d like to transfer some data from my App (using fstorage) to the bootloader (using pstorage). 
 Given that that the two storage mechanisms are different, how can I transfer data between from the App to the bootloader? 
 I wish to transfer about</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 04 Jul 2016 11:23:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/14900/transfering-data-from-the-app-to-the-bootloader" /><item><title>RE: Transfering data from the App to the bootloader</title><link>https://devzone.nordicsemi.com/thread/56869?ContentTypeID=1</link><pubDate>Mon, 04 Jul 2016 11:23:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a19f2e0c-1dbf-4c27-80b6-d0f2ce19f1dd</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Lee: Besides sharing data via RAM, you can also use Flash. If you don&amp;#39;t write any data in bootloader and only read, you can directly access the address on flash and read the data from there. There is no restriction on doing that when the softdevice is active.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Transfering data from the App to the bootloader</title><link>https://devzone.nordicsemi.com/thread/56872?ContentTypeID=1</link><pubDate>Fri, 01 Jul 2016 13:34:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19c06a19-5cc3-473f-bc22-ee86d5193df7</guid><dc:creator>lee</dc:creator><description>&lt;p&gt;Thanks Wojtek, I&amp;#39;m using gcc not Keil unfortunately. I presume the process is pretty similar though.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Transfering data from the App to the bootloader</title><link>https://devzone.nordicsemi.com/thread/56871?ContentTypeID=1</link><pubDate>Fri, 01 Jul 2016 13:31:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0eab1c0a-da11-4348-afe0-824cfb7e82ee</guid><dc:creator>Wojtek</dc:creator><description>&lt;p&gt;Are you using keil? What i did using keil is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;set separate RAM memory section in target options (IRAM2, set proper addresses there and tick NoInit)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;prepare modified scatter file for linker and modify it according to previous step, in my case it is:&lt;/p&gt;
&lt;p&gt;RW_IRAM2 0x2000F000 UNINIT 0x00001000  {
*(NoInit)
}&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;static data_t data &lt;strong&gt;attribute&lt;/strong&gt;((section(&amp;quot;NoInit&amp;quot;), zero_init));&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;enable ram retention on chip ofcourse&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And when you do similar settings in both app and bootloader, you may have similar addresses of the variables. but it will be much safer if you just put ex. pointer of the location of these variables in fixed place in RAM - somewhere in Keil manual it is described how to use &lt;strong&gt;attribute&lt;/strong&gt; to do it...&lt;/p&gt;
&lt;p&gt;in gcc it is data_t data &lt;strong&gt;attribute&lt;/strong&gt; ((section(&amp;quot;.noinit&amp;quot;)));&lt;/p&gt;
&lt;p&gt;I think data should not be static. however i am not sure.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Transfering data from the App to the bootloader</title><link>https://devzone.nordicsemi.com/thread/56870?ContentTypeID=1</link><pubDate>Fri, 01 Jul 2016 13:24:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5b51609-a868-463e-aca3-87a7e10af11b</guid><dc:creator>lee</dc:creator><description>&lt;p&gt;Thanks. I&amp;#39;m not sure how I can do that
I&amp;#39;ve tried adding &lt;strong&gt;attribute&lt;/strong&gt;((section(&amp;quot;.noinit&amp;quot;))) static data_t data;
to both the app and bootloader. I then set data to a value in app but the value is 0 when read from the bootloader.
I guess I have no guarantee that the variable &amp;#39;data&amp;#39; uses the same memory address in the bootloader as it does in the app. Is this the problem in your opinion? Do you know how I can solve it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Transfering data from the App to the bootloader</title><link>https://devzone.nordicsemi.com/thread/56868?ContentTypeID=1</link><pubDate>Fri, 01 Jul 2016 10:25:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3e8c06c-3727-48c4-b3ea-1dab39242a08</guid><dc:creator>Wojtek</dc:creator><description>&lt;p&gt;You can use ram retention for that, you don&amp;#39;t have to use flash.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>