<?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>Intermittent DFU Activity</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/82118/intermittent-dfu-activity</link><description>I&amp;#39;ve been able to port the DFU process into a C# app running within a Linux gateway. 
 I&amp;#39;m using the buttonless without Bonds service to enter DFU mode. 
 The problem I have is that on many occasions after I have sent the command to enter DFU mode I&amp;#39;m</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 29 Nov 2021 14:31:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/82118/intermittent-dfu-activity" /><item><title>RE: Intermittent DFU Activity</title><link>https://devzone.nordicsemi.com/thread/341111?ContentTypeID=1</link><pubDate>Mon, 29 Nov 2021 14:31:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f52edcd4-8dc0-441b-b279-19a710f75cf3</guid><dc:creator>Brian Shankland</dc:creator><description>&lt;p&gt;Many thanks,&lt;/p&gt;
&lt;p&gt;As always it was a multi-issue problem so fixing one item did not resolve all, but I think I now have all of the issues handled and simply restarting from the beginning after an erroneous CRC restart is a clean solution which hopefully will be rare.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Many thanks this issue is now resolved.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Intermittent DFU Activity</title><link>https://devzone.nordicsemi.com/thread/341108?ContentTypeID=1</link><pubDate>Mon, 29 Nov 2021 14:20:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ddbeb65-492d-42bc-9f6f-8e67d4f66791</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Sorry for the confusion, I overlooked the fact that the LED indications are *not* reset after the Bluetooth connection has been terminated (i.e. on the NRF_DFU_EVT_TRANSPORT_DEACTIVATED event).&lt;/p&gt;
&lt;p&gt;Callback in main.c which controls the LED indication states (notice that there is no specific handling of the NRF_DFU_EVT_TRANSPORT_DEACTIVATED event triggered by BLE_GAP_EVT_DISCONNECTED):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**
 * @brief Function notifies certain events in DFU process.
 */
static void dfu_observer(nrf_dfu_evt_type_t evt_type)
{
    switch (evt_type)
    {
        case NRF_DFU_EVT_DFU_FAILED:
        case NRF_DFU_EVT_DFU_ABORTED:
        case NRF_DFU_EVT_DFU_INITIALIZED:
            bsp_board_init(BSP_INIT_LEDS);
            bsp_board_led_on(BSP_BOARD_LED_0);
            bsp_board_led_on(BSP_BOARD_LED_1);
            bsp_board_led_off(BSP_BOARD_LED_2);
            break;
        case NRF_DFU_EVT_TRANSPORT_ACTIVATED:
            bsp_board_led_off(BSP_BOARD_LED_1);
            bsp_board_led_on(BSP_BOARD_LED_2);
            break;
        case NRF_DFU_EVT_DFU_STARTED:
            break;
        default:
            break;
    }
}&lt;/pre&gt;&lt;/p&gt;
[quote userid="92564" url="~/f/nordic-q-a/82118/intermittent-dfu-activity/341098#341098"]When a previous partial download CRC fails should I send an Abort or just send a Create (as if nothing had been started)?[/quote]
&lt;p&gt;There are three options:&lt;/p&gt;
&lt;p&gt;1. Start over again by resending the init command.&lt;/p&gt;
&lt;p&gt;2. Send the abort command. This will make the bootloader perform a system reset and exit DFU mode if a valid app is present.&lt;/p&gt;
&lt;p&gt;3. Continue DFU from where you left off previously. The CRC should match for the offset returned by the select command. If not you will have to start over again by re-sending the init command.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Intermittent DFU Activity</title><link>https://devzone.nordicsemi.com/thread/341098?ContentTypeID=1</link><pubDate>Mon, 29 Nov 2021 13:52:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a47b0b03-6d16-4b9a-bb8f-8edb4e5b93cd</guid><dc:creator>Brian Shankland</dc:creator><description>&lt;p&gt;Thank you for clarifying the process.&lt;/p&gt;
&lt;p&gt;I think I have discovered the issue.&lt;/p&gt;
&lt;p&gt;It looks as is a previous download for a few of the devices has failed, and now when they connect the Select indicates this and no Create call is being made (which is the function in the bootloader that sends the&amp;nbsp;NRF_DFU_EVT_DFU_STARTED event.&lt;/p&gt;
&lt;p&gt;On a good restart this means I only see the indicator for the NRF_DFU_EVT_TRANSPORT_ACTIVATED, but the process does continue correctly.&lt;/p&gt;
&lt;p&gt;However, when the CRC does not match the code I ported just exits and hence it sits for 2 minutes then times out.&lt;/p&gt;
&lt;p&gt;When a previous partial download CRC fails should I send an Abort or just send a Create (as if nothing had been started)?&lt;/p&gt;
&lt;p&gt;ie should it be:&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; Select - Offset Not Zero but CRC&amp;#39;s don&amp;#39;t match&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; Abort&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; Select&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; Create&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; and so on&lt;/p&gt;
&lt;p&gt;Or just:&lt;/p&gt;
&lt;p&gt;Select - Offset Not Zero but CRC&amp;#39;s don&amp;#39;t match&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; Create&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; and so on&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Intermittent DFU Activity</title><link>https://devzone.nordicsemi.com/thread/341041?ContentTypeID=1</link><pubDate>Mon, 29 Nov 2021 10:46:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3366448d-73cd-47cd-b079-b9d9c7785e34</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;No, a connection will only be established if the central sends a connection request. Have you tried to just power off the gateway to see if the DFU target remains in the connected state?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Other things you may try:&lt;/p&gt;
&lt;p&gt;1. Use a BLE sniffer (e.g.&lt;a href="https://www.nordicsemi.com/Products/Development-tools/nRF-Sniffer-for-Bluetooth-LE"&gt;nRF Sniffer for Bluetooth LE&lt;/a&gt;) to find the address of the central that connects.&lt;/p&gt;
&lt;p&gt;2. In the bootloader, log the Central address from the BLE_GAP_EVT_CONNECTED event&lt;/p&gt;
[quote user="Brian Shankland"]To be sure of myself this event is indicating the connection to the DFU mode of the bootloader so is the one that has the BLE address +1 to my normal device?[/quote]
&lt;p&gt;Yes, it will advertise the&amp;nbsp; original address +1 when in DFU mode (&lt;span&gt;&lt;a title="Buttonless Secure DFU Service without bonds" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/service_dfu.html?cp=8_1_3_3_5_3#service_buttonless_unbonded"&gt;Buttonless Secure DFU Service without bonds&lt;/a&gt;&lt;/span&gt;).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Intermittent DFU Activity</title><link>https://devzone.nordicsemi.com/thread/340945?ContentTypeID=1</link><pubDate>Fri, 26 Nov 2021 15:48:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06acea44-fb86-4471-ba65-2c34a1898dc0</guid><dc:creator>Brian Shankland</dc:creator><description>&lt;p&gt;Could the connection be from an Active scan?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Intermittent DFU Activity</title><link>https://devzone.nordicsemi.com/thread/340940?ContentTypeID=1</link><pubDate>Fri, 26 Nov 2021 15:17:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e24a1e6a-226f-4ebf-84fb-52370dda1cae</guid><dc:creator>Brian Shankland</dc:creator><description>&lt;p&gt;Hello, thanks for quick reply.&lt;/p&gt;
&lt;p&gt;In case it matters I&amp;#39;m using Bluex 5.61 in the gateway.&lt;/p&gt;
&lt;p&gt;To be sure of myself this event is indicating the connection to the DFU mode of the bootloader so is the one that has the BLE address +1 to my normal device?&lt;/p&gt;
&lt;p&gt;If so then it would appear that the stack is holding some previous cache but I&amp;#39;m not sure why it would connect without me directing it to.&lt;/p&gt;
&lt;p&gt;After I send and receive the Response for the EnterDFU command to the characteristic&amp;nbsp;SecureDFUButtonlessWithoutBondsCharacteristicUUID&amp;nbsp; (&amp;quot;8EC90003-F315-4F60-9FB8-838830DAEA50&amp;quot; ) I perform a disconnect which drops the connection to the device, but I could perform a dispose as well to make sure (will try this now).&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll update with further test results, but this gives me something to investigate,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Intermittent DFU Activity</title><link>https://devzone.nordicsemi.com/thread/340938?ContentTypeID=1</link><pubDate>Fri, 26 Nov 2021 14:59:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4898b762-2948-4c4c-b4dd-bbe6b009dad6</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;NRF_DFU_EVT_TRANSPORT_ACTIVATED is raised when a connection has been established with the device, so that explains why you don&amp;#39;t see any advertising. Could it be possible that the gateway is maintaining a connection with the device in the &amp;quot;background&amp;quot;? If so,&amp;nbsp; can you try to disable the Bluetooth on the gateway to see if it remains connected? &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></channel></rss>