<?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>Execute program in absolute address</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/50688/execute-program-in-absolute-address</link><description>Hi, 
 If I want compiler my project at specified locate, the only thing tat I need to do is following image? Is it right? 
 
 After I program this program into address 0x0001D000 of flash memory, If I want use other program (which locate at address 0x00000000</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 10 Aug 2019 15:04:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/50688/execute-program-in-absolute-address" /><item><title>RE: Execute program in absolute address</title><link>https://devzone.nordicsemi.com/thread/203431?ContentTypeID=1</link><pubDate>Sat, 10 Aug 2019 15:04:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e955a404-7271-4c5d-a28e-ff09071a0b0d</guid><dc:creator>chianglin</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;
&lt;p&gt;Chianglin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Execute program in absolute address</title><link>https://devzone.nordicsemi.com/thread/203192?ContentTypeID=1</link><pubDate>Fri, 09 Aug 2019 02:53:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7092b0de-5908-4564-9e93-7ed95996c6b0</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;and why do you want to put a function at a specific address? It&amp;#39;s a pretty unusual thing to want to do, in fact there&amp;#39;s almost never a reason for it. You can do it with attributes on the function or a special linker map which forces the function into a section you define at one place and then you&amp;#39;d just call it and it would just work. However .. it really feels like you&amp;#39;re trying to solve a different problem here.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can google for how to put a function at a specific address, it depends on the compiler you&amp;#39;re using. eg&amp;nbsp;&lt;a href="http://www.keil.com/support/man/docs/armlink/armlink_chunk1880490665.htm"&gt;here&amp;#39;s how Keil does it&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Execute program in absolute address</title><link>https://devzone.nordicsemi.com/thread/203191?ContentTypeID=1</link><pubDate>Fri, 09 Aug 2019 02:20:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:570291f1-a07f-4827-ab6e-a525cabfbf35</guid><dc:creator>chianglin</dc:creator><description>&lt;p&gt;Hi Hung Bui,&lt;/p&gt;
&lt;p&gt;Sorry, the structure of bootloader is too complex for me.&lt;/p&gt;
&lt;p&gt;Actually, I only want to do two jobs:&lt;/p&gt;
&lt;p&gt;1. Put a function on the specified address (For example: put a function to address 0x10000).&lt;/p&gt;
&lt;p&gt;2. Execute this function from other function. How can I execute this function my &amp;quot;Jump command&amp;quot; (For example: change &amp;quot;program counter&amp;quot; to 0x10000).&lt;/p&gt;
&lt;p&gt;Would you please tell me how can I do these two job?&lt;/p&gt;
&lt;p&gt;Thank you,&lt;/p&gt;
&lt;p&gt;Chianglin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Execute program in absolute address</title><link>https://devzone.nordicsemi.com/thread/202977?ContentTypeID=1</link><pubDate>Thu, 08 Aug 2019 08:05:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d91fedf-8365-48ee-87b1-bcd9b3e4b6c6</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;I&amp;#39;m not sure I understand what you want to do ?&lt;/p&gt;
&lt;p&gt;Why do you want to locate your application at 0x1000 when leaving address 0x0000000 empty ? It won&amp;#39;t work because the reset handler on Cortex M4&amp;nbsp;is hardcoded at 0x000000.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You need to have a program (or at least reset handler) at 0x000000 to jump to your application. That&amp;#39;s why I suggested the bootloader.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Execute program in absolute address</title><link>https://devzone.nordicsemi.com/thread/202966?ContentTypeID=1</link><pubDate>Thu, 08 Aug 2019 07:19:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e792f95-7902-4f86-bc39-5df3244132df</guid><dc:creator>chianglin</dc:creator><description>&lt;p&gt;Hi Hung Bui,&lt;/p&gt;
&lt;p&gt;I had write a simple program which only blink a LED light, please find following attach file&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/blinkyTest.7z"&gt;devzone.nordicsemi.com/.../blinkyTest.7z&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It can work correctly because the program is locate from 0x00000000, please find follwing image&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/0743.OK.JPG" /&gt;&lt;/p&gt;
&lt;p&gt;If I locate program at 0x1000, the program will now work (Note: I had erase all the flash when I had erase all of the flash memory). please find following image.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/NG.JPG" /&gt;&lt;/p&gt;
&lt;p&gt;Thank you,&lt;/p&gt;
&lt;p&gt;Chianglin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Execute program in absolute address</title><link>https://devzone.nordicsemi.com/thread/202583?ContentTypeID=1</link><pubDate>Tue, 06 Aug 2019 11:17:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9527c94e-4bf4-48ef-834f-14de89ae3302</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Yes, you are right. By setting the iROM1 start address, the linker will generate the hex file with the absolute address to start at the address you configured.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you want to make a program that run at 0x0000000 (I assume you don&amp;#39;t use a softdevice) and switch to another program in different place in flash you are creating a bootloader.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We have a bootloader without softdevice example &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/9534/nrf51-bootloader-without-softdevice-sdk-8-1-0"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s from a very old post but the principle should be the same. You forward the vector table and then you jump the pc to the reset handler of the new application.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>