<?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>Bootloader inactivity timeout not triggering when interrupting USB DFU</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66400/bootloader-inactivity-timeout-not-triggering-when-interrupting-usb-dfu</link><description>Hello! I&amp;#39;m using SDK 15.2 
 I have a bootloader that has both BLE and USB DFU capabilities 
 Everything is working fine, the inactivity timeout of bootloader triggers in all of the expected situations but one: when the USB DFU process is interrupted while</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 06 Oct 2020 07:17:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66400/bootloader-inactivity-timeout-not-triggering-when-interrupting-usb-dfu" /><item><title>RE: Bootloader inactivity timeout not triggering when interrupting USB DFU</title><link>https://devzone.nordicsemi.com/thread/273087?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2020 07:17:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7c9e29e-39da-4219-9773-35244161690e</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;This is not fixed in any nRF5 SDK release. I have reported this as a bug, but I cannot say when it will be fixed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader inactivity timeout not triggering when interrupting USB DFU</title><link>https://devzone.nordicsemi.com/thread/273047?ContentTypeID=1</link><pubDate>Mon, 05 Oct 2020 18:15:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:833d3e41-68fd-4716-90fa-711542cf3151</guid><dc:creator>Jose Cazarin</dc:creator><description>&lt;p&gt;So, should this be filed as a bug? Or, was that fixed already in the newer versions of the SDK?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader inactivity timeout not triggering when interrupting USB DFU</title><link>https://devzone.nordicsemi.com/thread/272932?ContentTypeID=1</link><pubDate>Mon, 05 Oct 2020 10:45:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:340bdad1-9426-499c-a8a4-b78ce5998bea</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Jose,&lt;/p&gt;
[quote user="Jose Cazarin"]So I just removed the call to&amp;nbsp;&lt;strong&gt;nrf_drv_clock_lfclk_release&amp;nbsp;&lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt; in that switch statement and everything is fine now[/quote]
&lt;p&gt;I am glad to hear it works. Thank you for updating and letting us know.&lt;/p&gt;
[quote user="Jose Cazarin"]For some reason, the said timer is not being counted as a request for the LFCLK. So when the&amp;nbsp;&lt;strong&gt;nrf_drv_clock_lfclk_release&amp;nbsp;&lt;/strong&gt;function is called it thinks that there are no more requests and stops the LFCLOCK[/quote]
&lt;p&gt;The app_timer library does not request the LFCLK, though it is required, so it makes sense that it works like this, though it is not ideal. (I believe this is for historic reasons as the clock driver is newer than the app_timer module.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader inactivity timeout not triggering when interrupting USB DFU</title><link>https://devzone.nordicsemi.com/thread/272779?ContentTypeID=1</link><pubDate>Fri, 02 Oct 2020 15:25:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32876a46-20c6-49d8-b6f1-88d35cfce8a4</guid><dc:creator>Jose Cazarin</dc:creator><description>&lt;p&gt;Thanks! Was able to remove both the error messages when trying to disable the SD and also got the timer to work&lt;br /&gt;I fixed that by changing the&amp;nbsp;&lt;strong&gt;sd_state_evt_handler&amp;nbsp;&lt;/strong&gt; in the &lt;strong&gt;nrf_drv_clock.c&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;There&amp;#39;s a switch case in that function, and when it handles the case&amp;nbsp;&lt;strong&gt;NRF_SDH_EVT_STATE_DISABLED&amp;nbsp;&lt;/strong&gt;it calls&amp;nbsp;&lt;strong&gt;nrf_drv_clock_lfclk_release&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;For some reason, the said timer is not being counted as a request for the LFCLK. So when the&amp;nbsp;&lt;strong&gt;nrf_drv_clock_lfclk_release&amp;nbsp;&lt;/strong&gt;function is called it thinks that there are no more requests and stops the LFCLOCK&lt;br /&gt;&lt;br /&gt;So I just removed the call to&amp;nbsp;&lt;strong&gt;nrf_drv_clock_lfclk_release&amp;nbsp;&lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt; in that switch statement and everything is fine now&lt;br /&gt;&lt;br /&gt;Thank you so much for your help during this whole week!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader inactivity timeout not triggering when interrupting USB DFU</title><link>https://devzone.nordicsemi.com/thread/272702?ContentTypeID=1</link><pubDate>Fri, 02 Oct 2020 11:10:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e72349c-386f-406c-a84e-60cecd8927f3</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have looked a bit more into this, and using your changed on the DK (with on modification which is to trigger DFU mode on pin reset&amp;nbsp;and reducing the timeout to 60 seconds to save some time). I did see the same issue.&lt;/p&gt;
[quote user="Jose Cazarin"]Can the softdevice be disabled at runtime?[/quote]
&lt;p&gt;Yes, and that happens then the BLE transport is disabled. Specifically&amp;nbsp;ble_dfu_transport_close() calls&amp;nbsp;nrf_sdh_disable_request() which in turn disabled the SoftDevice.&lt;/p&gt;
&lt;p&gt;I did look into the error message you get.&amp;nbsp;The on_rx_complete() function in components\libraries\bootloader\serial_dfu\nrf_dfu_serial_usb.c calls nrf_dfu_transports_close() for every request that is handled (). This calls ble_dfu_transport_close(), which succeeds the first time, as you can see from this line in the log:&lt;/p&gt;
&lt;p&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_ble: BLE transport shut down.&lt;/p&gt;
&lt;p&gt;However it is called for every subsequent request, and then it fails, as the SoftDevice has allready been disabled, and you get this line for every subsequent call:&lt;/p&gt;
&lt;p&gt;00&amp;gt; &amp;lt;debug&amp;gt; app: Failed to shutdown transport 1, error 8&lt;/p&gt;
&lt;p&gt;You can for instance fix this like this, so that the SoftDevice is only disabled once:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2210.nrf_5F00_dfu_5F00_ble.c.diff"&gt;devzone.nordicsemi.com/.../2210.nrf_5F00_dfu_5F00_ble.c.diff&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I notised something interesting while doing this, when I accidentally never disabled the SoftDevice. In that case, the timeout worked as expected. That made me think of an old issue, which I believe holds the explanation. Disabling the SoftDevice also disabled the 32.768 kHz LFCLK, which is the clock source for the RTC used for the timeout. So if you disable the SoftDevice you need to re-enable the LFCLK. This is described in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/28096/disable-sd-stops-all-rtcs-and-or-lfclk"&gt;this thread&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader inactivity timeout not triggering when interrupting USB DFU</title><link>https://devzone.nordicsemi.com/thread/272629?ContentTypeID=1</link><pubDate>Thu, 01 Oct 2020 19:21:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9fd02ba2-26fe-4c7c-87fa-50d7260f43d6</guid><dc:creator>Jose Cazarin</dc:creator><description>[quote userid="7377" url="~/f/nordic-q-a/66400/bootloader-inactivity-timeout-not-triggering-when-interrupting-usb-dfu/272530#272530"]No. The SoftDevice is the BLE stack, and there can be no BLE working without it enabled. Perhaps it was disabled before? I am just speculating at this point, but the return codes you get are a strong indication that the SoftDevice is not enabled at that point.[/quote]
&lt;p&gt;Can the softdevice be disabled at runtime? I thought it was enabled at build time, and since the DFU through BLE is working with this bootloader, I thought that there&amp;#39;s no way it could be disabled.&lt;/p&gt;
&lt;p&gt;Sorry, there was a mistake in my Makefile, some flags were not necessary and they break the SDK build&lt;/p&gt;
&lt;p&gt;I tested it with an unmodified version of the SDK and it compiled fine now. But I&amp;#39;m using the&amp;nbsp;&lt;strong&gt;secure&lt;/strong&gt; bootloader, so you should put the makefile and the linker in the folder:&lt;br /&gt;&lt;span&gt;15.2&amp;gt;\examples\dfu\&lt;strong&gt;secure_bootloader&lt;/strong&gt;\pca10056_usb_debug\armgcc\&lt;br /&gt;And the sdk_confih.g in the:&amp;nbsp;&lt;br /&gt;15.2&amp;gt;\examples\dfu\&lt;strong&gt;secure_bootloader&lt;/strong&gt;\pca10056_usb_debug\config\&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;I&amp;#39;m attaching the new version. I&amp;#39;ve tested it on my custom board and the same problem happens. I wasn&amp;#39;t able to test it on an actual NRF52840 dev kit though.&lt;br /&gt;&lt;br /&gt;Let me know about the results! Thanks!&lt;br /&gt;&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/1581.ble_5F00_and_5F00_serial_5F00_bl_5F00_v2.zip"&gt;devzone.nordicsemi.com/.../1581.ble_5F00_and_5F00_serial_5F00_bl_5F00_v2.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader inactivity timeout not triggering when interrupting USB DFU</title><link>https://devzone.nordicsemi.com/thread/272530?ContentTypeID=1</link><pubDate>Thu, 01 Oct 2020 12:53:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b338775-071e-49ea-a206-47b8d663f127</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="Jose Cazarin"]Is it possible for the softdevice to &lt;strong&gt;not&lt;/strong&gt; be enabled and the DFU through BLE still works?[/quote]
&lt;p&gt;No. The SoftDevice is the BLE stack, and there can be no BLE working without it enabled. Perhaps it was disabled before? I am just speculating at this point, but the return codes you get are a strong indication that the SoftDevice is not enabled at that point.&lt;/p&gt;
[quote user="Jose Cazarin"]I just removed the defines/flags used for our custom board from it, so now it is compiling for the default PCA10056 board[/quote]
&lt;p&gt;I see. I dropping the Makefile and linker script into &amp;lt;SDK 15.2&amp;gt;\examples\dfu\open_bootloader\pca10059_usb\armgcc\ and the sdk_config.h into &amp;lt;SDK 15.2&amp;gt;\examples\dfu\open_bootloader\pca10059_usb\config\, but was not able to build it. Can you upload a project that reproduce the issue and that you have verified that builds with an unmodified SDK 15.2, along with any instructions if needed so that I can test on my side?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader inactivity timeout not triggering when interrupting USB DFU</title><link>https://devzone.nordicsemi.com/thread/272373?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2020 16:21:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42623949-23c6-4eb6-95cb-c59c8c6c7b67</guid><dc:creator>Jose Cazarin</dc:creator><description>&lt;p&gt;It runs on a custom board that uses the NRF52840. Is it possible for the softdevice to &lt;strong&gt;not&lt;/strong&gt; be enabled and the DFU through BLE still works? Because I can do a BLE DFU with this bootloader with no problems.&lt;br /&gt;There are no major changes to the SDK code other than some code that was added to use a LED as a visual hint of what&amp;#39;s going on.&lt;br /&gt;I started with the USB secure bootloader example and added the BLE transport layer by adjusting the Makefile and sdk_config.h&lt;br /&gt;I can share the makefile, sdk_config.h and the linker script that I&amp;#39;m using.&lt;/p&gt;
&lt;p&gt;I just removed the defines/flags used for our custom board from it, so now it is compiling for the default PCA10056 board&lt;br /&gt;&lt;br /&gt;I&amp;#39;m attaching the three files&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_and_5F00_serial_5F00_bl.zip"&gt;devzone.nordicsemi.com/.../ble_5F00_and_5F00_serial_5F00_bl.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader inactivity timeout not triggering when interrupting USB DFU</title><link>https://devzone.nordicsemi.com/thread/272302?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2020 12:27:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07ce87de-1118-4b50-a034-627d461401eb</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="Jose Cazarin"]&lt;strong&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_ble: sd_ble_gap_adv_stop ret value = 2&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_ble: nrf_sdh_disable_request ret value = 8&lt;/strong&gt;[/quote]
&lt;p&gt;These error codes could make sense, as 2 =&amp;nbsp;NRF_ERROR_SOFTDEVICE_NOT_ENABLED, and 8 =&amp;nbsp;NRF_ERROR_INVALID_STATE, as you have noted. Is the SoftDevice enabled at this point? These&amp;nbsp;are the return values you would expect if the SoftDevice is not enabled.&lt;/p&gt;
[quote user="Jose Cazarin"]Could that be problem? Maybe for some reason, the unsuccessful shutdown of the BLE transport is keeping the timer from working properly?[/quote]
&lt;p&gt;I am not sure what is going on, but clearly the bootloader is not in a good state, and it looks like the SoftDevice is not enabled. Is it possible to upload your bootloader code here? Does it run on a DK?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader inactivity timeout not triggering when interrupting USB DFU</title><link>https://devzone.nordicsemi.com/thread/272113?ContentTypeID=1</link><pubDate>Tue, 29 Sep 2020 15:21:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fcf8b965-6278-47ac-88eb-052898d52fd0</guid><dc:creator>Jose Cazarin</dc:creator><description>&lt;p&gt;It is indeed the &lt;strong&gt;nrf_dfu_tranports_close&lt;/strong&gt; function that returns an error. But removing the break that you mentioned doesn&amp;#39;t fix the problem&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve added some logs to the&amp;nbsp;&lt;strong&gt;ble_dfu_transport_close&amp;nbsp;&lt;/strong&gt; function. Heres what I got:&lt;br /&gt;&lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)&lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_flash: nrf_fstorage_write(addr=0x0008F800, src=0x200062B8, len=1024 bytes), queue usage: 1&lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_flash: Flash write success: addr=0x0008F800, pending 0&lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_req_handler: Request handling complete. Result: 0x1&lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; app: Shutting down transports (found: 2)&lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_ble: Shutting down BLE transport.&lt;br /&gt;&lt;strong&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_ble: sd_ble_gap_adv_stop ret value = 2&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_ble: nrf_sdh_disable_request ret value = 8&lt;/strong&gt;&lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; app: Failed to shutdown transport 1, error 8&lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_serial_usb: Allocated buffer 200062B4&lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)&lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_flash: nrf_fstorage_write(addr=0x0008FC00, src=0x20005AB4, len=1024 bytes), queue usage: 1&lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_flash: Flash write success: addr=0x0008FC00, pending 0&lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_req_handler: Request handling complete. Result: 0x1&lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; app: Shutting down transports (found: 2)&lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_ble: Shutting down BLE transport.&lt;br /&gt;&lt;strong&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_ble: sd_ble_gap_adv_stop ret value = 2&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_ble: nrf_sdh_disable_request ret value = 8&lt;/strong&gt;&lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; app: Failed to shutdown transport 1, error 8&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The bold lines represent the logs that I&amp;#39;ve added&lt;br /&gt;&lt;br /&gt;So it looks like that both&amp;nbsp;&lt;strong&gt;sd_ble_gap_adv_stop&amp;nbsp;&lt;/strong&gt; and&amp;nbsp;&lt;strong&gt;nrf_sdh_disable_request&amp;nbsp;&lt;/strong&gt;are returning errors&lt;br /&gt;&lt;br /&gt;But it is strange that&amp;nbsp;&lt;strong&gt;sd_ble_gap_adv_stop&amp;nbsp;&lt;/strong&gt;returns the error code 2 because it looks it can&amp;#39;t return that value. From the ble_gap.h (using softdevice s140 6.1.1 ):&lt;br /&gt;&lt;br /&gt;&lt;em&gt;/**@brief Stop advertising (GAP Discoverable, Connectable modes, Broadcast Procedure).&lt;/em&gt;&lt;br /&gt;&lt;em&gt; *&lt;/em&gt;&lt;br /&gt;&lt;em&gt; * @mscs&lt;/em&gt;&lt;br /&gt;&lt;em&gt; * @mmsc{@ref BLE_GAP_ADV_MSC}&lt;/em&gt;&lt;br /&gt;&lt;em&gt; * @mmsc{@ref BLE_GAP_WL_SHARE_MSC}&lt;/em&gt;&lt;br /&gt;&lt;em&gt; * @endmscs&lt;/em&gt;&lt;br /&gt;&lt;em&gt; *&lt;/em&gt;&lt;br /&gt;&lt;em&gt; * @param[in] adv_handle The advertising handle that should stop advertising.&lt;/em&gt;&lt;br /&gt;&lt;em&gt; *&lt;/em&gt;&lt;br /&gt;&lt;em&gt; * @retval ::NRF_SUCCESS The BLE stack has stopped advertising.&lt;/em&gt;&lt;br /&gt;&lt;em&gt; * @retval ::BLE_ERROR_INVALID_ADV_HANDLE Invalid advertising handle.&lt;/em&gt;&lt;br /&gt;&lt;em&gt; * @retval ::NRF_ERROR_INVALID_STATE The advertising handle is not advertising.&lt;/em&gt;&lt;br /&gt;&lt;em&gt; */&lt;/em&gt;&lt;br /&gt;&lt;em&gt;SVCALL(SD_BLE_GAP_ADV_STOP, uint32_t, sd_ble_gap_adv_stop(uint8_t adv_handle));&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;None of those values can be 2&lt;br /&gt;&lt;br /&gt;And the error code for&amp;nbsp;&lt;strong&gt;nrf_sdh_disable_request&amp;nbsp;&lt;/strong&gt;&amp;nbsp;is 8 which is&amp;nbsp;NRF_ERROR_INVALID_STATE&lt;br /&gt;&lt;br /&gt;Could that be problem? Maybe for some reason, the unsuccessful shutdown of the BLE transport is keeping the timer from working properly?&lt;br /&gt;&lt;br /&gt;Thank you so much for your help so far&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader inactivity timeout not triggering when interrupting USB DFU</title><link>https://devzone.nordicsemi.com/thread/271949?ContentTypeID=1</link><pubDate>Tue, 29 Sep 2020 07:34:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:363d0f61-576c-4b6c-993d-6e1d3b585d58</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I see.&amp;nbsp;I have not been able to reproduce this error using the USB DFU bootloader example only modified to enable timeout (NRF_BL_DFU_INACTIVITY_TIMEOUT_MS is set to 0 in the open USB DFU bootloader example by default), no matter when I terminate nrfutil. But I have not tested with your modified bootloader that use both BLE and USB transport (which should not be a problem).&lt;/p&gt;
&lt;p&gt;I do not immediately see what could cause the problem, and it is a bit difficult as I have not reproduced it. I see that closing the USB transport cannot fail. See implementation:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static uint32_t usb_dfu_transport_close(nrf_dfu_transport_t const * p_exception)
{
    return NRF_SUCCESS;
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;So it must be&amp;nbsp;ble_dfu_transport_close() that returns an error.&amp;nbsp;The return value of&amp;nbsp;nrf_dfu_transports_close() is ignored by all callers, but it could be a problem that it breaks out of the loop when&amp;nbsp; closing the transport, which may not be a good idea when you have two transports. What happens if you remove the break statement on line 86 in&amp;nbsp;components\libraries\bootloader\dfu\nrf_dfu_transport.c?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader inactivity timeout not triggering when interrupting USB DFU</title><link>https://devzone.nordicsemi.com/thread/271829?ContentTypeID=1</link><pubDate>Mon, 28 Sep 2020 14:00:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77aa08ba-9ad1-45ef-8799-d1e9ceb5065d</guid><dc:creator>Jose Cazarin</dc:creator><description>&lt;p&gt;It&amp;#39;s the default:&lt;/p&gt;
&lt;p&gt;#define NRF_BL_DFU_INACTIVITY_TIMEOUT_MS 120000&lt;br /&gt;&lt;br /&gt;And like I said, it works in any other situation. If I don&amp;#39;t do anything after entering the BL it reboots, if start a BLE DFU and stop it, it reboots as well. It doesn&amp;#39;t work&amp;nbsp;&lt;strong&gt;only&lt;/strong&gt; when I try to do a DFU through&amp;nbsp;USB&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader inactivity timeout not triggering when interrupting USB DFU</title><link>https://devzone.nordicsemi.com/thread/271793?ContentTypeID=1</link><pubDate>Mon, 28 Sep 2020 13:13:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2bfc54ef-4c56-444e-a003-5e69955cde66</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;What is the value of&amp;nbsp;NRF_BL_DFU_INACTIVITY_TIMEOUT_MS in your bootlaoder&amp;#39;s sdk_config.h file?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader inactivity timeout not triggering when interrupting USB DFU</title><link>https://devzone.nordicsemi.com/thread/271601?ContentTypeID=1</link><pubDate>Fri, 25 Sep 2020 20:13:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ada41eb5-6e00-487e-b778-368c033d12da</guid><dc:creator>Jose Cazarin</dc:creator><description>&lt;p&gt;Some new info&lt;/p&gt;
&lt;p&gt;I realized that when I kill the NRFUtil program the event&amp;nbsp;APP_USBD_CDC_ACM_USER_EVT_PORT_CLOSE is handled in the bootloader&lt;/p&gt;
&lt;p&gt;So in&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;nrf_dfu_serial_usb.c&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;in the function&amp;nbsp;&lt;strong&gt;cdc_acm_user_ev_handler&lt;/strong&gt; inside the switch case that handles the events I added:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;case&amp;nbsp;APP_USBD_CDC_ACM_USER_EVT_PORT_CLOSE:&lt;/em&gt;&lt;/div&gt;
&lt;div&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/em&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;nrf_bootloader_dfu_inactivity_timer_restart(&lt;/em&gt;&lt;/div&gt;
&lt;div&gt;&lt;em&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;NRF_BOOTLOADER_MS_TO_TICKS(NRF_BL_DFU_INACTIVITY_TIMEOUT_MS),&lt;/em&gt;&lt;/div&gt;
&lt;div&gt;&lt;em&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;inactivity_timeout);&lt;/em&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;break;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/em&gt;And I can see in the RTT output log the timer functions being called right after I kill the NRFUtil. But after the timeout expires, the callback that resets the board is not called&lt;br /&gt;This leads me to believe that some code that runs when a DFU is being done over USB is keeping the timer from working properly and calling the callback&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>