<?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>How to execute my app from RAM ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/12893/how-to-execute-my-app-from-ram</link><description>Hi 
 I want to execute my app from the RAM to test if i&amp;#39;ll get a considerable decrease in the current consumption. 
 I&amp;#39;m using : &amp;quot;s130_nrf51822_0.9.0-1.alpha&amp;quot; &amp;amp;&amp;quot;nrf51822QFAC&amp;quot; 
 I tried to follow this thread but it dosen&amp;#39;t work (getting a hard default</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 11 Apr 2016 09:25:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/12893/how-to-execute-my-app-from-ram" /><item><title>RE: How to execute my app from RAM ?</title><link>https://devzone.nordicsemi.com/thread/49093?ContentTypeID=1</link><pubDate>Mon, 11 Apr 2016 09:25:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c429f232-fd06-43dd-8fd4-64bcfffc6272</guid><dc:creator>ToTo</dc:creator><description>&lt;p&gt;What i did the first time, is putting the main.c and some other files to be excuted from RAM (as you said :you cannot put all the code in RAM, but instead the code that you think is executed often). and i didn&amp;#39;t see a diference !! (in the while (1) of main.c all i do is going to sleep) .
Now, i did another test, exactly like you asked me to do, i delted the sleep function, and i put a dummy loop:
while(i&amp;lt;1) {
i++;
i--;}
then  i measured with and withoud RAM execution, i got a difference of 1.76 mA , thats really awsome , and very logic, because in the DataSheet we have :&lt;/p&gt;
&lt;p&gt;Icpu,flash = 4.1 mA and Icpu,ram =2.4mA a difference of 1.7mA exactly like i found.&lt;br /&gt;
thanks for your help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to execute my app from RAM ?</title><link>https://devzone.nordicsemi.com/thread/49094?ContentTypeID=1</link><pubDate>Fri, 08 Apr 2016 08:41:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8970cea-a93c-4bb8-b944-ed17167498ee</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;How do you measure the current consumption?
If your code is mainly sleeping for instance, I would assume that the overall current consumption is will not be changed a lot. Could you try to measure the current when some code from main.c is actually being executed? You can for example add a dummy loop and check if you see any difference when running from RAM and flash.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to execute my app from RAM ?</title><link>https://devzone.nordicsemi.com/thread/49092?ContentTypeID=1</link><pubDate>Tue, 05 Apr 2016 10:33:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:232d511b-e364-4753-ab9e-3de239dd8f24</guid><dc:creator>ToTo</dc:creator><description>&lt;p&gt;I didn&amp;#39;t get a gain in current...the same current conumption .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to execute my app from RAM ?</title><link>https://devzone.nordicsemi.com/thread/49091?ContentTypeID=1</link><pubDate>Fri, 01 Apr 2016 13:42:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0418b0a-5c49-48b3-bce3-df100cc56fa3</guid><dc:creator>ToTo</dc:creator><description>&lt;p&gt;Thanks for the clarification, that&amp;#39;s helpful&lt;/p&gt;
&lt;p&gt;Ok i did this configuration ( IRAM1 only is configured : @0x20002E00  size =0x2E00   and the main.c is excuted :IRAM1 [0x20002E00-0x20005BFF] ) and its working...the only thing i did is that i give enough space for softdevice like its mentioned in the relase note .(10kb +1.5kb for call stack)&lt;/p&gt;
&lt;p&gt;Before i was thinking it&amp;#39;s not wokrking because i couldn&amp;#39;t debug. But as   it&amp;#39;s executed  from RAM i can&amp;#39;t debug it ( do you confirm that ? )&lt;/p&gt;
&lt;p&gt;i will do tests of power consumption, and give a feedback&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to execute my app from RAM ?</title><link>https://devzone.nordicsemi.com/thread/49090?ContentTypeID=1</link><pubDate>Fri, 01 Apr 2016 12:04:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c82c377-beee-4ab3-962f-e2b626dd9bc0</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;I have updated the answer to answer your questions.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to execute my app from RAM ?</title><link>https://devzone.nordicsemi.com/thread/49089?ContentTypeID=1</link><pubDate>Fri, 01 Apr 2016 10:19:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d874914e-aaad-4d11-bb2d-ca7a00f7c643</guid><dc:creator>ToTo</dc:creator><description>&lt;p&gt;Hi kristin,&lt;/p&gt;
&lt;p&gt;Fisrt, thank for the clarification, i&amp;#39;ll try to understand it well , test it and give a feedback.
Can you please reply my second question in the description?
Which is  :
Should i add only the main.c to be excuted from RAM, or it depends on the app ?&lt;/p&gt;
&lt;p&gt;And another question :&lt;/p&gt;
&lt;p&gt;IRAM1 and IRAM2 in the Keil configuration  refer to what ? Region 0 and region 1?? can i choose only one IRAM ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to execute my app from RAM ?</title><link>https://devzone.nordicsemi.com/thread/49088?ContentTypeID=1</link><pubDate>Thu, 31 Mar 2016 13:20:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4d56723-ac13-47b9-b496-971ac0e7aa8a</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;First, I would recommend you to use the latest version of the S130, S130 v.2.0.0.&lt;/p&gt;
&lt;p&gt;The reason for the hardfault is most likely that the IRAM start address is too small. As you can see in the &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s130.sds.v1.0%2Fdita%2Fsoftdevices%2Fs130%2Fsd_resource_reqs%2Fmem_resource_map_usage.html&amp;amp;cp=2_6_2_0_10_1"&gt;RAM map&lt;/a&gt; below, RAM address 0x2000000 is used by the MBR.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ram_5F00_map.PNG" alt="image description" /&gt;&lt;/p&gt;
&lt;p&gt;The APP_RAM_BASE address is where you application can start. The procedure for finding the APP_RAM_BASE is described in the migration document that comes with the softdevice:
&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/find_5F00_ram_5F00_base.PNG" alt="image description" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update 01.04.16&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;I would think that you will have to add all the files that you want to run from RAM into &amp;quot;properties&amp;quot;. However, if you for example have 50 kB of code, you cannot put all the code in RAM, but instead the code that you think is executed often. The reason that you save power when running code from RAM is that you don&amp;#39;t have to power flash that often.&lt;/p&gt;
&lt;p&gt;IRAM 1 and IRAM 2 refer to regions in the RAM. As you can see in the above figure, the application, heap, and call stack use RAM 1. If there is something else that you want to allocate  RAM to, like for example running code from RAM, you can use use IRAM2 to that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>