<?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>Can&amp;#39;t flash nrf5340 via SWD</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/128877/can-t-flash-nrf5340-via-swd</link><description>Hello, 
 I am having trouble programming the nrf5340 chip using SWD. 
 Set up: 
 Custom hardware with the MDBT53V-1M module from Raytac, nrf5340 chip. 
 SWD, using J-Link EDU mini. 
 Problem scenario: was able to flash the code to the chip at first. Then</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 05 Aug 2026 16:23:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/128877/can-t-flash-nrf5340-via-swd" /><item><title>RE: Can't flash nrf5340 via SWD</title><link>https://devzone.nordicsemi.com/thread/569939?ContentTypeID=1</link><pubDate>Wed, 05 Aug 2026 16:23:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ae5aa67-6e4a-40a0-892a-39766eb2331b</guid><dc:creator>PjGlasso</dc:creator><description>&lt;p&gt;Hi there,&lt;/p&gt;
&lt;p&gt;SO may be the case that ;&lt;/p&gt;
&lt;h3 id="mcetoc_1jv9b8fll0" data-path-to-node="0"&gt;How to Access and Recover the Bricked Devices&lt;/h3&gt;
&lt;p data-path-to-node="1"&gt;When DC/DC power converters are enabled in software on a board that lacks the required LC filter components (inductors and capacitors), the power management unit (REG1/REG2) fails to regulate voltage. This drops the core voltage below operational thresholds, putting the MCU into a brownout state where the standard SWD debug interface shuts down instantly after reset.&lt;/p&gt;
&lt;p data-path-to-node="2"&gt;To regain access, the SWD debug port must halt the CPU core before the application firmware executes the code that enables the DC/DC converters:&lt;/p&gt;
&lt;ol start="1" data-path-to-node="3"&gt;
&lt;li&gt;
&lt;p data-path-to-node="3,0,0"&gt;&lt;b data-path-to-node="3,0,0" data-index-in-node="0"&gt;Hardware Force-Reset Sequence (Under Reset Connection):&lt;/b&gt;&lt;/p&gt;
&lt;ul data-path-to-node="3,0,1"&gt;
&lt;li&gt;
&lt;p data-path-to-node="3,0,1,0,0"&gt;Connect the &lt;b data-path-to-node="3,0,1,0,0" data-index-in-node="12"&gt;nRESET&lt;/b&gt; line from your debugger (J-Link) to the target board&amp;#39;s reset pin.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p data-path-to-node="3,0,1,1,0"&gt;Open &lt;b data-path-to-node="3,0,1,1,0" data-index-in-node="5"&gt;J-Link Commander&lt;/b&gt; (&lt;code data-path-to-node="3,0,1,1,0" data-index-in-node="23"&gt;JLink.exe&lt;/code&gt;) and configure the target device (&lt;code data-path-to-node="3,0,1,1,0" data-index-in-node="67"&gt;nRF5340_XXAA_APP&lt;/code&gt; or &lt;code data-path-to-node="3,0,1,1,0" data-index-in-node="87"&gt;nRF5340_XXAA_NET&lt;/code&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p data-path-to-node="3,0,1,2,0"&gt;Execute:&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;device nRF5340_XXAA_APP
si SWD
speed 4000
connect&lt;/pre&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p data-path-to-node="3,0,1,3,0"&gt;Select &lt;b data-path-to-node="3,0,1,3,0" data-index-in-node="7"&gt;Connect Under Reset&lt;/b&gt; (or issue &lt;code data-path-to-node="3,0,1,3,0" data-index-in-node="37"&gt;r&lt;/code&gt; followed immediately by &lt;code data-path-to-node="3,0,1,3,0" data-index-in-node="63"&gt;h&lt;/code&gt; / &lt;code data-path-to-node="3,0,1,3,0" data-index-in-node="67"&gt;halt&lt;/code&gt; in command mode) to freeze the CPU at address &lt;code data-path-to-node="3,0,1,3,0" data-index-in-node="118"&gt;0x00000000&lt;/code&gt; before the Zephyr boot initialization code runs.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p data-path-to-node="3,0,1,4,0"&gt;Once halted, issue an erase command: ERASE&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You can also do something similar in nRFjprog too.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;br /&gt;nrfjprog --recover -f nrf53 --coprocessor CP_APPLICATION&lt;br /&gt;nrfjprog --recover -f nrf53 --coprocessor CP_NETWORK&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;OK&lt;/p&gt;
&lt;h3 id="mcetoc_1jv9bkr531" data-path-to-node="5"&gt;How to Prevent the Issue in Future Builds&lt;/h3&gt;
&lt;p data-path-to-node="6"&gt;To permanently fix this on custom hardware that uses &lt;b data-path-to-node="6" data-index-in-node="53"&gt;LDO mode&lt;/b&gt; (without external inductors), disable the DC/DC regulators in your project&amp;#39;s Kconfig:&lt;/p&gt;
&lt;ol start="1" data-path-to-node="7"&gt;
&lt;li&gt;
&lt;p data-path-to-node="7,0,0"&gt;&lt;b data-path-to-node="7,0,0" data-index-in-node="0"&gt;Disable DC/DC Regulators in &lt;code data-path-to-node="7,0,0" data-index-in-node="28"&gt;prj.conf&lt;/code&gt;:&lt;/b&gt; Add these configurations to your application&amp;#39;s &lt;code data-path-to-node="7,0,0" data-index-in-node="85"&gt;prj.conf&lt;/code&gt; file to force the MCU to use the internal Low-DropOut (LDO) regulators for both application and network cores:&lt;/p&gt;
&lt;pre class="ui-code" data-mode="text"&gt;# Disable DC/DC converters (Forces LDO mode)
CONFIG_BOARD_ENABLE_DCDC_APP=n
CONFIG_BOARD_ENABLE_DCDC_NET=n
CONFIG_BOARD_ENABLE_DCDC_HV=n&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;&lt;b data-path-to-node="7,1,0" data-index-in-node="0"&gt;Define a Custom Board Definition:&lt;/b&gt; If you build custom nRF5340 hardware regularly, create a dedicated board overlay or custom board target in the nRF Connect SDK rather than building using standard DK targets (&lt;code data-path-to-node="7,1,0" data-index-in-node="209"&gt;nrf5340dk_nrf5340_cpuapp&lt;/code&gt;), as standard DK target configurations turn DC/DC modes on by default.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;HTH&lt;/p&gt;
&lt;p&gt;GL :-) PJ :v:&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't flash nrf5340 via SWD</title><link>https://devzone.nordicsemi.com/thread/569932?ContentTypeID=1</link><pubDate>Wed, 05 Aug 2026 15:48:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b5edb74-6531-4412-8587-199569dc9cbe</guid><dc:creator>Ayush0</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have checked the soldering and it seems fine to me.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We are at a developing stage so only have three units.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have seen this problem in two units.&lt;/p&gt;
&lt;p&gt;On the third unit, I have not flashed any code yet, but I am able to ping it using&amp;nbsp;&amp;nbsp;the &amp;quot;connect&amp;quot; command on the J-Link Commander. I don&amp;#39;t want to flash any code yet on the third board.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What could be the root cause of the problem ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;My modules have been set up in LDO mode and have no inductors to run DC DC mode.&lt;/p&gt;
&lt;p&gt;I have been uploading the sample &amp;quot;blinky&amp;quot; and &amp;quot;blinky_pwm&amp;quot; code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could it be that these sample code enable the DC DC mode, which then causes the MCU to be stuck in DC DC mode forever, hence not allowing to be programmed again ?&lt;/p&gt;
&lt;p&gt;If you can 100% confirm this is the case then I can flash the third board with a completely blank code and not use the sample code, and see if I get the same problem.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank You&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Ayush&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't flash nrf5340 via SWD</title><link>https://devzone.nordicsemi.com/thread/569926?ContentTypeID=1</link><pubDate>Wed, 05 Aug 2026 13:48:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52ea6055-2ffe-4950-8618-424581def9c6</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Ayush,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you for confirming.&lt;/p&gt;
&lt;p&gt;Since you are using a custom board, with a module; have you double-checked the soldering of the board/module? Do you have many devices manufactured that exhibit this issue, or is it only one?&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: Can't flash nrf5340 via SWD</title><link>https://devzone.nordicsemi.com/thread/569912?ContentTypeID=1</link><pubDate>Wed, 05 Aug 2026 09:26:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:932a5c60-a5f5-4e9a-a4c1-ee8fa5df5f35</guid><dc:creator>Ayush0</dc:creator><description>&lt;p&gt;Hi Hakon,&lt;/p&gt;
&lt;p&gt;Tried running the batch script and switching the nRF On/ Off multiple times but still no luck.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Any other suggestions.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank You for your time.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Ayush&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't flash nrf5340 via SWD</title><link>https://devzone.nordicsemi.com/thread/569908?ContentTypeID=1</link><pubDate>Wed, 05 Aug 2026 08:43:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e20fcbf7-c0a7-4e70-b289-e5d71329c13f</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Ayush,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you run the two recover commands in a looped batch script:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;:loop
nrfjprog --recover -f nrf53 --coprocessor CP_NETWORK
nrfjprog --recover -f nrf53 --coprocessor CP_APPLICATION
goto loop&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;While you power on/off your nRF, are you then able to recover it?&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: Can't flash nrf5340 via SWD</title><link>https://devzone.nordicsemi.com/thread/569907?ContentTypeID=1</link><pubDate>Wed, 05 Aug 2026 08:01:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eca8640b-3170-45dd-b4f4-49bb3f036b1b</guid><dc:creator>Ayush0</dc:creator><description>&lt;p&gt;Hi Hakon,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have tried both, but still no luck.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank You&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Ayush&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't flash nrf5340 via SWD</title><link>https://devzone.nordicsemi.com/thread/569856?ContentTypeID=1</link><pubDate>Tue, 04 Aug 2026 11:18:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:406dda3e-ddb9-40ea-9b8a-933590a32061</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;In order to recover the nRF5340 in nrfjprog, you should set the family flag, and try to address each core manually:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrfjprog --recover -f nrf53 --coprocessor CP_NETWORK
nrfjprog --recover -f nrf53 --coprocessor CP_APPLICATION&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If this still does not successfully recover the device, could you try the sequence outlined here?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/128868/unable-to-flash-or-erase-nrf9151-sma-dk-via-j-link-setting-the-debug-port-select-register-failed-error/569837"&gt;RE: Unable to flash or erase nRF9151 SMA DK via J-Link (&amp;quot;Setting the debug port SELECT register failed&amp;quot; error)&lt;/a&gt;&amp;nbsp;&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></channel></rss>