<?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>The device app doesn&amp;#39;t work with dc adapter or battery, only work with pc, debugger</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/57707/the-device-app-doesn-t-work-with-dc-adapter-or-battery-only-work-with-pc-debugger</link><description>Hi Devzone! 
 
 The development is in the final stage and is now testing by connecting the dc adapter or battery, not by connecting the pc cable and the debugger. However, when connected to the dc adapter or battery, it was discovered that it no longer</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 17 Feb 2020 07:53:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/57707/the-device-app-doesn-t-work-with-dc-adapter-or-battery-only-work-with-pc-debugger" /><item><title>RE: The device app doesn't work with dc adapter or battery, only work with pc, debugger</title><link>https://devzone.nordicsemi.com/thread/234556?ContentTypeID=1</link><pubDate>Mon, 17 Feb 2020 07:53:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9dd6e1af-c775-48cc-a804-1daa5e5c0d81</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;The chip will stay in normal mode until you connect the debugger (ie start a debug session/ view RTT log), and it should automatically exit debug mode when you stop debugging.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The device app doesn't work with dc adapter or battery, only work with pc, debugger</title><link>https://devzone.nordicsemi.com/thread/234418?ContentTypeID=1</link><pubDate>Fri, 14 Feb 2020 13:17:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dec98538-13fa-454e-944f-ba620189b12b</guid><dc:creator>zester926</dc:creator><description>&lt;p&gt;Thank you for information it helps a lot.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Then Is it enter the normal or release mode automatically if I connet it with dc adapter or battery not with RTT or SES?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The device app doesn't work with dc adapter or battery, only work with pc, debugger</title><link>https://devzone.nordicsemi.com/thread/234405?ContentTypeID=1</link><pubDate>Fri, 14 Feb 2020 12:47:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd66ec98-9d9b-4434-bb34-9f8c769d66ef</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Did you have &lt;span&gt;NRF_LOG_BACKEND_UART enabled as well? This backend may become blocking in some case as you can see discussed in this thread: &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/57536/freeze-in-nrf_bootloader_app_start-on-nrf_log_flush"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/57536/freeze-in-nrf_bootloader_app_start-on-nrf_log_flush&lt;/a&gt; &lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
[quote user="zester926"]and I heard that If the device is in debug mode It spends a lot of current.[/quote]
&lt;p&gt;Yes, the chip doesn&amp;#39;t enter the low power modes when the debug interface is enabled. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The device app doesn't work with dc adapter or battery, only work with pc, debugger</title><link>https://devzone.nordicsemi.com/thread/234354?ContentTypeID=1</link><pubDate>Fri, 14 Feb 2020 09:59:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d733111-3c95-453d-addf-3e97629ec11c</guid><dc:creator>zester926</dc:creator><description>&lt;p&gt;Hi Vidar!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/57707/the-device-app-doesn-t-work-with-dc-adapter-or-battery-only-work-with-pc-debugger/233947"]1. Check if it works with if you comment out the call to &amp;#39;idle_state_handle&amp;#39; in your main loop.[/quote]
&lt;p&gt;When I comment out the call to &amp;#39;idle_state_handle&amp;#39;, the results were the same. It stopped after the first call of &amp;#39;&lt;span&gt;iis2dlpc_flag_data_ready_get(&amp;amp;dev_ctx)&amp;#39;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/57707/the-device-app-doesn-t-work-with-dc-adapter-or-battery-only-work-with-pc-debugger/233947"]2. Keep the USB connected, but don&amp;#39;t start RTT logging or anything else that enables the debug interface until the program has stopped functioning. Once that happens you can run &amp;quot;nrfjprog --readregs&amp;quot; to read out the CPU registers.[/quote]
&lt;p&gt;As you mentioned, when the program has stopped functioning I run nrfjprog --readregs.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;And I could find this output.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/6242._A1CE98CC_2.PNG" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;the program counter was 0x00035482 and it is the address of delay_machine_code.9933&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/8484._A1CE98CC_3.PNG" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;I thought it is little strange, so did it again, and I found this output.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/5153._A1CE98CC_4.PNG" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;The program counter was 0x00030020, and it is the address of SEGGER_RTT.c&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/2022._A1CE98CC_5.PNG" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;So I checked the call stack. and the error came from NRF_LOG_FLUSH() which is inside of&amp;nbsp; &amp;#39;platform_read()&amp;#39; of &amp;#39;iis2dlpc_flag_data_ready_get(&amp;amp;dev_ctx)&amp;#39;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/0044._A1CE98CC_6.PNG" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;So, I unenabled NRF_LOG_BACKEND_RTT, NRF_LOG and NRF_LOG_DEFERRED&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;And then finally, It works with no error.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/4760._A1CE98CC_9.PNG" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;But, I still wonder that it is right way. I don&amp;#39;t know if this way is the exact solution.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;and I heard that If the device is in debug mode It spends a lot of current.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;But, I don&amp;#39;t know whether it is in debug mode or in normal? release? mode.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The device app doesn't work with dc adapter or battery, only work with pc, debugger</title><link>https://devzone.nordicsemi.com/thread/233947?ContentTypeID=1</link><pubDate>Wed, 12 Feb 2020 12:03:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0dc48554-4c88-485c-aeef-a85fcf776ff8</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;It sounds like it may be somehow related to whether the chip is in debug interface mode or not - the programmer will put the chip into debug mode when you connect RTT. There are two things I would like you to try. 1. Check if it works with if you comment out the call to &amp;#39;idle_state_handle&amp;#39; in your main loop. 2. Keep the USB connected, but don&amp;#39;t start RTT logging or anything else that enables the debug interface until the program has stopped functioning. Once that happens you can run &amp;quot;nrfjprog --readregs&amp;quot; to read out the CPU registers. Those may give a hint as to what&amp;#39;s wrong.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The device app doesn't work with dc adapter or battery, only work with pc, debugger</title><link>https://devzone.nordicsemi.com/thread/233928?ContentTypeID=1</link><pubDate>Wed, 12 Feb 2020 10:39:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c162670-471c-48c8-b395-29ff9dc1fc8d</guid><dc:creator>zester926</dc:creator><description>[quote userid="82871" url="~/f/nordic-q-a/57707/the-device-app-doesn-t-work-with-dc-adapter-or-battery-only-work-with-pc-debugger"]and with PC cable, not dc adapter, the whole code is running very well including the function of reading value from accelerometer and publishing the message this value.[/quote]
&lt;p&gt;Sorry, there is problem. Only with PC cable it doesn&amp;#39;t work. The RTT should be connected. If RTT isn&amp;#39;t connected with device, it can&amp;#39;t keep publishing the message.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>