<?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>A UICR write operation has been requested but UICR has not been erased</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/25305/a-uicr-write-operation-has-been-requested-but-uicr-has-not-been-erased</link><description>There are already a few threads about this problem but none of them helped. 
 I want to use GPIO9 + 10 as .. well .. GPIO. 
 Here&amp;#39;s what I did: 
 
 added CFLAGS += -DCONFIG_NFCT_PINS_AS_GPIOS in Makefile 
 added a section in linker script: 
 
</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 20 Sep 2017 08:54:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/25305/a-uicr-write-operation-has-been-requested-but-uicr-has-not-been-erased" /><item><title>RE: A UICR write operation has been requested but UICR has not been erased</title><link>https://devzone.nordicsemi.com/thread/99721?ContentTypeID=1</link><pubDate>Wed, 20 Sep 2017 08:54:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc89e593-81c1-4d97-9ca9-8358867622db</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Alternatively, you can run &lt;code&gt;make erase&lt;/code&gt; and then &lt;code&gt;make flash&lt;/code&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A UICR write operation has been requested but UICR has not been erased</title><link>https://devzone.nordicsemi.com/thread/99720?ContentTypeID=1</link><pubDate>Wed, 20 Sep 2017 08:53:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5440f8e3-ceea-428d-b76d-06d78b00adf5</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Ah, its because the make flash only performs a sectorerase, which does not erase the UICR registers.Could you try flashing the board using nrjfprog directly, i.e. just run make and then erase chip using the --eraseall option and flash the compiled hex file that in the _build folder, i.e.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrfjprog -f nrf52 --eraseall
nrfjprog -f nrf52 --program _build\nrf52832_xxaa.hex 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will erase the entire chip, so if you&amp;#39;re using a SoftDevice you will have to flash it as well.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A UICR write operation has been requested but UICR has not been erased</title><link>https://devzone.nordicsemi.com/thread/99719?ContentTypeID=1</link><pubDate>Wed, 20 Sep 2017 08:30:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0af30ea-0981-41c4-8957-73b044ab4eec</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;Thanks Bjorn, I have to admit I&amp;#39;m pretty new to the low-level coding (coming from C# in comfortable Visual Studio :) )&lt;/p&gt;
&lt;p&gt;After the changes I tried (in this order):
Make flash_softdevice
Make flash&lt;/p&gt;
&lt;p&gt;here&amp;#39;s the output of flash:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;$ make flash Flashing:
_build/nrf52832_xxaa.hex nrfjprog --program _build/nrf52832_xxaa.hex -f nrf52 --sectorerase Parsing hex file.
Erasing page at address 0x1F000.
Erasing page at address 0x20000.
Erasing page at address 0x21000.
Erasing page at address 0x22000.
Erasing page at address 0x23000.
Erasing page at address 0x24000.
Erasing page at address 0x25000.
Erasing page at address 0x26000.
Erasing page at address 0x27000.
Erasing page at address 0x28000.
Erasing page at address 0x29000.
Erasing page at address 0x2A000.
Erasing page at address 0x2B000.
Erasing page at address 0x2C000.
Erasing page at address 0x2D000.
WARNING: A UICR write operation has
been requested but UICR has not been
WARNING: erased. Please verify that
the result is correct. Applying system
reset. Checking that the area to write
is not protected. Programing device.
nrfjprog --reset -f nrf52 Applying
system reset. Run.&lt;/p&gt;
&lt;/blockquote&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A UICR write operation has been requested but UICR has not been erased</title><link>https://devzone.nordicsemi.com/thread/99718?ContentTypeID=1</link><pubDate>Wed, 20 Sep 2017 07:34:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:964920fc-c0f8-4f2e-9f7c-b9d92b69f230</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;@chrismakaio: You should only have to add CFLAGS += -DCONFIG_NFCT_PINS_AS_GPIOS to the Makefile, the nRF52 will then run this snippet on startup(see the system_nrf52.c file)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#if defined (CONFIG_NFCT_PINS_AS_GPIOS)
        if ((NRF_UICR-&amp;gt;NFCPINS &amp;amp; UICR_NFCPINS_PROTECT_Msk) == 
               (UICR_NFCPINS_PROTECT_NFC &amp;lt;&amp;lt; UICR_NFCPINS_PROTECT_Pos)){
            NRF_NVMC-&amp;gt;CONFIG = NVMC_CONFIG_WEN_Wen &amp;lt;&amp;lt; NVMC_CONFIG_WEN_Pos;
            while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy){}
            NRF_UICR-&amp;gt;NFCPINS &amp;amp;= ~UICR_NFCPINS_PROTECT_Msk;
            while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy){}
            NRF_NVMC-&amp;gt;CONFIG = NVMC_CONFIG_WEN_Ren &amp;lt;&amp;lt; NVMC_CONFIG_WEN_Pos;
            while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy){}
            NVIC_SystemReset();
        }
    #endif
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;However, adding&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;const uint32_t UICR_ADDR_0x20C __attribute__ ((section(&amp;quot;.uicrNfcPinsAddress&amp;quot;))) __attribute__((used));
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;to &lt;code&gt;main.c&lt;/code&gt; and modifying the linker script by adding&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;UICR_NFCPINS(r) : ORIGIN = 0x1000120C, LENGTH = 0x04
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;under MEMORY in the linker script and adding&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;.uicrNfcPinsAddress : 
  { 
     KEEP(*(.uicrNfcPinsAddress)) 
  } &amp;gt; UICR_NFCPINS
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;under SECTIONS should also work. Are you using nrfjprog to flash the compiled hexfile?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A UICR write operation has been requested but UICR has not been erased</title><link>https://devzone.nordicsemi.com/thread/99717?ContentTypeID=1</link><pubDate>Tue, 19 Sep 2017 18:52:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df405bd5-d438-4c4f-bac9-516b4d168cef</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;just another data point: I&amp;#39;m NOT using the DK :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>