<?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 do I configure my project to write to UICR in IAR</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/8610/how-do-i-configure-my-project-to-write-to-uicr-in-iar</link><description>Hello, 
 I&amp;#39;m trying to create my own bootloader application that uses softdevice in IAR. I would like to know how to configure my project so that it writes 0x0003A000 to the UICR at 0x10001014. 
 I am using IAR workbench, but when I use 
 #pragma location</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 14 Aug 2015 09:36:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/8610/how-do-i-configure-my-project-to-write-to-uicr-in-iar" /><item><title>RE: How do I configure my project to write to UICR in IAR</title><link>https://devzone.nordicsemi.com/thread/31510?ContentTypeID=1</link><pubDate>Fri, 14 Aug 2015 09:36:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7a43f35-0215-482c-b644-07f073da00f5</guid><dc:creator>R. Schultze</dc:creator><description>&lt;p&gt;Thank you for your answer. you are correct that it fills the entire bin file with padding if i add it to the icf file.&lt;/p&gt;
&lt;p&gt;I have solved the problem by having my application write the UICR boot address register if it is not found like so:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uicrTemp = *(reinterpret_cast&amp;lt;volatile uint32_t *&amp;gt;(0x10001014));
if (uicrTemp != 0x0003A000){
	nrf_nvmc_write_word(0x10001014, 0x0003A000);	
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I configure my project to write to UICR in IAR</title><link>https://devzone.nordicsemi.com/thread/31509?ContentTypeID=1</link><pubDate>Fri, 07 Aug 2015 14:57:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8300dffa-b02f-4cc4-9b82-b8f89815f85a</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;Try:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#pragma location=&amp;quot;MySection&amp;quot;
const uint32_t uicr = 0x0003A000;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In icf file add line:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;place at address mem: 0x10001014 { readonly section MySection};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But compiler may not allocate it in memory if you don&amp;#39;t use it. So you have to add line anywhere in your code where you assign that constant to dummy variable;
Other method is to create small hex file with 0x0003A000@0x10001014 value and do post-build merge of final hex and small hex.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:020000041000EA
:0410140000A0030035
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>