<?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>Failed to erase flash for nRF5340</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/62925/failed-to-erase-flash-for-nrf5340</link><description>Hi, 
 I was trying to program my sample to nRF5340&amp;#39;s flash using nRF connect v3.4.1 and got this problem: 
 
 21:06:02.948 
 Application data folder: C:\Users\tuan.duong\AppData\Roaming\nrfconnect\pc-nrfconnect-programmer 
 
 
 21:06:03.113 
 Using nrfjprog</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 26 Jun 2020 10:30:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/62925/failed-to-erase-flash-for-nrf5340" /><item><title>RE: Failed to erase flash for nRF5340</title><link>https://devzone.nordicsemi.com/thread/257093?ContentTypeID=1</link><pubDate>Fri, 26 Jun 2020 10:30:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:01272001-c37d-4e37-9760-dd96ea40c1bd</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I see. Then there is another problem, but I have no good suggestions on what the problem could be. Did this suddenly happen, or has the board always been like this?&lt;/p&gt;
&lt;p&gt;Just for reference, this shows the sequence of protecting and recovering the application core, including testing that both works:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;gt;nrfjprog.exe --coprocessor CP_APPLICATION --memrd 0x00FF8000
0x00FF8000: FFFFFFFF                              |....|

&amp;gt;nrfjprog.exe --coprocessor CP_APPLICATION --memwr 0x00FF8000 --val 0x00000000
Parsing parameters.
Writing.

&amp;gt;nrfjprog.exe --coprocessor CP_APPLICATION --memrd 0x00FF8000
0x00FF8000: 00000000                              |....|

&amp;lt;Reset board to make UICR changes take effect&amp;gt;

&amp;gt;nrfjprog.exe --coprocessor CP_APPLICATION --memrd 0x00FF8000
ERROR: The operation attempted is unavailable due to readback protection in
ERROR: your device. Please use --recover to unlock the device.

&amp;gt;nrfjprog.exe --coprocessor CP_APPLICATION --recover
Recovering device. This operation might take 30s.
Erasing user code and UICR flash areas.

&amp;gt;nrfjprog.exe --coprocessor CP_APPLICATION --memrd 0x00FF8000
0x00FF8000: FFFFFFFF                              |....|&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to erase flash for nRF5340</title><link>https://devzone.nordicsemi.com/thread/256854?ContentTypeID=1</link><pubDate>Thu, 25 Jun 2020 09:37:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09005c61-8e85-4bfd-8f1f-7095e4f21296</guid><dc:creator>Duong</dc:creator><description>&lt;p&gt;Hi Einar Thorsrud,&lt;/p&gt;
&lt;p&gt;It doesn&amp;#39;t help much even with the latest version of nrfjprog 10.9.0.&lt;/p&gt;
&lt;p&gt;C:\Program Files\Nordic Semiconductor\nrf-command-line-tools\bin&amp;gt;nrfjprog -v&lt;br /&gt;nrfjprog version: 10.9.0&lt;br /&gt;JLinkARM.dll version: 6.80a&lt;/p&gt;
&lt;p&gt;C:\Program Files\Nordic Semiconductor\nrf-command-line-tools\bin&amp;gt;nrfjprog.exe --coprocessor CP_NETWORK --recover&lt;br /&gt;Failed to enable coprocessor with unknown error.&lt;br /&gt;ERROR: Access to the selected address is blocked by the SPU.&lt;/p&gt;
&lt;p&gt;C:\Program Files\Nordic Semiconductor\nrf-command-line-tools\bin&amp;gt;nrfjprog.exe --coprocessor CP_APPLICATION --recover&lt;br /&gt;Recovering device. This operation might take 30s.&lt;br /&gt;ERROR: Recover failed. Please make sure that the correct device family is given&lt;br /&gt;ERROR: and try again.&lt;/p&gt;
&lt;p&gt;C:\Program Files\Nordic Semiconductor\nrf-command-line-tools\bin&amp;gt;nrfjprog.exe -f NRF53 --recover&lt;br /&gt;Recovering device. This operation might take 30s.&lt;br /&gt;ERROR: Recover failed. Please make sure that the correct device family is given&lt;br /&gt;ERROR: and try again.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Any idea?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you and regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to erase flash for nRF5340</title><link>https://devzone.nordicsemi.com/thread/256843?ContentTypeID=1</link><pubDate>Thu, 25 Jun 2020 08:56:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05077d16-a4ce-4daa-be2c-978e68ca2020</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="Duong"]Which version of nrfjprog you are using? Mine is 9.5.0[/quote]
&lt;p&gt;Ah, that is relevant. Your nrfjprog is too old. Please update to the latest (10.9.0) by installing the latest &lt;a href="https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Command-Line-Tools/Download"&gt;nRF Command Line Tools&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to erase flash for nRF5340</title><link>https://devzone.nordicsemi.com/thread/256785?ContentTypeID=1</link><pubDate>Wed, 24 Jun 2020 23:25:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18ff0462-423d-43ff-87e6-35187f2f96da</guid><dc:creator>Duong</dc:creator><description>&lt;p&gt;Hi Einar Thorsrud,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for your suggestion. Which version of nrfjprog you are using? Mine is 9.5.0 and it seems does not have --coprocessor option. Anyway, I tried with --recover option alone and still have the problem. Here is the log.&lt;/p&gt;
&lt;p&gt;nrfjprog --recover --log&lt;br /&gt;nrfjprog verion 8.5.0&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;FUNCTION: open_dll.&lt;br /&gt;FUNCTION: open_dll.&lt;br /&gt;FUNCTION: enum_emu_snr.&lt;br /&gt;FUNCTION: enum_emu_snr.&lt;br /&gt;FUNCTION: enum_emu_snr.&lt;br /&gt;FUNCTION: enum_emu_snr.&lt;br /&gt;FUNCTION: connect_to_emu_with_snr.&lt;br /&gt;FUNCTION: connect_to_emu_with_snr.&lt;br /&gt;FUNCTION: connect_to_emu_without_snr.&lt;br /&gt;FUNCTION: enum_emu_snr.&lt;br /&gt;Device &amp;quot;NRF51822_XXAA&amp;quot; selected.&lt;br /&gt;FUNCTION: recover.&lt;br /&gt;FUNCTION: recover.&lt;br /&gt;Debugger tries to select target interface JTAG.&lt;br /&gt;This interface is not supported by the connected emulator.&lt;br /&gt;Selection will be ignored by the DLL.&lt;br /&gt;Found SW-DP with ID 0x6BA02477&lt;br /&gt;DPIDR: 0x6BA02477&lt;br /&gt;Scanning AP map to find all available APs&lt;br /&gt;AP[4]: Stopped AP scan as end of AP map has been reached&lt;br /&gt;AP[0]: AHB-AP (IDR: 0x84770001)&lt;br /&gt;AP[1]: AHB-AP (IDR: 0x84770001)&lt;br /&gt;AP[2]: JTAG-AP (IDR: 0x12880000)&lt;br /&gt;AP[3]: JTAG-AP (IDR: 0x12880000)&lt;br /&gt;Iterating through AP map to find AHB-AP to use&lt;br /&gt;AP[0]: Skipped. Could not read CPUID register&lt;br /&gt;AP[1]: Core found&lt;br /&gt;AP[1]: AHB-AP ROM base: 0xE00FF000&lt;br /&gt;CPUID register: 0x410FD214. Implementer code: 0x41 (ARM)&lt;br /&gt;Found Cortex-M33 r0p4, Little endian.&lt;br /&gt;Identified core does not match configuration. (Found: Cortex-M33, Configured: Cortex-M0)&lt;br /&gt;FPUnit: 8 code (BP) slots and 0 literal slots&lt;br /&gt;Security extension: not implemented&lt;br /&gt;CoreSight components:&lt;br /&gt;ROMTbl[0] @ E00FF000&lt;br /&gt;ROMTbl[0][0]: E000E000, CID: B105900D, PID: 000BBD21 Cortex-M33&lt;br /&gt;ROMTbl[0][1]: E0001000, CID: B105900D, PID: 000BBD21 DWT&lt;br /&gt;ROMTbl[0][2]: E0002000, CID: B105900D, PID: 000BBD21 FPB&lt;br /&gt;ROMTbl[0][6]: E0042000, CID: B105900D, PID: 000BBD21 CTI&lt;br /&gt;RBPCONF register indicates that the device is secured.&lt;br /&gt;For accessing memory the device needs to be unsecured.&lt;br /&gt;Note: Unsecuring will trigger a mass erase of the internal flash.&lt;/p&gt;
&lt;p&gt;Executing default behavior previously saved in the registry.&lt;br /&gt;Device will be unsecured now.&lt;br /&gt;CPU could not be halted&lt;br /&gt;CPU could not be halted&lt;br /&gt;JLinkARM.dll Halt returned error 1.&lt;br /&gt;Debugger tries to select target interface JTAG.&lt;br /&gt;This interface is not supported by the connected emulator.&lt;br /&gt;Selection will be ignored by the DLL.&lt;br /&gt;CPU could not be halted&lt;br /&gt;JLinkARM.dll Halt returned error 1.&lt;br /&gt;Debugger tries to select target interface JTAG.&lt;br /&gt;This interface is not supported by the connected emulator.&lt;br /&gt;Selection will be ignored by the DLL.&lt;br /&gt;CPU could not be halted&lt;br /&gt;JLinkARM.dll Halt returned error 1.&lt;br /&gt;Debugger tries to select target interface JTAG.&lt;br /&gt;This interface is not supported by the connected emulator.&lt;br /&gt;Selection will be ignored by the DLL.&lt;br /&gt;CPU could not be halted&lt;br /&gt;JLinkARM.dll Halt returned error 1.&lt;br /&gt;Debugger tries to select target interface JTAG.&lt;br /&gt;This interface is not supported by the connected emulator.&lt;br /&gt;Selection will be ignored by the DLL.&lt;br /&gt;CPU could not be halted&lt;br /&gt;JLinkARM.dll Halt returned error 1.&lt;br /&gt;Debugger tries to select target interface JTAG.&lt;br /&gt;This interface is not supported by the connected emulator.&lt;br /&gt;Selection will be ignored by the DLL.&lt;br /&gt;CPU could not be halted&lt;br /&gt;JLinkARM.dll Halt returned error 1.&lt;br /&gt;Debugger tries to select target interface JTAG.&lt;br /&gt;This interface is not supported by the connected emulator.&lt;br /&gt;Selection will be ignored by the DLL.&lt;br /&gt;CPU could not be halted&lt;br /&gt;JLinkARM.dll Halt returned error 1.&lt;br /&gt;Debugger tries to select target interface JTAG.&lt;br /&gt;This interface is not supported by the connected emulator.&lt;br /&gt;Selection will be ignored by the DLL.&lt;br /&gt;CPU could not be halted&lt;br /&gt;JLinkARM.dll Halt returned error 1.&lt;br /&gt;Debugger tries to select target interface JTAG.&lt;br /&gt;This interface is not supported by the connected emulator.&lt;br /&gt;Selection will be ignored by the DLL.&lt;br /&gt;CPU could not be halted&lt;br /&gt;JLinkARM.dll Halt returned error 1.&lt;br /&gt;Debugger tries to select target interface JTAG.&lt;br /&gt;This interface is not supported by the connected emulator.&lt;br /&gt;Selection will be ignored by the DLL.&lt;br /&gt;CPU could not be halted&lt;br /&gt;JLinkARM.dll Halt returned error 1.&lt;br /&gt;Debugger tries to select target interface JTAG.&lt;br /&gt;This interface is not supported by the connected emulator.&lt;br /&gt;Selection will be ignored by the DLL.&lt;br /&gt;CPU could not be halted&lt;br /&gt;JLinkARM.dll Halt returned error 1.&lt;br /&gt;Debugger tries to select target interface JTAG.&lt;br /&gt;This interface is not supported by the connected emulator.&lt;br /&gt;Selection will be ignored by the DLL.&lt;br /&gt;CPU could not be halted&lt;br /&gt;JLinkARM.dll Halt returned error 1.&lt;br /&gt;Debugger tries to select target interface JTAG.&lt;br /&gt;This interface is not supported by the connected emulator.&lt;br /&gt;Selection will be ignored by the DLL.&lt;br /&gt;CPU could not be halted&lt;br /&gt;JLinkARM.dll Halt returned error 1.&lt;br /&gt;Debugger tries to select target interface JTAG.&lt;br /&gt;This interface is not supported by the connected emulator.&lt;br /&gt;Selection will be ignored by the DLL.&lt;br /&gt;CPU could not be halted&lt;br /&gt;JLinkARM.dll Halt returned error 1.&lt;br /&gt;Debugger tries to select target interface JTAG.&lt;br /&gt;This interface is not supported by the connected emulator.&lt;br /&gt;Selection will be ignored by the DLL.&lt;br /&gt;CPU could not be halted&lt;br /&gt;JLinkARM.dll Halt returned error 1.&lt;br /&gt;Debugger tries to select target interface JTAG.&lt;br /&gt;This interface is not supported by the connected emulator.&lt;br /&gt;Selection will be ignored by the DLL.&lt;br /&gt;CPU could not be halted&lt;br /&gt;JLinkARM.dll Halt returned error 1.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Do you have any idea what cause this problem and any solution to fix it?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks and regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to erase flash for nRF5340</title><link>https://devzone.nordicsemi.com/thread/256721?ContentTypeID=1</link><pubDate>Wed, 24 Jun 2020 13:48:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68a72d47-b6de-4149-8937-9eaff9b65f9f</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I would not have expected this. Can you try to run the following two commands:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrfjprog.exe --coprocessor CP_NETWORK --recover
nrfjprog.exe --coprocessor CP_APPLICATION --recover&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Does that help? Or do you get an error in this case as well?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>