<?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>UICR / FICR in linux</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/5929/uicr-ficr-in-linux</link><description>Hello Community, 
 Does anyone know how to read/write configuration registers (UICR, FICR) on nRF51822 in a linux environment ? 
 So far, I have to stick with Windows for these operations (nrfjprog, nRFgo Studio).</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 19 Mar 2015 12:15:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/5929/uicr-ficr-in-linux" /><item><title>RE: UICR / FICR in linux</title><link>https://devzone.nordicsemi.com/thread/20651?ContentTypeID=1</link><pubDate>Thu, 19 Mar 2015 12:15:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a181afb0-6494-43ea-a7a6-54aaab1cdb7d</guid><dc:creator>Jean-Louis Bonnaff&amp;#233;</dc:creator><description>&lt;p&gt;Nice post. It works with the magic register writes and exit sequence, as follows :
J-Link&amp;gt;w4 4001e504 2
J-Link&amp;gt;w4 4001e50c 1
J-Link&amp;gt;w4 10001014 00038000
J-Link&amp;gt;r
J-Link&amp;gt;g&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UICR / FICR in linux</title><link>https://devzone.nordicsemi.com/thread/20652?ContentTypeID=1</link><pubDate>Sun, 08 Mar 2015 18:27:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4074f117-9551-451d-bf6c-4f56f03d6b4e</guid><dc:creator>Clem Taylor</dc:creator><description>&lt;p&gt;I have never used nrfjprog or nrfgo studio, I do everything in gdb.&lt;/p&gt;
&lt;p&gt;I build the UICR data into a hex file and then just manually load it in gdb.&lt;/p&gt;
&lt;p&gt;With the rev2 silicon I never managed to get the NVMC_ERASEUICR to work, so I just do a eraseall prior to program UICR.&lt;/p&gt;
&lt;p&gt;From my gdb.jlink config file:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;set $NVMC_READY              = ((uint32_t*)0x4001E400)
set $NVMC_CONFIG             = ((uint32_t*)0x4001E504)
set $NVMC_ERASEALL           = ((uint32_t*)0x4001E50C)
set $UICR_BOOTLOADERADDR     = ((uint32_t*)0x10001014)

define wait-nvmc-ready
   if *$NVMC_READY != 1
       printf &amp;quot;Wait for NVMC_READY\n&amp;quot;
       while *$NVMC_READY != 1
           shell sleep 0.1
       end
   end
end

define erase-all
   mon halt

   wait-nvmc-ready
   printf &amp;quot;Erasing entire flash...\n&amp;quot;
   # 0=REN, 1=WEN, 2=EEN
   set *$NVMC_CONFIG    = 2  

   # 1=start chip erase
   set *$NVMC_ERASEALL  = 1
   wait-nvmc-ready
   mon sleep 500

   # 0=REN, 1=WEN, 2=EEN
   set *$NVMC_CONFIG    = 0

   mon reset

   printf &amp;quot;Done...\n&amp;quot;
end

define program-uicr
   mon halt

   printf &amp;quot;UICR.BOOTLOADERADRR = 0x%08X\n&amp;quot;, *$UICR_BOOTLOADERADDR

   printf &amp;quot;Compile bin/xxx.UICR.hex\n&amp;quot;
   make bin/xxx.UICR.hex

   printf &amp;quot;Loading bin/xxx.UICR.hex\n&amp;quot;
   wait-nvmc-ready

   # 1=WEN
   set *$NVMC_CONFIG    = 1

   load bin/xxx.UICR.hex
   wait-nvmc-ready
   mon sleep 500

   # 0=REN
   set *$NVMC_CONFIG    = 0

   # verify
   printf &amp;quot;UICR.BOOTLOADERADRR    = 0x%08X\n&amp;quot;, *$UICR_BOOTLOADERADDR
   printf &amp;quot;xxxInfoUICR.magic = 0x%08X\n&amp;quot;, xxxInfoUICR.magic
   printf &amp;quot;xxxKeysUICR.magic = 0x%08X\n&amp;quot;, xxxKeysUICR.magic
   printf &amp;quot;xxxKeysUICR.crc   = 0x%08X\n&amp;quot;, xxxKeysUICR.crc
end
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UICR / FICR in linux</title><link>https://devzone.nordicsemi.com/thread/20650?ContentTypeID=1</link><pubDate>Sat, 07 Mar 2015 14:37:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c89b511-921d-4b32-b5a5-10eb8c54e2db</guid><dc:creator>Eirik Midttun</dc:creator><description>&lt;p&gt;The way to do it is to download JLink and run it from the command line. I have described how to program and erase the nRF51 chip in &lt;a href="https://devzone.nordicsemi.com/blogs/22/getting-started-with-nrf51-development-on-mac-os-x/"&gt;this blog post&lt;/a&gt;. I have not tried manipulating the UICR or FICR, but it should be a normal register write. See the nRF51 reference manual to find the memory addresses.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>