<?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>Is&amp;#39;t possible to change app start address from prebuild binary file?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/77989/is-t-possible-to-change-app-start-address-from-prebuild-binary-file</link><description>Hi, Usually we set FLASH_START macro to indicate application start address, I do like to consult is&amp;#39;t possible to change the FLASH_START from prebuild binary file without rebuild? I&amp;#39;m trying to implement dual boot, that is, 2 different application are</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 06 Aug 2021 12:38:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/77989/is-t-possible-to-change-app-start-address-from-prebuild-binary-file" /><item><title>RE: Is't possible to change app start address from prebuild binary file?</title><link>https://devzone.nordicsemi.com/thread/323751?ContentTypeID=1</link><pubDate>Fri, 06 Aug 2021 12:38:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aee7534e-30e8-4895-89c1-80414b8e7b44</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Do both application use the softdevice? See &lt;a href="https://infocenter.nordicsemi.com/topic/sds_s140/SDS/s1xx/processor_avail_interrupt_latency/interrupt_forwarding_to_application.html"&gt;this section&lt;/a&gt; in the documentation:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;For the SoftDevice to locate the application interrupt vectors, the application must define its interrupt vector table at the bottom of the Application Flash Region illustrated in&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sds_s140/SDS/s1xx/mem_usage/mem_resource_map_usage.html#mem_resource_map_usage__fig_tjt_thp_3r"&gt;Memory resource map&lt;/a&gt;. When the base address of the application code is directly after the top address of the SoftDevice, the code can be developed as a standard ARM&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/00ae.svg" title="Registered"&gt;&amp;#x00ae;&lt;/span&gt; Cortex&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/00ae.svg" title="Registered"&gt;&amp;#x00ae;&lt;/span&gt; -&lt;span&gt;&lt;span&gt;M4&lt;/span&gt;&lt;/span&gt;&amp;nbsp;application project with the compiler creating the interrupt vector table.&amp;quot;&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is't possible to change app start address from prebuild binary file?</title><link>https://devzone.nordicsemi.com/thread/322610?ContentTypeID=1</link><pubDate>Fri, 30 Jul 2021 08:37:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1774677-eef5-45fd-bad7-b6c36efe55c9</guid><dc:creator>kaiwak</dc:creator><description>&lt;p&gt;Hi J&amp;oslash;rgen,&lt;/p&gt;
&lt;p&gt;Thank you for the reply, exactly arm-none-eabi-objcopy can change the image placement,&lt;br /&gt;then I did some experimentation,&lt;/p&gt;
&lt;p&gt;Build image demos_27000.hex with FLASH_START=0x27000,&lt;/p&gt;
&lt;p&gt;Change generated hex file address to 0x8d000, named 27000_to_8d000.hex&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;arm-none-eabi-objcopy --change-address 0x66000 demos_27000.hex 27000_to_8d000.hex
(0x66000 + 0x27000 = 0x8d000)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Write 2 hex files to nRF52840, then seems it can boot to both 0x27000 and 0x8d000,&lt;/p&gt;
&lt;p&gt;BUT,&lt;br /&gt;If I erase the image of 0x27000 from nRF52840, keep others,&lt;br /&gt;then it can&amp;#39;t boot to image of 0x8d000, the&amp;nbsp;&lt;span&gt;27000_to_8d000.hex&lt;/span&gt; anymore.&lt;/p&gt;
&lt;p&gt;I did one more experimentation,&lt;br /&gt;Build an image with FLASH_START=0x00000, then change its address to 0x8d000, named 00000_to_8d000.hex,&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;arm-none-eabi-objcopy --change-address 0x8d000 demos_00000.hex 00000_to_8d000.hex&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Then write original demos_27000.hex and 00000_to_8d000.hex to nRF52840,&lt;br /&gt;this time, 0x27000 can boot normally, but 0x8d000, the 00000_to_8d000.hex can&amp;#39;t,&lt;/p&gt;
&lt;p&gt;I guess that should be something such like vector table or somethings&lt;br /&gt;are indicated with FLASH_START during compiling,&lt;br /&gt;so even I changed where the image to be writen, image still can&amp;#39;t work.&lt;/p&gt;
&lt;p&gt;By the way, my arm-none-eabi-objcopy version is 2.34&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;arm-none-eabi-objcopy --version
GNU objcopy (2.34-4ubuntu1+13ubuntu1) 2.34
Copyright (C) 2020 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And, if build image with FLASH_START=0x8d000,&lt;br /&gt;it can boot even image of 0x27000 has been erased.&lt;/p&gt;
&lt;p&gt;Thanks~&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is't possible to change app start address from prebuild binary file?</title><link>https://devzone.nordicsemi.com/thread/322425?ContentTypeID=1</link><pubDate>Thu, 29 Jul 2021 11:25:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:229d1f35-dcf7-4d22-837f-31a6f5a12bd5</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It is possible to change the start address of the HEX-file using objcopy:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;arm-none-eabi-objcopy --change-addresses &amp;lt;address&amp;gt; &amp;lt;input_file&amp;gt;.hex &amp;lt;output_file&amp;gt;.hex&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;However, I&amp;#39;m not sure if the application will work correctly if moved this way. You may try it out in your device.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>