<?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>Compiling nRF51822 bootloader example using GCC</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/1975/compiling-nrf51822-bootloader-example-using-gcc</link><description>Hi,
I&amp;#39;m trying to compile the bootloader example using GCC instead of Keil compiler. 
 To do so, I copied the bootloader example and started editing the file bootloader_util_arm.c, in particular I&amp;#39;ve changed: 
 
__asm void StartApplication(uint32_t</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 28 Mar 2014 10:56:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/1975/compiling-nrf51822-bootloader-example-using-gcc" /><item><title>RE: Compiling nRF51822 bootloader example using GCC</title><link>https://devzone.nordicsemi.com/thread/8480?ContentTypeID=1</link><pubDate>Fri, 28 Mar 2014 10:56:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99448fab-47b7-4623-8d54-380567fbc862</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;Yes, you&amp;#39;ll have to split the file using objcopy, and then write both the main part and the UICR part with JLinkExe. You may have to use objdump to see which sections are in your elf file, and where they&amp;#39;re supposed to be located. If you have trouble with this, I suggest you post it separately, as it is really an unrelated problem.&lt;/p&gt;
&lt;p&gt;It seems the others are on Windows, on which you can use nrfjprog to program insted of JLinkExe directly. nrfjprog supports programming hex files directly, avoiding the need for bin files completely, and is hence more usable in that regard.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiling nRF51822 bootloader example using GCC</title><link>https://devzone.nordicsemi.com/thread/8479?ContentTypeID=1</link><pubDate>Tue, 25 Mar 2014 18:08:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5eaa02be-fb06-4c48-9635-af5fb0cb8476</guid><dc:creator>Samuele Forconi</dc:creator><description>&lt;p&gt;Hi,
thanks for your answer.&lt;/p&gt;
&lt;p&gt;Ok, I&amp;#39;ve understood the problem related to the 256MB file size, but I still have some doubts.&lt;/p&gt;
&lt;p&gt;As I understand, to start the bootloader firmware (that resides at some address in flash around 0x03C800) it is needed that the UICR-&amp;gt;BOOTLOADERADDR register is loaded with the bootloader firmware start address. How can I load this address into the UICR-&amp;gt;BOOTLOADERADDR? Do I need to split the UICR section of my executable file and load that piece of bin separately, similar as is done for the s110?&lt;/p&gt;
&lt;p&gt;In the other thread you suggested, the second solution provided by Nikita seems to be similar to the one I have adopted, but there isn&amp;#39;t any reference to big executable size using this method.&lt;/p&gt;
&lt;p&gt;Samuele.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiling nRF51822 bootloader example using GCC</title><link>https://devzone.nordicsemi.com/thread/8478?ContentTypeID=1</link><pubDate>Tue, 25 Mar 2014 13:34:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab2afa69-f4e8-49a8-9568-2501471e5016</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;I&amp;#39;d recommend you to take a look at &lt;a href="https://devzone.nordicsemi.com/index.php/nrf51822-over-the-air-bootloader-with-gcc"&gt;this question&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The bootloader hex is set up to write to a UICR register, which is mapped at 0x10001014, in addition to the normal code at around address 0. The difference between those are about 256 MB, so for any format that doesn&amp;#39;t allow address jumps, you&amp;#39;ll see a 256 MB file with almost all 0s. This is the case for raw binary files, but not for elf files or hex files, which include addressing information.&lt;/p&gt;
&lt;p&gt;This is also the reason that the Makefile &lt;a href="https://github.com/hlnd/nrf51-pure-gcc-setup/blob/master/template/Makefile.posix#L36"&gt;here&lt;/a&gt;, that flash the softdevice, splits the hex into two different binaries before writing it to the chip; one with the main flash contents and one with UICR contents.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>