<?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>Writing into UICR register by disabling SoftDevice</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/61305/writing-into-uicr-register-by-disabling-softdevice</link><description>Hello, 
 
 I am using nRF52840, SDK_16.0.0, SoftDevice S140 V7.0.1 and Segger for flashing the image. I am using ‘ble_app_blinky’. 
 
 1) I want to write Serial number into UICR register. Since SoftDevice is enabled, I am not able to update UICR register</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 12 Mar 2020 12:32:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/61305/writing-into-uicr-register-by-disabling-softdevice" /><item><title>RE: Writing into UICR register by disabling SoftDevice</title><link>https://devzone.nordicsemi.com/thread/249436?ContentTypeID=1</link><pubDate>Thu, 12 Mar 2020 12:32:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e90ab968-09c0-4371-8b27-50eb1a59b308</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Should work ok as long as the contents of memory at&amp;nbsp;0x1000108C are clean (previously erased)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing into UICR register by disabling SoftDevice</title><link>https://devzone.nordicsemi.com/thread/249435?ContentTypeID=1</link><pubDate>Tue, 10 Mar 2020 09:47:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f490fba-3b9f-4da1-9558-9eed61552a1e</guid><dc:creator>beemavishnu</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Any inputs on point 2 with respect to Soft reset.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing into UICR register by disabling SoftDevice</title><link>https://devzone.nordicsemi.com/thread/249434?ContentTypeID=1</link><pubDate>Thu, 27 Feb 2020 07:30:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:331240af-26ba-45c6-9b29-54b58df25695</guid><dc:creator>beemavishnu</dc:creator><description>&lt;p&gt;Sorry, can you please confirm on point 2 on Soft reset.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing into UICR register by disabling SoftDevice</title><link>https://devzone.nordicsemi.com/thread/249433?ContentTypeID=1</link><pubDate>Thu, 27 Feb 2020 07:24:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06137561-737c-48ee-86c9-76bd9b689a41</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user="beemavishnu"]You mean&amp;nbsp;&lt;span&gt;nrf_nvmc_write_bytes() will wait for flash ready before writing&amp;nbsp;into flash.&lt;/span&gt;[/quote]
&lt;p&gt;&amp;nbsp;No, I mean that it will wait that the flash write has been successful by checking that NRF_NVMC-&amp;gt;READY state is NOT busy.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="beemavishnu"]But when I call&amp;nbsp;nrf_nvmc_write_byte() and try to write same location with different values, in this case, I am not getting any error and able to write.[/quote]
&lt;p&gt;&amp;nbsp;But you should not write to an already written flash address with another value unless you just want to toggle few bits with value &amp;#39;1&amp;#39; to bits with value &amp;#39;0&amp;#39;. NVMC only can toggle bits from 1&amp;#39;s to 0&amp;#39;s and cannot toggle bits from 0&amp;#39;s to 1&amp;#39;s unless you do a full page erase.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing into UICR register by disabling SoftDevice</title><link>https://devzone.nordicsemi.com/thread/249432?ContentTypeID=1</link><pubDate>Thu, 27 Feb 2020 03:34:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0174a141-072b-466d-9bbd-ca19e764ee7f</guid><dc:creator>beemavishnu</dc:creator><description>&lt;p&gt;Hi Susheel,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you for your inputs.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;1) You mean&amp;nbsp;&lt;span&gt;nrf_nvmc_write_bytes() will wait for flash ready before writing&amp;nbsp;into flash. I kept even after writing and before soft reset. Whether even this is taken care. My intention is not to do soft reset before writing into UICR.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2) Good to know Soft reset will not reset RAM. In other chips, usually Soft reset will also reset RAM. After writing UICR, its mentioned to reset chip. So in this case Soft reset is good enough or do I need to do hard reset after writing UICR register to take effect.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;3) Yes, that&amp;#39;s what I am mentioned. nrfjprog will not allow (This is fine). But when I call&amp;nbsp;nrf_nvmc_write_byte() and try to write same location with different values, in this case, I am not getting any error and able to write.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; Regards&lt;/p&gt;
&lt;p&gt;Vishnu Beema&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing into UICR register by disabling SoftDevice</title><link>https://devzone.nordicsemi.com/thread/249431?ContentTypeID=1</link><pubDate>Wed, 26 Feb 2020 13:50:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:01060f60-408e-4bf6-9111-bc0120120da7</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;You wont be able to write to UICR while softdevice is enabled and we do not have any API exposed by softdevice to allow writing to UICR while SD is enabled.&lt;/li&gt;
&lt;li&gt;nrf_nvmc_write_bytes already waits for flash ready, so you do not need to wait again for it.&amp;#39;&lt;/li&gt;
&lt;li&gt;NVIC_SystemReset is a soft reset. You need to do a pin reset if you want a hard reset.
&lt;ol&gt;
&lt;li&gt;It is not clear what you are trying to ask here. &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52840%2Fpower.html&amp;amp;cp=4_0_0_4_2_5_7&amp;amp;anchor=concept_res_behav"&gt;Softreset &lt;/a&gt;will NOT reset RAM&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;You cannot write to already wriiten UICR address. You need to erase the UICR page (and this you can only do by erasing the whole chip). nrfjprog will not write to any address that has already some value in it.&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>