<?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>nRF52840 Dongle Failed on SWD with Lowlevel error: NOT_AVAILABLE_BECAUSE_PROTECTION (ffffffa6)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/91660/nrf52840-dongle-failed-on-swd-with-lowlevel-error-not_available_because_protection-ffffffa6</link><description>It seems this is a new problem with PCA10059 2.1.0, but not 2.0.0 or 2.0.1 that we previously used. 
 I use a nrf52-dk to connect its P19 to the SWD pins on the dongle. With the newer version 2.1.0, nrf-connect programmer fails to identify the dongle</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 09 Sep 2022 07:57:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/91660/nrf52840-dongle-failed-on-swd-with-lowlevel-error-not_available_because_protection-ffffffa6" /><item><title>RE: nRF52840 Dongle Failed on SWD with Lowlevel error: NOT_AVAILABLE_BECAUSE_PROTECTION (ffffffa6)</title><link>https://devzone.nordicsemi.com/thread/385438?ContentTypeID=1</link><pubDate>Fri, 09 Sep 2022 07:57:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89dd9dd8-cfe3-4377-a6af-03f9e69179ab</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;It is correct that the value of APPROTECTSTATUS register should be 1 if access port protection has been disabled. The same content should be in UICR.APPROTECT and APPROTECT.DISABLE registers. UICR register is read only at the time of reset. Therefore, after writing to UICR register, reset should be performed.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Dongle Failed on SWD with Lowlevel error: NOT_AVAILABLE_BECAUSE_PROTECTION (ffffffa6)</title><link>https://devzone.nordicsemi.com/thread/385325?ContentTypeID=1</link><pubDate>Thu, 08 Sep 2022 13:38:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fba6e033-367d-43e1-9a1d-64b5e5cbe33a</guid><dc:creator>minghua</dc:creator><description>&lt;p&gt;Hi, Dejan, &lt;/p&gt;
&lt;p&gt;Really appreciate your suggestions those came just at right timing and to the right points!&lt;/p&gt;
&lt;p&gt;One more question: Should the APPROTECTSTATUS change to 1 when the protection is effectively disabled, like at the end of my code example after setting both UICR and APPROTECT registers? I see the register readings are always 0.&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Dongle Failed on SWD with Lowlevel error: NOT_AVAILABLE_BECAUSE_PROTECTION (ffffffa6)</title><link>https://devzone.nordicsemi.com/thread/385199?ContentTypeID=1</link><pubDate>Thu, 08 Sep 2022 09:03:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:989b27e6-1e23-4a5a-bc71-fe8ee5d90e89</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;I am glad that your issue has been resolved.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Dongle Failed on SWD with Lowlevel error: NOT_AVAILABLE_BECAUSE_PROTECTION (ffffffa6)</title><link>https://devzone.nordicsemi.com/thread/385115?ContentTypeID=1</link><pubDate>Wed, 07 Sep 2022 19:52:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4165c575-266b-40ab-8957-56dac6b257e0</guid><dc:creator>minghua</dc:creator><description>&lt;p&gt;Here is the new developments:&lt;/p&gt;
&lt;p&gt;The code follows is added to the &amp;quot;/* UICR modify ... */&amp;quot; point, that has solved the problem.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    /* UICR modify ... */
    NRF_LOG_INFO(&amp;quot;* Enabling access port *\n&amp;quot;);
    log_wait_ms(2); /* flush cli logging */
    //NRF_UICR-&amp;gt;APPROTECT = 0xFFFFFF5A;
    //*((__IOM uint32_t *)&amp;amp;(NRF_UICR-&amp;gt;APPROTECT)) = 0xFFFFFF5A;
    int rc = write_word_to_uicr( (uint32_t *)0x10001208, 0xFFFFFF5A);
    if ( rc == 0 ) {
        NRF_LOG_INFO(&amp;quot;* Enabling access port * already enabled!\n&amp;quot;);
    } else if ( rc == 1 ) {
        NRF_LOG_INFO(&amp;quot;* Enabling access port * failed!\n&amp;quot;);
    } else {
        NRF_LOG_INFO(&amp;quot;* Enabled access port * reset now\n&amp;quot;);
        log_wait_ms(200); /* flush cli logging */
        NVIC_SystemReset();;
    }
    NRF_LOG_INFO(&amp;quot;UICR APPROTECT written\n&amp;quot;);
    log_wait_ms(2); /* flush cli logging */
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Its function &amp;quot;write _word_to_uicr()&amp;quot; is adapted from &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/82409/example-code-to-write-to-uicr"&gt;another QnA&lt;/a&gt; when searching for &amp;quot;nrf52840 write uicr flash&amp;quot;. I modified it to return 0 or 1 or 2 for different cases. &lt;/p&gt;
&lt;p&gt;Despite, the APPROTECTSTATUS at 0x4000000C shows always 0. That cannot be used as an indication of what the current protection status is, while the product spec seems to suggest it can/should.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Dongle Failed on SWD with Lowlevel error: NOT_AVAILABLE_BECAUSE_PROTECTION (ffffffa6)</title><link>https://devzone.nordicsemi.com/thread/385114?ContentTypeID=1</link><pubDate>Wed, 07 Sep 2022 19:45:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81cd200a-97c9-4608-99dd-29e6e33f340a</guid><dc:creator>minghua</dc:creator><description>&lt;p&gt;I deleted one message in the middle, that by accident deleted all replies after it. I&amp;#39;ll try to post a little history in the deleted thread:&lt;/p&gt;
&lt;p&gt;I compared the schematics for 2.1.0 and 2.0.0. No obvious difference could be seen.&lt;/p&gt;
&lt;p&gt;It turned out the chip on hardware 2.1.0 is a rev3, instead of a rev2 on hardware 2.0.0. The rev3 needs a &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Ferrata_nRF52840_Rev3%2FERR%2FnRF52840%2FRev3%2Flatest%2Fconfig_840_249.html&amp;amp;cp=4_0_1_0_2_0"&gt;work-around to set &amp;quot;NRF_APPROTECT-&amp;gt;DISABLE&amp;quot; to 0x5A by its errata&lt;/a&gt; and by the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52840%2Fdif.html&amp;amp;cp=4_0_0_3_7"&gt;production specification trace and debug section&lt;/a&gt;. Thus I added the following code to the main(), that did not solve the problem:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void ap_protect_disable()
{
    NRF_LOG_INFO(&amp;quot;function called ap_protect_disable()\n&amp;quot;);
    log_wait_ms(2); /* flush cli logging */
    /* show status @0x4000000C */
    NRF_LOG_INFO(&amp;quot;APPROTECT STATUS 0x%x\n&amp;quot;, *((__IOM uint32_t *)0X4000000C) );
    log_wait_ms(2); /* flush cli logging */
    /* APPROTECT FORCEPROTECT @0x40000550 */
    NRF_LOG_INFO(&amp;quot;APPROTECT FORCEPROTECT 0x%x\n&amp;quot;, *((__IOM uint32_t *)0X40000550) );
    log_wait_ms(2); /* flush cli logging */
    /* APPROTECT DISABLE @0x40000558 */
    NRF_LOG_INFO(&amp;quot;APPROTECT DISABLE 0x%x\n&amp;quot;, *((__IOM uint32_t *)0X40000558) );
    log_wait_ms(2); /* flush cli logging */

    /* UICR APPROTECT is 0xFFFFFFFF */
    NRF_LOG_INFO(&amp;quot;UICR APPROTECT 0x%x\n&amp;quot;, NRF_UICR-&amp;gt;APPROTECT);
    log_wait_ms(2); /* flush cli logging */
    /* UICR modify ... ignore for now */
    NRF_LOG_INFO(&amp;quot;UICR APPROTECT 0x%x\n&amp;quot;, NRF_UICR-&amp;gt;APPROTECT);
    log_wait_ms(2); /* flush cli logging */

    /* disable. though it&amp;#39;s always 0x5A from the beginning. */
    //NRF_APPROTECT-&amp;gt;DISABLE = APPROTECT_DISABLE_DISABLE_SwDisable; /* rev3 chip errata */
    *((__IOM uint32_t *)0X40000558) = 0x5A;
    NRF_LOG_INFO(&amp;quot;APPROTECT DISABLE written\n&amp;quot;);
    log_wait_ms(2); /* flush cli logging */
    /* APPROTECT DISABLE @0x40000558 */
    NRF_LOG_INFO(&amp;quot;APPROTECT DISABLE 0x%x\n&amp;quot;, *((__IOM uint32_t *)0X40000558) );
    log_wait_ms(2); /* flush cli logging */

    /* show twice */
    NRF_LOG_INFO(&amp;quot;APPROTECT STATUS 0x%x\n&amp;quot;, *((__IOM uint32_t *)0X4000000C) );
    log_wait_ms(2); /* flush cli logging */
    NRF_LOG_INFO(&amp;quot;APPROTECT STATUS 0x%x\n&amp;quot;, *((__IOM uint32_t *)0X4000000C) );
    log_wait_ms(2); /* flush cli logging */
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Dejan suggested to set both the UICR register and the APPROTECT register. I believe that makes sense.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Dongle Failed on SWD with Lowlevel error: NOT_AVAILABLE_BECAUSE_PROTECTION (ffffffa6)</title><link>https://devzone.nordicsemi.com/thread/384863?ContentTypeID=1</link><pubDate>Tue, 06 Sep 2022 19:10:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d26841c9-aa26-4209-92c9-1f065d353474</guid><dc:creator>minghua</dc:creator><description>&lt;p&gt;I figured the hardware doc for PCA10059 2.0.0 is similar to the above link you posted for 2.1.0: &lt;a id="" href="https://www.nordicsemi.com/-/media/Software-and-other-downloads/Dev-Kits/nRF52840-Dongle/nRF52840-USB-Dongle---Hardware-files-2_0_0.zip"&gt;https://www.nordicsemi.com/-/media/Software-and-other-downloads/Dev-Kits/nRF52840-Dongle/nRF52840-USB-Dongle---Hardware-files-2_0_0.zip&lt;/a&gt; . Very much thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Dongle Failed on SWD with Lowlevel error: NOT_AVAILABLE_BECAUSE_PROTECTION (ffffffa6)</title><link>https://devzone.nordicsemi.com/thread/384861?ContentTypeID=1</link><pubDate>Tue, 06 Sep 2022 19:01:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d80a2545-80dd-4fd1-b297-c01a2e197c37</guid><dc:creator>minghua</dc:creator><description>&lt;p&gt;Hi, Dejan, &lt;/p&gt;
&lt;p&gt;This &amp;quot;nrfjprog --recover&amp;quot; works! That&amp;#39;s great. I downloaded the command line tool v10.10.0, nrfjprog is contained in it. The other QnA (&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/69427/not_available_because_protection-jlink-fails-nrf-connect-for-desktop-fails"&gt;NOT_AVAILABLE_BECAUSE_PROTECTION, jlink fails, nRF Connect for desktop fails&lt;/a&gt;) seems to suggest that version 10.10.0. I also need to keep VCC up when it erases and programs the flash per the programming guide page that you pointed to. &lt;/p&gt;
&lt;p&gt;A new problem is that the dongle can be programmed only when power keeps on. After it is powered down, and powered up again, the same error comes back. Is there a way to make the effect permanent?&lt;/p&gt;
&lt;p&gt;Thanks for the help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Dongle Failed on SWD with Lowlevel error: NOT_AVAILABLE_BECAUSE_PROTECTION (ffffffa6)</title><link>https://devzone.nordicsemi.com/thread/384840?ContentTypeID=1</link><pubDate>Tue, 06 Sep 2022 15:23:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27488c77-40dc-4972-85f5-aae188d2df1e</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;You could try to recover the board using &amp;quot;nrfjprog --recover&amp;quot;. The&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/guides/short-range-guides/b/getting-started/posts/nrf52840-dongle-programming-tutorial"&gt;nRF52840 dongle programming guide&lt;/a&gt;&amp;nbsp;provides information about the programming procedure for the dongle. Section &amp;quot;A word of caution before you begin&amp;quot; mentions register&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/uicr.html?cp=3_0_0_3_4_0_7#register.REGOUT0"&gt;REGOUT0&lt;/a&gt;&amp;nbsp;which should either be programmed directly or indirectly by the firmware.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Hardware documentation is available on&amp;nbsp;&lt;a href="https://www.nordicsemi.com/-/media/Software-and-other-downloads/Dev-Kits/nRF52840-Dongle/nRF52840-USB-Dongle---Hardware-files-2_1_0.zip"&gt;nordicsemi.com&lt;/a&gt;&amp;nbsp;webpage.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Dongle Failed on SWD with Lowlevel error: NOT_AVAILABLE_BECAUSE_PROTECTION (ffffffa6)</title><link>https://devzone.nordicsemi.com/thread/384673?ContentTypeID=1</link><pubDate>Tue, 06 Sep 2022 01:49:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b12f5ec-cf5a-4ca5-833d-d311e6b7ea88</guid><dc:creator>minghua</dc:creator><description>&lt;p&gt;Please also point us to the documentation for version 2.1.0 hardware. I&amp;#39;d like to see the schematic of the dongle so that can be sure our external circuits are still compatible with the new dongle version.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>