<?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>Failure to eraseall via NVMC access from segger JLink</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/64566/failure-to-eraseall-via-nvmc-access-from-segger-jlink</link><description>I am working on some production scripting and as I want this to be able to run under both windows and linux I have been trying to erase all the NRF52840 using NVMC accesses rather than nrfjprog;. Till now I have always used nrfjprog to do this eraseall</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 11 Aug 2020 11:42:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/64566/failure-to-eraseall-via-nvmc-access-from-segger-jlink" /><item><title>RE: Failure to eraseall via NVMC access from segger JLink</title><link>https://devzone.nordicsemi.com/thread/264024?ContentTypeID=1</link><pubDate>Tue, 11 Aug 2020 11:42:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:898c6a26-bdda-405b-9ee5-67e742fb052b</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This is very unusual. While I&amp;#39;m glad to hear that it worked using the recovery script, it is strange that writing to the NVMC directly didn&amp;#39;t work.&lt;/p&gt;
&lt;p&gt;Have you tried this with different debuggers, and on different computers to see if the behavior is the same?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note: if you&amp;#39;re running it as a script, try adding &amp;quot;sleep 100&amp;quot; before the reset cmd.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure to eraseall via NVMC access from segger JLink</title><link>https://devzone.nordicsemi.com/thread/263885?ContentTypeID=1</link><pubDate>Mon, 10 Aug 2020 15:00:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:489c2486-d194-4b56-ac04-51d892152ce4</guid><dc:creator>OwainIncus</dc:creator><description>&lt;p&gt;Hi Hakon; I ran recovery script on a working unit; it erased fine. But that unit did not erase using the straight NVMC accesses.&lt;br /&gt;&lt;br /&gt;So it looks as if only the accesses to NVMC indirectly via SWD in your recovery script work.&lt;br /&gt;&lt;br /&gt;All effofts to erase via w4 command to NVMC didn&amp;#39;t work either for my one unit playing up or for functional units.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure to eraseall via NVMC access from segger JLink</title><link>https://devzone.nordicsemi.com/thread/263779?ContentTypeID=1</link><pubDate>Mon, 10 Aug 2020 09:45:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9575332-27ca-4dd8-b929-8e34f69f3192</guid><dc:creator>OwainIncus</dc:creator><description>&lt;p&gt;Hi Hakon,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I just tried your recovery script; as you did; &amp;quot;JLinkExe script&amp;quot;.&lt;br /&gt;&lt;br /&gt;So no parameters to say its a nordic device; no connect or anything. Just as you describe.&lt;br /&gt;&lt;br /&gt;J-Link&amp;gt;SWDSelect&lt;br /&gt;Select SWD by sending SWD switching sequence.&lt;br /&gt;J-Link&amp;gt;SWDWriteDP 1 0x5000000&lt;br /&gt;Write DP Register 1 = 0x50000000 ***ERROR&lt;br /&gt;J-Link&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Also tried complete script; the same result.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I just tried start of that sequence on another device that I know is working. On that device the SelectSWD does return the SWD-DP ID.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;What have I done to this one device that I cannot read the SWD-DP ID?&lt;br /&gt;I suppose I must assume I have fried the debug interface on one device?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure to eraseall via NVMC access from segger JLink</title><link>https://devzone.nordicsemi.com/thread/263601?ContentTypeID=1</link><pubDate>Fri, 07 Aug 2020 12:12:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ddc6fdfb-82fe-4b26-af6a-f541c137d7e1</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Could you try the recover script to see if this also behaves similar?&lt;/p&gt;
&lt;p&gt;Store the content to a file, and execute &amp;quot;JLinkExe &amp;lt;file&amp;gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure to eraseall via NVMC access from segger JLink</title><link>https://devzone.nordicsemi.com/thread/263596?ContentTypeID=1</link><pubDate>Fri, 07 Aug 2020 12:01:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af628567-62b1-44b5-b5f8-33e8738ed69f</guid><dc:creator>OwainIncus</dc:creator><description>&lt;p&gt;Same happens with V6.82c running under Linux&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure to eraseall via NVMC access from segger JLink</title><link>https://devzone.nordicsemi.com/thread/263589?ContentTypeID=1</link><pubDate>Fri, 07 Aug 2020 11:46:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e131362d-567a-4e82-9ea3-396f666b9904</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote userid="79387" url="~/f/nordic-q-a/64566/failure-to-eraseall-via-nvmc-access-from-segger-jlink/263588"]Also does your JLink have sepecial &amp;quot;Nordic Semi&amp;quot; firmware on it?&lt;br /&gt;COuld this be the reason?[/quote]
&lt;p&gt;I don&amp;#39;t think this is the reason. Did you try the recover script?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote userid="79387" url="~/f/nordic-q-a/64566/failure-to-eraseall-via-nvmc-access-from-segger-jlink/263586"]SEGGER J-Link Commander V6.70d (Compiled Apr 16 2020 17:57:43)[/quote]
&lt;p&gt;Could you try to update to a newer version of the Segger driver? I&amp;#39;m on v6.80c&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;H&amp;aring;kon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure to eraseall via NVMC access from segger JLink</title><link>https://devzone.nordicsemi.com/thread/263588?ContentTypeID=1</link><pubDate>Fri, 07 Aug 2020 11:44:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5113551-ee21-4df1-8d34-d01975491b9d</guid><dc:creator>OwainIncus</dc:creator><description>&lt;p&gt;Also does your JLink have sepecial &amp;quot;Nordic Semi&amp;quot; firmware on it?&lt;br /&gt;COuld this be the reason?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure to eraseall via NVMC access from segger JLink</title><link>https://devzone.nordicsemi.com/thread/263586?ContentTypeID=1</link><pubDate>Fri, 07 Aug 2020 11:40:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ec22597-db13-4550-8a3a-37a3ed63c76f</guid><dc:creator>OwainIncus</dc:creator><description>&lt;p&gt;Hi&amp;nbsp; Hakon,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Tried sequence; doesn&amp;#39;t work.....&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;SEGGER J-Link Commander V6.70d (Compiled Apr 16 2020 17:57:43)&lt;br /&gt;DLL version V6.70d, compiled Apr 16 2020 17:56:51&lt;/p&gt;
&lt;p&gt;Connecting to J-Link via USB...O.K.&lt;br /&gt;Firmware: J-Link Ultra V4 compiled Jul 17 2020 16:24:36&lt;br /&gt;Hardware version: V4.00&lt;br /&gt;S/N: 504404802&lt;br /&gt;License(s): RDI, FlashBP, FlashDL, JFlash, GDB&lt;br /&gt;VTref=3.311V&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Type &amp;quot;connect&amp;quot; to establish a target connection, &amp;#39;?&amp;#39; for help&lt;br /&gt;J-Link&amp;gt;device NRF52840_xxAA&lt;br /&gt;J-Link&amp;gt;connect&lt;br /&gt;Please specify target interface:&lt;br /&gt; J) JTAG (Default)&lt;br /&gt; S) SWD&lt;br /&gt; T) cJTAG&lt;br /&gt;TIF&amp;gt;s&lt;br /&gt;Specify target interface speed [kHz]. &amp;lt;Default&amp;gt;: 4000 kHz&lt;br /&gt;Speed&amp;gt;&lt;br /&gt;Device &amp;quot;NRF52840_XXAA&amp;quot; selected.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Connecting to target via SWD&lt;br /&gt;InitTarget() start&lt;br /&gt;InitTarget() end&lt;br /&gt;Found SW-DP with ID 0x2BA01477&lt;br /&gt;DPIDR: 0x2BA01477&lt;br /&gt;Scanning AP map to find all available APs&lt;br /&gt;AP[2]: Stopped AP scan as end of AP map has been reached&lt;br /&gt;AP[0]: AHB-AP (IDR: 0x24770011)&lt;br /&gt;AP[1]: JTAG-AP (IDR: 0x02880000)&lt;br /&gt;Iterating through AP map to find AHB-AP to use&lt;br /&gt;AP[0]: Core found&lt;br /&gt;AP[0]: AHB-AP ROM base: 0xE00FF000&lt;br /&gt;CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)&lt;br /&gt;Found Cortex-M4 r0p1, Little endian.&lt;br /&gt;FPUnit: 6 code (BP) slots and 2 literal slots&lt;br /&gt;CoreSight components:&lt;br /&gt;ROMTbl[0] @ E00FF000&lt;br /&gt;ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7&lt;br /&gt;ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT&lt;br /&gt;ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB&lt;br /&gt;ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM&lt;br /&gt;ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU&lt;br /&gt;ROMTbl[0][5]: E0041000, CID: B105900D, PID: 000BB925 ETM&lt;br /&gt;Cortex-M4 identified.&lt;br /&gt;J-Link&amp;gt;h&lt;br /&gt;PC = 00029E42, CycleCnt = 13A74755&lt;br /&gt;R0 = 00000000, R1 = E000E100, R2 = 00000000, R3 = 00000000&lt;br /&gt;R4 = 20001380, R5 = 00001000, R6 = 10001000, R7 = 000FE000&lt;br /&gt;R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000&lt;br /&gt;R12= 2003FDBC&lt;br /&gt;SP(R13)= 2003FEA0, MSP= 2003FEA0, PSP= 00000000, R14(LR) = 00029E1D&lt;br /&gt;XPSR = 61000000: APSR = nZCvq, EPSR = 01000000, IPSR = 000 (NoException)&lt;br /&gt;CFBP = 04000000, CONTROL = 04, FAULTMASK = 00, BASEPRI = 00, PRIMASK = 00&lt;/p&gt;
&lt;p&gt;FPS0 = 41C80000, FPS1 = 00000000, FPS2 = 00000000, FPS3 = 00000000&lt;br /&gt;FPS4 = 00000000, FPS5 = 00000000, FPS6 = 00000000, FPS7 = 00000000&lt;br /&gt;FPS8 = 00000000, FPS9 = 00000000, FPS10= 00000000, FPS11= 00000000&lt;br /&gt;FPS12= 00000000, FPS13= 41C80000, FPS14= 00000000, FPS15= 00000000&lt;br /&gt;FPS16= 00000000, FPS17= 00000000, FPS18= 00000000, FPS19= 00000000&lt;br /&gt;FPS20= 00000000, FPS21= 00000000, FPS22= 00000000, FPS23= 00000000&lt;br /&gt;FPS24= 00000000, FPS25= 00000000, FPS26= 00000000, FPS27= 00000000&lt;br /&gt;FPS28= 00000000, FPS29= 00000000, FPS30= 00000000, FPS31= 00000000&lt;br /&gt;FPSCR= 00000000&lt;br /&gt;J-Link&amp;gt;mem 0,4&lt;br /&gt;00000000 = 00 04 00 20 ...&lt;br /&gt;J-Link&amp;gt;w4 4001e504 2&lt;br /&gt;Writing 00000002 -&amp;gt; 4001E504&lt;br /&gt;J-Link&amp;gt;w4 4001e50c 1&lt;br /&gt;Writing 00000001 -&amp;gt; 4001E50C&lt;br /&gt;J-Link&amp;gt;r&lt;br /&gt;Reset delay: 0 ms&lt;br /&gt;Reset type NORMAL: Resets core &amp;amp; peripherals via SYSRESETREQ &amp;amp; VECTRESET bit.&lt;br /&gt;Reset: Halt core after reset via DEMCR.VC_CORERESET.&lt;br /&gt;Reset: Reset device via AIRCR.SYSRESETREQ.&lt;br /&gt;J-Link&amp;gt;mem 0, 4&lt;br /&gt;00000000 = 00 04 00 20 ...&lt;br /&gt;J-Link&amp;gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure to eraseall via NVMC access from segger JLink</title><link>https://devzone.nordicsemi.com/thread/263559?ContentTypeID=1</link><pubDate>Fri, 07 Aug 2020 09:37:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb3e337a-aaf4-456d-a717-6053ec311ffe</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This sequence should work:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;halt
w4 4001e504 2
w4 4001e50c 1
r&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s my JLink Commander screenshot of the progress:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-38271773bad8425b9a88f5f6174d504b/pastedimage1596790623934v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;An alternative is to run the &amp;quot;recover&amp;quot; mechanism, which is for nrf9160, posted here:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/60813/nrf9160-ctrl-ap-access-using-j-link-commander-gdb"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/60813/nrf9160-ctrl-ap-access-using-j-link-commander-gdb&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is the &amp;quot;ported&amp;quot; to nRF52 (Access port only changed) :&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;SWDSelect   // Activate SWD
SWDWriteDP 1 0x50000000  // Enable debug power
SWDWriteDP 2 0x01000000  // Selects the 0x01XXXXXX Access Port and 0xXXXX00XX Register bank in the access port
SWDWriteAP 1 0x00000001  // CTRL-AP Bank 0, register offset 1 (ERASEALL 0x004): Erase all command

SWDReadAP 2 // CTRL-AP Bank 0, register offset 2 (ERASEALLSTATUS 0x008): Erase all command status
SWDReadAP 2 // Must read twice to get the value.

// Wait a good amount of time, so eraseall process is done.
sleep 500

// Perform a pin reset
r0
sleep 10
r1
sleep 10

SWDSelect   // Activate SWD
SWDWriteDP 1 0x50000000  // Enable debug power
SWDWriteDP 2 0x01000000  // Selects the 0x01XXXXXX Access Port and 0xXXXX00XX Register bank in the access port

SWDReadAP 3 // CTRL-AP Bank 0, register offset 3 (APPROTECTSTATUS 0x00C): Access port protection status
SWDReadAP 3 // //Second read returns the value: 0: enabled 1: not enabled

exit&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s a screenshot of the above recover script sequence (note: device is power cycled after nrfjprog --rbp is called):&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-38271773bad8425b9a88f5f6174d504b/pastedimage1596793014889v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/12484/approtect-and-dap"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure to eraseall via NVMC access from segger JLink</title><link>https://devzone.nordicsemi.com/thread/263477?ContentTypeID=1</link><pubDate>Thu, 06 Aug 2020 14:56:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9fda58de-2b1d-4036-b5ea-18aca23fb04a</guid><dc:creator>OwainIncus</dc:creator><description>&lt;p&gt;I also found this and have tried it; same result. My device does the NVMC writes; but then resets and runs. Device has not been erased.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://github.com/ssfrr/nrfjprog.sh"&gt;https://github.com/ssfrr/nrfjprog.sh&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Whats going on? NRF52840 does not support some kind of protection I must turn off?&lt;br /&gt;Dual bank?&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></channel></rss>