<?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>nrf52 cannot exit from Debug Interface Mode</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/45441/nrf52-cannot-exit-from-debug-interface-mode</link><description>We are using device nrf52840 with sdk 15.0.0 
 The problem is: High current consumption, typically around 2 mA. But over time drifts up to 9 mA in a period of 12 hrs. 
 
 1.- How to know the MCU is in Debug Interface Mode from code? 
 I have not found</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 28 Mar 2019 21:39:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/45441/nrf52-cannot-exit-from-debug-interface-mode" /><item><title>RE: nrf52 cannot exit from Debug Interface Mode</title><link>https://devzone.nordicsemi.com/thread/179074?ContentTypeID=1</link><pubDate>Thu, 28 Mar 2019 21:39:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:37aa5418-48fd-4941-bcc5-a029c00073d7</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;Byt experience, I found that the 2mA is usually caused by the jtag being connected. &amp;nbsp;The 9mA is usually caused by cpu running at 100%. &amp;nbsp; Use the Otii to measure the current is it more accurate. &amp;nbsp;Remove the jtag and have the Otii power your device. &amp;nbsp;&lt;a href="https://www.qoitech.com"&gt;https://www.qoitech.com&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 cannot exit from Debug Interface Mode</title><link>https://devzone.nordicsemi.com/thread/179065?ContentTypeID=1</link><pubDate>Thu, 28 Mar 2019 19:19:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a544ed0a-b335-4dbc-8f54-022d21ea25fe</guid><dc:creator>Israel</dc:creator><description>&lt;p&gt;I was looking into this too. But i am certain this is not the issue. &lt;br /&gt;We have a &amp;quot;devlog&amp;quot; so we save to the data flash what the processor is doing, things such as button press or changes in power modes. The devlog indicates that the device went to &amp;quot;low battery warning&amp;quot; and then to&amp;quot; low battery shutdown&amp;quot; which is the nrf52 SYSTEM_OFF mode. So the program was running as usual, any I2C or SPI block would not allow to communicate with sensors or flash device. which in case we also log into flash any sensor communication error.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 cannot exit from Debug Interface Mode</title><link>https://devzone.nordicsemi.com/thread/178812?ContentTypeID=1</link><pubDate>Thu, 28 Mar 2019 01:36:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7a8d54a-576a-4d23-8a35-ddb3b073ba5f</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;Looks like intermittently your firmware got stuck in a while loop. &amp;nbsp;Look to see if you are not stuck in the i2c loop waiting for an event for example.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 cannot exit from Debug Interface Mode</title><link>https://devzone.nordicsemi.com/thread/178798?ContentTypeID=1</link><pubDate>Wed, 27 Mar 2019 21:59:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9087abae-a01e-40ae-b4f9-5f63ae08d2e3</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;One somewhat &amp;quot;interesting&amp;quot; way to detect this is that code continues to run &lt;em&gt;after&lt;/em&gt; trying to go into System OFF mode. Execution stops when not in debug mode (and the chip needs pin wakeup that causes reset).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The JLINK command won&amp;#39;t require additional hardware when you already have SWD.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 cannot exit from Debug Interface Mode</title><link>https://devzone.nordicsemi.com/thread/178788?ContentTypeID=1</link><pubDate>Wed, 27 Mar 2019 19:51:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f148444-9fec-490a-9be3-174dab61d0df</guid><dc:creator>Israel</dc:creator><description>&lt;p&gt;Thank you, I was afraid of this, We might need to implement a way to shut our power supply for a moment in the event we detect high power consumption. However this requires adding cost to the BOM, and it also needs question #1 to be answered.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 cannot exit from Debug Interface Mode</title><link>https://devzone.nordicsemi.com/thread/178785?ContentTypeID=1</link><pubDate>Wed, 27 Mar 2019 19:31:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26291db1-e37b-4cd5-bb2f-e6593439ffb3</guid><dc:creator>Turbo J</dc:creator><description>[quote userid="78462" url="~/f/nordic-q-a/45441/nrf52-cannot-exit-from-debug-interface-mode"]2.- I need a reliable way to get the&amp;nbsp;MCU out of Debug Interface Mode from code. (In&amp;nbsp;my scenario we don&amp;#39;t have means to power cycle it).[/quote]
&lt;p&gt;There is none. The required debug registers are only writeable from SWD, but not from the MCU core.&lt;/p&gt;
&lt;p&gt;The only other way to disable the debug mode is to *completely* remove power after programming (via SWD) or debugging the chip.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;EDIT: When the JLink debugger is still connected, the debug mode can be turned off with the jlink commander using the command &amp;quot;writeDP 1 0&amp;quot;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>