<?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>Brick after sd_nvic_SystemReset() with enabled readback protection.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13140/brick-after-sd_nvic_systemreset-with-enabled-readback-protection</link><description>Hello, 
 My device is nRF51822 SD110 8.0.0. 
 The problem occured after firmware update in bootloader (own, not SDK) with readback protection enabled.
So bootloader connects to host, receive the data and write it to firmware area of the flash. After</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 15 Apr 2016 21:10:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13140/brick-after-sd_nvic_systemreset-with-enabled-readback-protection" /><item><title>RE: Brick after sd_nvic_SystemReset() with enabled readback protection.</title><link>https://devzone.nordicsemi.com/thread/50093?ContentTypeID=1</link><pubDate>Fri, 15 Apr 2016 21:10:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b78e594b-a5f2-4eec-915d-3dc6ab2f622b</guid><dc:creator>Valer_I</dc:creator><description>&lt;p&gt;Hi, I see. But the problem is not in bootloader. The problem is in function that rewrites bootloader from the firmware, when it starting to run with PALL readback activated. Further investigation shown that if I ran the same function code from flash (i.e. region 1) the update succeed and bootloader overwritten correctly. A little bit late I will open support case for this issue and give exect code to test. Now, I can add that the updating code is as simple as erasing and rewritting a few pages sequentially with reset at finish.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Brick after sd_nvic_SystemReset() with enabled readback protection.</title><link>https://devzone.nordicsemi.com/thread/50092?ContentTypeID=1</link><pubDate>Fri, 15 Apr 2016 14:22:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f29b4473-ae0b-46db-88c8-241ae437ea54</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Valer,&lt;/p&gt;
&lt;p&gt;We need more info to really understand what could be wrong here. You can send us your bootloader code for testing here, if it&amp;#39;s easy to reproduce on one of our dev kit.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Brick after sd_nvic_SystemReset() with enabled readback protection.</title><link>https://devzone.nordicsemi.com/thread/50091?ContentTypeID=1</link><pubDate>Thu, 14 Apr 2016 11:15:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eecf3d92-3b2a-4cdf-ac00-a90be3ddaaed</guid><dc:creator>Valer_I</dc:creator><description>&lt;p&gt;In both cases the same (For programming I use nRFGo studio, in SoftDevice tab tried checkbox &amp;quot;Enable SoftDevice protection (UICR.CLENR0)&amp;quot;).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Brick after sd_nvic_SystemReset() with enabled readback protection.</title><link>https://devzone.nordicsemi.com/thread/50090?ContentTypeID=1</link><pubDate>Thu, 14 Apr 2016 10:43:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f99484ff-9a8c-4618-811d-0946253631dd</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Do you set UICR.CLENR0 ? If CLENR0 is not set the whole flash will be region 1. Could you test with CLENR0 not set ?
Further debugging needed to see where the code stuck.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Brick after sd_nvic_SystemReset() with enabled readback protection.</title><link>https://devzone.nordicsemi.com/thread/50089?ContentTypeID=1</link><pubDate>Wed, 13 Apr 2016 15:01:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5aa69db9-3684-4f18-9062-07be24aca35e</guid><dc:creator>Valer_I</dc:creator><description>&lt;p&gt;In general, but I think I have to look into more details.
In firmware start I perform flash page erase from RAM and feel it could be the reason.
In RM in section MPU &lt;em&gt;9.1 Functional description&lt;/em&gt; stated &lt;em&gt;&amp;quot;Readback protection of code region 0 is enabled by writing &amp;#39;0&amp;#39; to UICR.RBPCONF.PR0. When enabled, only
code running from code region 0 will be able to access the code in code region 0. Accesses generated by
code running from code region 1 or from RAM, as well as accesses generated by the debugger (SWD), will
not be granted when code region 0 is protected.&amp;quot;&lt;/em&gt; so may be if PALL set the RAM access to code region1 is also restricted?(RM doesn&amp;#39;t state it clear enough for code region 1).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Brick after sd_nvic_SystemReset() with enabled readback protection.</title><link>https://devzone.nordicsemi.com/thread/50087?ContentTypeID=1</link><pubDate>Wed, 13 Apr 2016 13:35:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6dd5e650-c70b-4fbb-9ec1-d18c6914c633</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;No, I don&amp;#39;t think so. Readback protection only protect the chip from the SWD debug interface. You should have no problem with accessing from code.
Have you had a look at our bootloader in the SDK ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Brick after sd_nvic_SystemReset() with enabled readback protection.</title><link>https://devzone.nordicsemi.com/thread/50088?ContentTypeID=1</link><pubDate>Wed, 13 Apr 2016 13:10:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39c76f3b-1a59-48a7-9a82-6d1288515175</guid><dc:creator>Valer_I</dc:creator><description>&lt;p&gt;Thanks, this code is almost the same to mine. One more question about Readback protection, if it enabled are the any restrictions for using processor registers? ram/flash areas if to access from code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Brick after sd_nvic_SystemReset() with enabled readback protection.</title><link>https://devzone.nordicsemi.com/thread/50085?ContentTypeID=1</link><pubDate>Wed, 13 Apr 2016 11:01:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77943448-c1d9-4f8d-8e65-6352a8ec3833</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;I am not sure &amp;quot;writting 0x05fa0004 to 0xe000ed0c&amp;quot; is a correct way of triggering reset.
Here is the code for NVIC_SystemReset:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;__STATIC_INLINE void NVIC_SystemReset(void)
{
  __DSB();                                                          /* Ensure all outstanding memory accesses included
                                                                       buffered write are completed before reset */
  SCB-&amp;gt;AIRCR  = ((0x5FAUL &amp;lt;&amp;lt; SCB_AIRCR_VECTKEY_Pos) |
                 SCB_AIRCR_SYSRESETREQ_Msk);
  __DSB();                                                          /* Ensure completion of memory access */

  for(;;)                                                           /* wait until reset */
  {
    __NOP();
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It&amp;#39;s in core_cm0.h&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Brick after sd_nvic_SystemReset() with enabled readback protection.</title><link>https://devzone.nordicsemi.com/thread/50086?ContentTypeID=1</link><pubDate>Wed, 13 Apr 2016 10:20:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39ae8f9c-9fbd-41d7-a2c1-26b04d751f51</guid><dc:creator>Valer_I</dc:creator><description>&lt;p&gt;Hi, the &amp;quot;brick&amp;quot; is in sense of running application. Of cource I can erase it with SWD and reflash.
I investigated a little bit more. And it does not seem to be caused by sd_nvic_SystemReset(); after disconnection in bootloader.But in firmware at start I perform flash write and whan perform system reset by writting 0x05fa0004 to 0xe000ed0c. I suspect that reset operation performed incorrectly. Could you say the code of NVIC_SystemReset()?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Brick after sd_nvic_SystemReset() with enabled readback protection.</title><link>https://devzone.nordicsemi.com/thread/50084?ContentTypeID=1</link><pubDate>Tue, 12 Apr 2016 09:15:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aada0c71-f89f-48d6-a396-ba3f0eb4a07d</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Valer,
When you mentioned &amp;quot;brick&amp;quot; you meant you can&amp;#39;t recover (erase, reprogram) it or it just doesn&amp;#39;t jump to application ?
If it&amp;#39;s the latter, you can test to debug, maybe using UART to check if it stuck somewhere in the bootloader ?
Read back protection should only affect the SWD debugging interface. I don&amp;#39;t think it would have anything to do with the bootloader.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>