<?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>NRF Connect Programmer v3.0.8 for nrf5340 DK not working on Linux</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/99105/nrf-connect-programmer-v3-0-8-for-nrf5340-dk-not-working-on-linux</link><description>Hi, 
 
 I have updated to the latest nRF Connect for Desktop 4.0.1 on Linux Mint 20.1 (64 bit x86) with Programmer version 3.0.8 and my nRF5340 Dk as well as my nRF5340 Audio Dk boards fail to recover when the &amp;quot;Erase all&amp;quot; button is pressed. Both cores</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 30 Apr 2023 15:15:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/99105/nrf-connect-programmer-v3-0-8-for-nrf5340-dk-not-working-on-linux" /><item><title>RE: NRF Connect Programmer v3.0.8 for nrf5340 DK not working on Linux</title><link>https://devzone.nordicsemi.com/thread/423098?ContentTypeID=1</link><pubDate>Sun, 30 Apr 2023 15:15:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:924bf35f-b7c6-49fe-a596-52a750e97b0f</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;After testing a while with my nRF5340-DK and the nRF Connect Programmer, my feeling is, the DK is bricked, because the target nRF5340 is &amp;quot;bricked&amp;quot;. The Programmer tries to check, if it recognizes a valid Nordic device via JLink. If I switch the DK off and connect a nordic device to the external debug output of the nRF5340-DK, the nRF Connect Programmer detects both.&lt;/p&gt;
&lt;p&gt;My conclusion: the onboard nRF5340 is somehow in a state, where Jlink can&amp;#39;t read the device info.&lt;/p&gt;
&lt;p&gt;I tried to understand the other comments, but I miss the sequence to unclock the nRF5340.&lt;/p&gt;
&lt;p&gt;What I tried:&lt;/p&gt;
&lt;p&gt;&amp;gt; nrfjprog -v&lt;/p&gt;
&lt;p&gt;nrfjprog version: 10.15.1 external&lt;br /&gt;JLinkARM.dll version: 7.80c&lt;/p&gt;
&lt;p&gt;&amp;gt; nrfjprog -e --log&lt;/p&gt;
&lt;p&gt;ERROR: [SeggerBackend] - JLinkARM.dll reported &amp;quot;-1&amp;quot;, &amp;quot;An unknown error.&amp;quot;.&lt;/p&gt;
&lt;p&gt;&amp;gt; nrfjprog --recover --log&lt;br /&gt;ERROR: [SeggerBackend] - JLinkARM.dll reported &amp;quot;-1&amp;quot;, &amp;quot;An unknown error.&amp;quot;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Edit:&lt;/p&gt;
&lt;p&gt;Oh, what a mess! What a ridiculous waste of time!&lt;/p&gt;
&lt;p&gt;It depends on using a debug header (&lt;a href="https://www.tag-connect.com/product/tc2030-ctx-nl-6-pin-no-legs-cable-with-10-pin-micro-connector-for-cortex-processors"&gt;TC2030-CTX&lt;/a&gt;). With that, the DK switches to the external debug interface and if on start no nordic device is connected to that external debug interface, the nRF5340-DK is refused by the programmer.&lt;/p&gt;
&lt;p&gt;The nRF9160-DK doesn&amp;#39;t show that effect. That works with and without that debug header.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF Connect Programmer v3.0.8 for nrf5340 DK not working on Linux</title><link>https://devzone.nordicsemi.com/thread/422700?ContentTypeID=1</link><pubDate>Thu, 27 Apr 2023 10:40:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eefa0c1e-b329-4165-b062-c2edb5112e0a</guid><dc:creator>Dave H</dc:creator><description>&lt;p&gt;Thank you, the CTRL-AP chapter linked above was very insightful. Much appreciated. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF Connect Programmer v3.0.8 for nrf5340 DK not working on Linux</title><link>https://devzone.nordicsemi.com/thread/422649?ContentTypeID=1</link><pubDate>Thu, 27 Apr 2023 07:35:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98657679-81bd-4866-aee9-bab2d4ae7d11</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You are right that the information is a bit fragmented at the moment, but we are actively working to improve the the security related documentation. The Access port protection feature is documented in the &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf5340/ctrl-ap.html?cp=4_0_0_7_9"&gt;CTRL-AP chapter&lt;/a&gt; in the product specification. The&amp;nbsp;special thing about this feature is that it is enabled by default, but we try to hide these complexities with our tools. That is for instance why a &amp;quot;nrfjprog --recover&amp;quot; operation or similar writes to flash to open the debug port. Similarly, the default behavior when you build an&amp;nbsp;application&amp;nbsp;in the nRF Connect SDK is to include the code that open up the debug port by default (see &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/app_dev/ap_protect/index.html#app-approtect"&gt;Enabling access port protection mechanism&lt;/a&gt;&amp;nbsp;for more details).&lt;/p&gt;
&lt;p&gt;Regarding security related documentation in general, we have a high level starting point here: &lt;a href="https://www.nordicsemi.com/Support/Security"&gt;Security&lt;/a&gt;. There is also a separate chapter on security in the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/security.html"&gt;nRF Connect SDK&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Generally we try to avoid forcing you to use security features, but there are some features that are on by default or enforced by HW because that is required in order to provide the necessary level of security for those who needs it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF Connect Programmer v3.0.8 for nrf5340 DK not working on Linux</title><link>https://devzone.nordicsemi.com/thread/422565?ContentTypeID=1</link><pubDate>Wed, 26 Apr 2023 14:30:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:97df5e07-4f8c-4ca4-ba84-e724ea87374e</guid><dc:creator>Dave H</dc:creator><description>[quote userid="7377" url="~/f/nordic-q-a/99105/nrf-connect-programmer-v3-0-8-for-nrf5340-dk-not-working-on-linux/422555"]I see. But does programming work after you see this? I got this in the log as well once when I tested, but still programming/erase worked as expected.[/quote]
&lt;p&gt;I confirm that programming/erase is working as expected in Linux. Even when it says &amp;quot;Device is protected&amp;quot;&lt;/p&gt;
[quote userid="7377" url="~/f/nordic-q-a/99105/nrf-connect-programmer-v3-0-8-for-nrf5340-dk-not-working-on-linux/422555"]It is not a bootloader, but when you use nrfjprog recover it will program a small snippet to page 0 that writes to APPROTECT.DISABLE to make it possible to debug or program the device subsequently. It also writes to UICR.APPROTECT, as both are needed to keep the debug interface open.[/quote]
&lt;p&gt;Thanks, that is very useful. I will continue investigating along that line. I wish there was some article I could read that tells you what to do if you are not interested in any form of secure mode on this chip. The documentation is spread out and it seems like you need to know quite a lot about how security is implemented just to turn it off. I&amp;#39;m not saying that security is unimportant, just that it is not required in many instances.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF Connect Programmer v3.0.8 for nrf5340 DK not working on Linux</title><link>https://devzone.nordicsemi.com/thread/422555?ContentTypeID=1</link><pubDate>Wed, 26 Apr 2023 14:03:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ce5daf6-8994-4625-98ce-9525dbb21e5e</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="Dave H"]This happens regardless of whether or not I attempt to program a hex file or not. [/quote]
&lt;p&gt;I see. But does programming work after you see this? I got this in the log as well once when I tested, but still programming/erase worked as expected.&lt;/p&gt;
[quote user="Dave H"]And I have found this issue to be intermittent too. Sometimes it works, sometimes not.[/quote]
&lt;p&gt;Yes, that is interesting and I see the same (have only been able to reproduce once so far).&lt;/p&gt;
[quote user="Dave H"]On another note I have found that &amp;quot;nrfjprog --recover&amp;quot; works on Linux and is equivalent to &amp;quot;nrfjprog --recover --coprocessor CP_APPLICATION&amp;quot;.[/quote]
&lt;p&gt;Yes, those are equivalent. (And To recover the network core specify CP_NETWORK instead).&lt;/p&gt;
[quote user="Dave H"]I see that it writes some code to the 0x0 app core flash area. Does this have something to do with it being a boot loader and unlocking the peripherals? [/quote]
&lt;p&gt;It is not a bootloader, but when you use nrfjprog recover it will program a small snippet to page 0 that writes to APPROTECT.DISABLE to make it possible to debug or program the device subsequently. It also writes to UICR.APPROTECT, as both are needed to keep the debug interface open.&lt;/p&gt;
[quote user="Dave H"]Can I do without such a thing and run the app core in secure mode in my application itself.[/quote]
&lt;p&gt;This is overwritten when you subsequently program the device (typically with sectorerase) so after you program it with your own code there are no remains of this code snippet (other than in the UICR). The reason this is done is because APPROTECT is enabled by default and only disabled by an ERASEALL operation via the CTRL-AP or if disabled by firmware.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF Connect Programmer v3.0.8 for nrf5340 DK not working on Linux</title><link>https://devzone.nordicsemi.com/thread/422546?ContentTypeID=1</link><pubDate>Wed, 26 Apr 2023 13:41:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ff97047-f0d9-4de7-91cb-8ac02f3d1cd6</guid><dc:creator>Dave H</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;This happens regardless of whether or not I attempt to program a hex file or not. And I have found this issue to be intermittent too. Sometimes it works, sometimes not.&lt;/p&gt;
&lt;p&gt;To reproduce open nRF Connect Programmer 3.0.8 on Linux and click &amp;quot;Erase all&amp;quot;. Most of the time I get &amp;quot;Device is protected&amp;quot;. If I then eject the device and reconnect sometimes I get &amp;quot;Device is protected&amp;quot; and sometimes it works with &amp;quot;Device is connected&amp;quot;. This seems to me like some sort of timeout that is incorrectly categorized as ap protect.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;On another note I have found that &amp;quot;nrfjprog --recover&amp;quot; works on Linux and is equivalent to &amp;quot;nrfjprog --recover --coprocessor CP_APPLICATION&amp;quot;. I see that it writes some code to the 0x0 app core flash area. Does this have something to do with it being a boot loader and unlocking the peripherals? Can I do without such a thing and run the app core in secure mode in my application itself. Bootloaders don&amp;#39;t play nicely with the debugger I&amp;#39;m using.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF Connect Programmer v3.0.8 for nrf5340 DK not working on Linux</title><link>https://devzone.nordicsemi.com/thread/422523?ContentTypeID=1</link><pubDate>Wed, 26 Apr 2023 12:46:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9431f716-0089-493c-9b39-1af00e56e4e5</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Did you try to program a hex file? I ask because I see the same error in the log on my end when&amp;nbsp;opening v3.0.8 on Ubuntu 22.04 LTS, but both&amp;nbsp;erase and&amp;nbsp;write works as expected.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>