<?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>sd_softdevice_disable() not returning during transport shutdown in DFU Bootloader</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/40319/sd_softdevice_disable-not-returning-during-transport-shutdown-in-dfu-bootloader</link><description>My setup of the buttonless BLE DFU secure bootloader using SDK15.2 isn&amp;#39;t launching the application after a successful OTA package transfer. Using RTT and breakpoints, I narrowed down the issue to sd_softdevice_disable() inside nrf_sdh_disable_request</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 19 Nov 2018 12:49:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/40319/sd_softdevice_disable-not-returning-during-transport-shutdown-in-dfu-bootloader" /><item><title>RE: sd_softdevice_disable() not returning during transport shutdown in DFU Bootloader</title><link>https://devzone.nordicsemi.com/thread/157950?ContentTypeID=1</link><pubDate>Mon, 19 Nov 2018 12:49:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:212a686d-8e48-45af-9414-ec093e6e5fb5</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi Visti, I assume you are using the clock driver? In that case it&amp;#39;s important to note that the driver will attempt to release the LF clock source when the NRF_SDH_EVT_STATE_DISABLED event is raised by nrf_sdh_disable_request(), this is not possible to do when WDT is enabled. The program will therefore become stuck in the while (nrf_clock_lf_is_running()){} loop. You can call nrf_drv_clock_lfclk_request(NULL) after softdevice enable to keep the LF clock on.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_softdevice_disable() not returning during transport shutdown in DFU Bootloader</title><link>https://devzone.nordicsemi.com/thread/157804?ContentTypeID=1</link><pubDate>Fri, 16 Nov 2018 20:05:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2f19b3f-062c-44a5-9680-ea70c0948507</guid><dc:creator>abhipray</dc:creator><description>&lt;p&gt;Just adding that the problem I was seeing with sd_softdevice_disable() is back again when I try to use multiple DFU transports and I&amp;#39;ve described it in a new&amp;nbsp; &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/40601/bootloader-cdc-acm-and-ble-transport-layers"&gt;post&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_softdevice_disable() not returning during transport shutdown in DFU Bootloader</title><link>https://devzone.nordicsemi.com/thread/157679?ContentTypeID=1</link><pubDate>Fri, 16 Nov 2018 09:57:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f275a967-16eb-4033-a34e-fbccd5dd14ce</guid><dc:creator>Visti Andresen</dc:creator><description>&lt;p&gt;I have a very similar issue while not involving a DFU update...&lt;br /&gt;&lt;br /&gt;nrf_sdh_disable_request() never returns and the system current draw stays around 2.4mA until the watchdog resets the nRF52.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;* Power up reset&lt;br /&gt;* Start SD and do some measurements&lt;br /&gt;* Begin sleep mode (disables the SD)&lt;br /&gt;* Wake on GPIOTE event&lt;br /&gt;* Start SD and do some measurements&lt;br /&gt;* Begin sleep mode (disables the SD) disabling the SD never returns.&lt;br /&gt;&lt;br /&gt;nrfjprog --family nrf52 --snr xxxxxx --readregs&lt;br /&gt;R0:&amp;nbsp;&amp;nbsp; 0x2000FEF7&lt;br /&gt;R1:&amp;nbsp;&amp;nbsp; 0xE000E100&lt;br /&gt;R2:&amp;nbsp;&amp;nbsp; 0x40000000&lt;br /&gt;R3:&amp;nbsp;&amp;nbsp; 0x00010000&lt;br /&gt;R4:&amp;nbsp;&amp;nbsp; 0x20003920&lt;br /&gt;R5:&amp;nbsp;&amp;nbsp; 0x20003715&lt;br /&gt;R6:&amp;nbsp;&amp;nbsp; 0x2000300D&lt;br /&gt;R7:&amp;nbsp;&amp;nbsp; 0x20002DA4&lt;br /&gt;R8:&amp;nbsp;&amp;nbsp; 0x20002DA0&lt;br /&gt;R9:&amp;nbsp;&amp;nbsp; 0x20002D9C&lt;br /&gt;R10:&amp;nbsp; 0x20002DA8&lt;br /&gt;R11:&amp;nbsp; 0x00000000&lt;br /&gt;R12:&amp;nbsp; 0x00000001&lt;br /&gt;SP:&amp;nbsp;&amp;nbsp; 0x2000FEF0&lt;br /&gt;LR:&amp;nbsp;&amp;nbsp; 0x00028CD5&lt;br /&gt;PC:&amp;nbsp;&amp;nbsp; 0x00028CEC&lt;br /&gt;xPSR: 0x01000000&lt;br /&gt;MSP:&amp;nbsp; 0x2000FEF0&lt;br /&gt;PSP:&amp;nbsp; 0x00000000&lt;/p&gt;
&lt;p&gt;nRF5_SDK_14.2.0_17b948a and s132_nrf52_5.1.0_softdevice.hex&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have inserted a LED flash before and after the call to nrf_sdh_disable_request()&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;  for (int i=0; i&amp;lt;1000000; i++){
    NRF_GPIO-&amp;gt;PIN_CNF[11] = 3&amp;lt;&amp;lt;0;
    NRF_GPIO-&amp;gt;OUTCLR = 1&amp;lt;&amp;lt;11;
  }
  for (int i=0; i&amp;lt;1000000; i++){
    NRF_GPIO-&amp;gt;PIN_CNF[11] = 3&amp;lt;&amp;lt;0;
    NRF_GPIO-&amp;gt;OUTSET = 1&amp;lt;&amp;lt;11;
  }
  
  nrf_sdh_disable_request();

  for (int i=0; i&amp;lt;2000000; i++){
    NRF_GPIO-&amp;gt;PIN_CNF[11] = 3&amp;lt;&amp;lt;0;
    NRF_GPIO-&amp;gt;OUTCLR = 1&amp;lt;&amp;lt;11;
  }
  for (int i=0; i&amp;lt;2000000; i++){
    NRF_GPIO-&amp;gt;PIN_CNF[11] = 3&amp;lt;&amp;lt;0;
    NRF_GPIO-&amp;gt;OUTSET = 1&amp;lt;&amp;lt;11;
  }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The first disable functions just fine, the one after the soft reset hangs.&lt;br /&gt;After a watchdog reset I can repeat the procedure.&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/1920x0/__key/communityserver-discussions-components-files/4/drawing.svg.png" /&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m probably going to work around the issue by using a GPIOTE+RTC based wake and resetting the nRF52 using the WD timer.&lt;br /&gt;The WD timer seem to be slightly cheaper (on avg.) than using the RTC, but since it isn&amp;#39;t possible to disable the WD using a software reset I&amp;#39;m probably going that way.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards Visti Andresen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_softdevice_disable() not returning during transport shutdown in DFU Bootloader</title><link>https://devzone.nordicsemi.com/thread/156734?ContentTypeID=1</link><pubDate>Fri, 09 Nov 2018 23:32:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c78c2a42-bad1-42db-b75d-85cdf943588b</guid><dc:creator>abhipray</dc:creator><description>&lt;p&gt;Thank you for the offer to help debug! I just discovered a few things that seem to have fixed it: First, because I moved the RTT buffer RAM section around, I couldn&amp;#39;t get proper logging until I power-cycled the nrf52. Second, I reduced the RTT number of buffers. And the biggest discovery was perhaps that I was enabling&amp;nbsp;mem_manager and compiling the associated files leading to ; I had done that because sdk_config.h in the example has it enabled.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_softdevice_disable() not returning during transport shutdown in DFU Bootloader</title><link>https://devzone.nordicsemi.com/thread/156687?ContentTypeID=1</link><pubDate>Fri, 09 Nov 2018 14:11:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:175b7025-d823-43d7-91f8-6f2f6ffc3c6e</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;So the program does not return from&amp;nbsp;&lt;span&gt;sd_softdevice_disable()? I haven&amp;#39;t&amp;nbsp;experienced that before. Can you read out the Core registers while the code is &amp;quot;stuck&amp;quot;? You can do this with the --readregs command in nrfjprog. E.g., &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.tools/dita/tools/nrf5x_command_line_tools/nrf5x_command_line_tools_lpage.html?cp=5_1"&gt;nrfjprog&lt;/a&gt; --readregs. I would be happy to try debugging it here as well if you are able to share your project.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>