<?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>Keep BLE Connection alive during a DFU</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/102471/keep-ble-connection-alive-during-a-dfu</link><description>Hello! 
 I have been using the nRF Connect SDK and implementing DFU into my application. 
 My app currently advertises and connects on an interval (defined in an RTOS thread) as a means of power saving. 
 So for example, every 60 seconds of being idle</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 03 Aug 2023 18:01:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/102471/keep-ble-connection-alive-during-a-dfu" /><item><title>RE: Keep BLE Connection alive during a DFU</title><link>https://devzone.nordicsemi.com/thread/439772?ContentTypeID=1</link><pubDate>Thu, 03 Aug 2023 18:01:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3bf262ba-9380-4813-9ad7-68de10ef7d55</guid><dc:creator>nordicator_prim3</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;(I&amp;#39;m not with nordic just a random dude). I&amp;#39;ve run into similar problems and I don&amp;#39;t see a good way to hook into the smp code without changing it, but there may be something I&amp;#39;m missing!&lt;/p&gt;
&lt;p&gt;It would be ideal if your device wasn&amp;#39;t always in &amp;quot;DFU mode&amp;quot;; is there a button press or a bluetooth command you could send to it that would tell it to be in &amp;quot;DFU mode&amp;quot;? That would give you a way to know to expect that longer duration transmission and it would also prevent random people from putting firmware on the device when you didn&amp;#39;t intend them to.&lt;/p&gt;
&lt;p&gt;The way I&amp;#39;ve handled it in the past is to advertise on a different GATT/attributes than the smp server one for my main application. The application can then parse ocmmands sent to it over bluetooth from an app or computer or something. When I do want to upgrade the firmware I send a command to it that says to stop advertising the application GATT and to start advertising the way smp server expects. Then you would have a hook that would let the bluetooth stay on long enough to complete the transaction.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>