<?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>can  we  run soft device from RAM instead of flash?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/65829/can-we-run-soft-device-from-ram-instead-of-flash</link><description>is there any way to run soft device from RAM instead of flash? which function we can use for this .i am using s140 for nrf52840.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 14 Sep 2020 11:17:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/65829/can-we-run-soft-device-from-ram-instead-of-flash" /><item><title>RE: can  we  run soft device from RAM instead of flash?</title><link>https://devzone.nordicsemi.com/thread/269353?ContentTypeID=1</link><pubDate>Mon, 14 Sep 2020 11:17:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9bee6b0d-ede1-460e-b168-29c7017a049c</guid><dc:creator>ys parmar</dc:creator><description>&lt;p&gt;as per your suggestion i am using like this&amp;nbsp; in bilnky example&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;#pragma long_calls&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; __attribute__((used, long_calls, section(&amp;quot;.data&amp;quot;))) int main(void)&lt;br /&gt;{&lt;br /&gt; /* Configure board. */&lt;br /&gt; bsp_board_init(BSP_INIT_LEDS);&lt;br /&gt;&lt;br /&gt; /* Toggle LEDs. */&lt;br /&gt; while (true)&lt;br /&gt; {&lt;br /&gt; for (int i = 0; i &amp;lt; LEDS_NUMBER; i++)&lt;br /&gt; {&lt;br /&gt; bsp_board_led_invert(i);&lt;br /&gt; nrf_delay_ms(500);&lt;br /&gt; }&lt;br /&gt; }&lt;br /&gt;}&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;but we get same error&lt;/p&gt;
&lt;p&gt;&lt;span&gt;bilnkyoutsdh/Applications/&lt;/span&gt;main.c:66:(.data+0x6): relocation truncated to fit: R_ARM_THM_CALL against symbol `bsp_board_init&amp;#39; defined in .text.bsp_board_init section in _build/nrf52840_xxaa_boards.c.o&lt;br /&gt;bilnkyoutsdh/Applications/main.c:73:(.data+0x12): relocation truncated to fit: R_ARM_THM_CALL against symbol `bsp_board_led_invert&amp;#39; defined in .text.bsp_board_led_invert section in _build/nrf52840_xxaa_boards.c.o&lt;br /&gt;collect2.exe: error: ld returned 1 exit status&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: can  we  run soft device from RAM instead of flash?</title><link>https://devzone.nordicsemi.com/thread/269241?ContentTypeID=1</link><pubDate>Sat, 12 Sep 2020 08:43:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6563039-bda7-4022-984b-368478f300d0</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;The &lt;a href="https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html"&gt;gcc ARM documentaion&lt;/a&gt; suggests using&lt;/p&gt;
&lt;p&gt;#pragma long_calls&lt;/p&gt;
&lt;p&gt;as workaround.&lt;/p&gt;
&lt;p&gt;ARM Cortex-M cannot use a single instruction to call functions outside a &amp;plusmn;16MB range, and thus won&amp;#39;t be able to call flash from RAM. Workaround is to put the address into a register and use this for the call (BLX).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: can  we  run soft device from RAM instead of flash?</title><link>https://devzone.nordicsemi.com/thread/269239?ContentTypeID=1</link><pubDate>Sat, 12 Sep 2020 08:29:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77845dda-130c-4d9d-96f0-3f3aa306e7b0</guid><dc:creator>ys parmar</dc:creator><description>&lt;p&gt;and i am also using data section&amp;nbsp; but its give error&lt;/p&gt;
&lt;p&gt;&lt;span&gt;s/main.c:38:(.data+0x2): relocation truncated to fit: R_ARM_THM_CALL against symbol `ble_init&amp;#39; defined in .text.ble_init section in _build/nrf52840_xxaa_Ble_Interface.c.o&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: can  we  run soft device from RAM instead of flash?</title><link>https://devzone.nordicsemi.com/thread/269238?ContentTypeID=1</link><pubDate>Sat, 12 Sep 2020 08:27:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:daa151a5-de67-4bbb-b03f-b6ce5d98be81</guid><dc:creator>ys parmar</dc:creator><description>&lt;p&gt;and c&lt;span&gt;an the application run from ram and linked with soft device ? because soft device run from flash so i am confused. can those be linked&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: can  we  run soft device from RAM instead of flash?</title><link>https://devzone.nordicsemi.com/thread/269237?ContentTypeID=1</link><pubDate>Sat, 12 Sep 2020 08:19:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:34a2ea82-3605-473f-ae09-e0f327f764f2</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;The .noinit section won&amp;#39;t be populated with code - no initialization means random data (empty on POR).&lt;/p&gt;
&lt;p&gt;Try just using &amp;quot;.data&amp;quot; section. The startup code must copy your function from flash to RAM, this is always done for the data section.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Note: Your NO_INIT section seems to be waaaaay bigger than available RAM, and it overlaps the actual RAM section. Both are not a good idea.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: can  we  run soft device from RAM instead of flash?</title><link>https://devzone.nordicsemi.com/thread/269148?ContentTypeID=1</link><pubDate>Fri, 11 Sep 2020 11:29:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2208e7a-d3d5-48b5-b4d4-36deab57366a</guid><dc:creator>ys parmar</dc:creator><description>&lt;p&gt;ok thanks let see. and i have one issue .&lt;/p&gt;
&lt;p&gt;i am trying&amp;nbsp; to run our code from ram instead of flash in nrf52840. in linker file we create one section like this&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;MEMORY&lt;br /&gt;{&lt;br /&gt;FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0xda000&lt;br /&gt;RAM (rwx) : ORIGIN = 0x20003bb8, LENGTH = 0x9000&lt;br /&gt;NO_INIT (rwx) : ORIGIN = 0x20009000, LENGTH = 0x2400000&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;SECTIONS&lt;br /&gt;{&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;SECTIONS&lt;br /&gt;{&lt;br /&gt;.no_init (NOLOAD):&lt;br /&gt;{&lt;br /&gt;PROVIDE(__start_no_init_data = .);&lt;br /&gt;KEEP(*(SORT(.no_init*)))&lt;br /&gt;PROVIDE(__stop_no_init_data = .);&lt;br /&gt;} &amp;gt; NO_INIT&lt;br /&gt;}&lt;/p&gt;
&lt;h3 class="name"&gt;and use txn fxn&lt;/h3&gt;
&lt;p&gt;__attribute__((used, long_call, section(&amp;quot;.no_init&amp;quot;))) void main(void)&lt;/p&gt;
&lt;p&gt;{&lt;br /&gt;ble_init();&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;code is succesfully build but in jlink we dont see any print msg and nrf connect dont see my device name&lt;span&gt;&amp;nbsp;.&amp;nbsp; can u suggest me how can i run our main fxn in ram instead of flash&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: can  we  run soft device from RAM instead of flash?</title><link>https://devzone.nordicsemi.com/thread/269145?ContentTypeID=1</link><pubDate>Fri, 11 Sep 2020 11:25:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:74ebadec-3e73-4d1e-9927-be14cded5574</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;Nope. SD must run from flash. Google: Static linking in C language.&lt;/p&gt;
&lt;p&gt;Note that there is next to nothing to save in current consumtion - SD runs often, but not for a &lt;em&gt;long time&lt;/em&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>