<?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>Buttonless DFU (w/o bond) cannot enter from my application</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/97425/buttonless-dfu-w-o-bond-cannot-enter-from-my-application</link><description>Hi, 
 Have an issue which has popped up with our application. It is configured to use buttonless DFU for OTA updates. 
 It&amp;#39;s been working fine in the past but with a recent build, the app cannot enter the bootloader when instructed to it seems. 
 The</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 08 Mar 2023 16:27:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/97425/buttonless-dfu-w-o-bond-cannot-enter-from-my-application" /><item><title>RE: Buttonless DFU (w/o bond) cannot enter from my application</title><link>https://devzone.nordicsemi.com/thread/414211?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2023 16:27:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c0ecf64-0352-4b07-b087-7108e965befd</guid><dc:creator>john23094</dc:creator><description>&lt;p&gt;Definitely, we will be looking at it for a future design. It&amp;#39;s an oversight in our current design.&lt;/p&gt;
&lt;p&gt;Indeed, testing being able to update &lt;strong&gt;again&lt;/strong&gt;, after actually updating is something we&amp;#39;re noting down as extremely important right now. Goes to show how minor changes elsewhere can affect things you don&amp;#39;t think are related.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Buttonless DFU (w/o bond) cannot enter from my application</title><link>https://devzone.nordicsemi.com/thread/414210?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2023 16:22:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4255cc45-f5bb-4295-aad2-bda4c9e4816e</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi savvn001,&lt;/p&gt;
&lt;p&gt;I see. It certainly is good that it didn&amp;#39;t happen in the field. Perhaps you might want to consider adding a reset button in the design, just in case?&lt;/p&gt;
&lt;p&gt;With devices hard to physically access like that, please make sure to test the DFU feature extensively. One important test case is that the device, after being upgraded with DFU, can still perform DFU successfully.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Buttonless DFU (w/o bond) cannot enter from my application</title><link>https://devzone.nordicsemi.com/thread/414204?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2023 15:49:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c31741d6-b383-4248-955e-702ebbd5128b</guid><dc:creator>john23094</dc:creator><description>&lt;p&gt;Hi Hieu,&lt;/p&gt;
&lt;p&gt;Unfortunately&amp;nbsp;the device is sealed so it&amp;#39;s fully not&amp;nbsp;acessable&amp;nbsp;at all by any means sadly. But it&amp;#39;s luckily a throwaway for us and not something out in the field. So we have no way we can think of currently to get the device into DFU mode if a&amp;nbsp;&lt;em&gt;BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST &lt;/em&gt;event&lt;em&gt;&amp;nbsp;&lt;/em&gt;causes a crash, as that&amp;#39;s the only way to enter DFU mode as far as I know. A button enter fallback method may be added in a future design.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Buttonless DFU (w/o bond) cannot enter from my application</title><link>https://devzone.nordicsemi.com/thread/414200?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2023 15:40:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09393068-020e-49fc-9536-ee3d9fdf206a</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi savvn001,&lt;/p&gt;
&lt;p&gt;It&amp;#39;s great that you found the offending code so quickly.&lt;/p&gt;
&lt;p&gt;If you can access the debug&amp;nbsp;pins on the bricked device, you can just recover it by programming it with J-Link or an equivalent option; but my guess is that you already considered this.&lt;/p&gt;
&lt;p&gt;Another option to consider is: The secure bootloader supports&amp;nbsp;other method to enter DFU mode. There is an overview with links in its documentation page. Perhaps you would want to check&amp;nbsp;if any of those work before giving up? For example, if the button enter method is supported, and the hardware layout allows it, then a bit of handywork with a copper wire can put the device in DFU mode.&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Buttonless DFU (w/o bond) cannot enter from my application</title><link>https://devzone.nordicsemi.com/thread/414190?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2023 15:08:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a182420-a598-4e2c-b3ec-3e8efed46b7e</guid><dc:creator>john23094</dc:creator><description>&lt;p&gt;Update:&lt;/p&gt;
&lt;p&gt;Ok, I&amp;#39;ve found the offending code. It does have nothing to do with the DFU related functions.&lt;/p&gt;
&lt;p&gt;There is a&amp;nbsp;&lt;em&gt;on_ble_evt&lt;/em&gt; callback being called on &lt;strong&gt;another&lt;/strong&gt; service when I write to the&lt;span&gt;&amp;nbsp;&amp;#39;Buttonless DFU&amp;#39; characteristic (as you know these callbacks get called whenver any ble event happens)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It does a switch on&amp;nbsp;&lt;/span&gt;&lt;em&gt;(p_ble_evt-&amp;gt;header.evt_id)&amp;nbsp;&lt;/em&gt;and in the case&amp;nbsp;&lt;em&gt;BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST&amp;nbsp;&lt;/em&gt;happens. There is a for loop that loops too many times and causes segfault under this case. So program crashes here. Silly mistake.&lt;/p&gt;
&lt;p&gt;This means effectively, the one that is flashed currently is probably bricked indefinitely for now as I don&amp;#39;t know how one would get round this if reflashing the device with a probe is not possible. Lesson learned!&lt;/p&gt;
&lt;p&gt;&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: Buttonless DFU (w/o bond) cannot enter from my application</title><link>https://devzone.nordicsemi.com/thread/414159?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2023 14:07:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d903490-97d2-49ca-aaec-328f048192c2</guid><dc:creator>john23094</dc:creator><description>&lt;p&gt;Hi, sorry I should of mentioned these:&lt;/p&gt;
&lt;p&gt;So with more recent builds, we only changed some app functionality but it should have basically &lt;strong&gt;nothing&lt;/strong&gt; to do with the BLE interface, and especially not the DFU side of things. I&amp;#39;m like 90% sure of this. We especially did not touch any of the bluetooth related code.&lt;/p&gt;
&lt;p&gt;The hardware is a custom board we have made using nF52840.&lt;/p&gt;
&lt;p&gt;Unfortunately the logs from our application don&amp;#39;t tell us much. So I&amp;#39;ve tried to recreate the issue by flashing an empty development board with the same bootloader + softdevice plus our application.&lt;/p&gt;
&lt;p&gt;When it initally advertises as DFU target, it can be updated perfectly fine. We can then connect perfectly fine to the application initially.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Think I&amp;#39;m starting to see where the issue is, from the application when it is running, after enabling indications on the &amp;#39;Buttonless DFU&amp;#39; characteristic, we write &amp;#39;0x01&amp;#39; to the&amp;nbsp;&lt;span&gt;characteristic which &lt;strong&gt;should&lt;/strong&gt; put it in DFU mode (enter bootloader) right, the MCU just resets. Not sure if this is WDT reset or Softdevice assertation, no idea.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;As you can see in the code posted there should be a lot of logging going on before entering DFU but I can&amp;#39;t see any of it. Soon as we write to&amp;nbsp;&amp;#39;Buttonless DFU&amp;#39; characteristic, it resets after ~2s.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&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: Buttonless DFU (w/o bond) cannot enter from my application</title><link>https://devzone.nordicsemi.com/thread/414080?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2023 10:41:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef759eef-fbba-4076-bd01-7ac6c4ce1b40</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi savvn001,&lt;/p&gt;
&lt;p&gt;Could you please clarify what changed with &amp;quot;a recent build?&amp;quot;&lt;/p&gt;
&lt;p&gt;What hardware are you testing all of this on? Do you see the&amp;nbsp;LEDs indicating bootloader operations?&lt;/p&gt;
&lt;p&gt;Do you have any logs from your application or the bootloader?&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>