<?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>Reset Bootloader for SDKv11.0.0 using DFU /HCI over UART</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/57466/reset-bootloader-for-sdkv11-0-0-using-dfu-hci-over-uart</link><description>We are using another microcontroller to update the application firmware in an nRF51822 over the UART using the DFU HCI protocol from SDKv11.0.0. 
 The nRF51822 uses the HCI/UART bootloader from the example in SDKv11.0.0. We have implemented the DFU HCI</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 22 Feb 2020 00:37:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/57466/reset-bootloader-for-sdkv11-0-0-using-dfu-hci-over-uart" /><item><title>RE: Reset Bootloader for SDKv11.0.0 using DFU /HCI over UART</title><link>https://devzone.nordicsemi.com/thread/235803?ContentTypeID=1</link><pubDate>Sat, 22 Feb 2020 00:37:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:afa74038-cf31-4021-94e4-55c2424e316a</guid><dc:creator>Phil</dc:creator><description>&lt;p&gt;The issue isn&amp;#39;t fixed.&amp;nbsp; I could not get the boot-loader to restart a DFU if a DFU doesn&amp;#39;t run to completion.&lt;/p&gt;
&lt;p&gt;We have a workaround.&amp;nbsp; That is if a DFU is interrupted, don&amp;#39;t restart it for 120secs to give time for the boot-loader to perform a software reset of the nRF51.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reset Bootloader for SDKv11.0.0 using DFU /HCI over UART</title><link>https://devzone.nordicsemi.com/thread/235677?ContentTypeID=1</link><pubDate>Fri, 21 Feb 2020 10:20:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:879ee112-f665-450f-98f4-614c7adf3b7e</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It seems you fixed issue is fixed, right? Please correct me if I misunderstand. Thanks.&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reset Bootloader for SDKv11.0.0 using DFU /HCI over UART</title><link>https://devzone.nordicsemi.com/thread/233617?ContentTypeID=1</link><pubDate>Mon, 10 Feb 2020 21:58:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5661a794-f64b-4742-8cde-b081e0178175</guid><dc:creator>Phil</dc:creator><description>&lt;p&gt;I did find the boot-loader times out and resets the nRF51 after 120secs if no serial data is received.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After the nRF51 reset, another DFU can be performed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reset Bootloader for SDKv11.0.0 using DFU /HCI over UART</title><link>https://devzone.nordicsemi.com/thread/233616?ContentTypeID=1</link><pubDate>Mon, 10 Feb 2020 21:56:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11f6bee8-8c01-4f35-8873-d4b9958aed74</guid><dc:creator>Phil</dc:creator><description>&lt;p&gt;I corrected the Out Of Sequence Packet Error.&amp;nbsp; On the next DFU I sent the Start packet with SEQ=1 and the nRF51 replies with ACK=4. This is&amp;nbsp;out of sequence as we expect ACK = 2.&amp;nbsp; The received ACK&amp;nbsp;indicates the nRF51 was expecting SEQ = 4.&amp;nbsp; (This lines up with the stop packet of the previous DFU which sent SEQ=3).&amp;nbsp; The received start packet is discarded, evident by the fact the application memory never gets erased.&amp;nbsp; We then re-send the start packet with SEQ=4 and receive a response with ACK=5.&amp;nbsp; This is the correct acknowledgment.&amp;nbsp; By the way I tested re-sending the start packet with all other SEQ values and always received ACK=4.&amp;nbsp; This was the only value of SEQ where the ACK=SEQ+1&amp;nbsp; (except SEQ=3.&amp;nbsp; In that case I can&amp;#39;t tell if this is the correct ACK or an error.&amp;nbsp; Given the previous STOP packet send SEQ=3, this must be an error).&lt;/p&gt;
&lt;p&gt;However, despite receiving the correct ACK, the second DFU doesn&amp;#39;t get very far.&amp;nbsp; The Start packet is acknowledged but the application memory isn&amp;#39;t erased.&amp;nbsp; There is no response to the INIT packet.&lt;/p&gt;
&lt;p&gt;Also I found inconsistent behaviour. If the first DFU sends the STOP packet, but the image is invalid (wrong length or CRC),&amp;nbsp; it stops responding at the INIT packet of the next DFU.&amp;nbsp; However if the DFU is interrupted part-way through and the STOP packet is never sent, then the DFU can be recovered if you send a START packet twice (with correct SEQ value).&lt;/p&gt;
&lt;p&gt;We can&amp;#39;t test using nrfutil as we don&amp;#39;t have a serial connection to the nRF51.&amp;nbsp; The nRF51 serial port is directly connected to the master micro, and we can&amp;#39;t access the pins.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reset Bootloader for SDKv11.0.0 using DFU /HCI over UART</title><link>https://devzone.nordicsemi.com/thread/233542?ContentTypeID=1</link><pubDate>Mon, 10 Feb 2020 13:38:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:08dddcce-457a-443b-a520-5098b8e355a5</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am checking with the development team. I will be back asap I have any update.&lt;/p&gt;
&lt;p&gt;Do you see the same behavior if you are using nrfutil instead of your own software?&lt;/p&gt;
&lt;p&gt;-Amanda H.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reset Bootloader for SDKv11.0.0 using DFU /HCI over UART</title><link>https://devzone.nordicsemi.com/thread/233179?ContentTypeID=1</link><pubDate>Fri, 07 Feb 2020 05:04:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:417253c5-f5a3-4cc8-bea4-cbe1cbc0c35a</guid><dc:creator>Phil</dc:creator><description>&lt;p&gt;The problem is Out Of Sequence Packet Error.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reset Bootloader for SDKv11.0.0 using DFU /HCI over UART</title><link>https://devzone.nordicsemi.com/thread/233178?ContentTypeID=1</link><pubDate>Fri, 07 Feb 2020 03:42:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:025accf6-27d6-4fde-b054-b15269f675a1</guid><dc:creator>Phil</dc:creator><description>&lt;p&gt;Actually that didn&amp;#39;t work.&amp;nbsp; Not incrementing SEQ and ACK resulted in our DFU command sequence running through to the end and being able to repeat DFU, but the boot-loader didn&amp;#39;t actually flash any data into the application flash memory.&lt;/p&gt;
&lt;p&gt;So it is essential that SEQ increments.&amp;nbsp; And I think the problem is what the SEQ and ACK values are in the start packet when the DFU is repeated.&amp;nbsp; My guess is that the transport layer doesn&amp;#39;t care that the DFU ended and the boot-loader didn&amp;#39;t jump to the application.&lt;/p&gt;
&lt;p&gt;Is there any further information on how SEQ and ACK works with reliable packets in the HCI DFU?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reset Bootloader for SDKv11.0.0 using DFU /HCI over UART</title><link>https://devzone.nordicsemi.com/thread/233171?ContentTypeID=1</link><pubDate>Fri, 07 Feb 2020 01:24:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2dea84e4-cc08-4468-9e6d-39e85df842ea</guid><dc:creator>Phil</dc:creator><description>&lt;p&gt;The problem seems to be with SEQ and ACK numbers in the HCI header of the DFU packet.&lt;/p&gt;
&lt;p&gt;The DFU protocol packets have a 4-byte HCI header.&amp;nbsp; The first byte has two 3-bit fields; SEQ and ACK.&amp;nbsp; Our software was starting with SEQ=1, ACK=2 when the DFU Start packet is sent and incrementing these on every DFU packet sent to the nRF51.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;By trial and error I found that DFU still works ok of these fields and not incremented, and can repeat a DFU if the application is invalid and the boot-loader keep running.&lt;/p&gt;
&lt;p&gt;Also it requires the SEQ=1, ACK=2.&amp;nbsp; Other values cause a DFU to fail.&lt;/p&gt;
&lt;p&gt;The reference for the HCI header is in the &amp;quot;Bluetooth Core Specification v5.00, Vol 4 Part D Three Wire UART Transport Layer&amp;quot;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The specification shows SEQ being incremented (mod 7) for each sent packet. Also there is a non-zero SEQ value in the response.&amp;nbsp; The nRF51 boot-loader response packets always have SEQ=0.&lt;/p&gt;
&lt;p&gt;It appears that the nRF51 bootloader doesn&amp;#39;t follow the BLE specification for the HCI header.&lt;/p&gt;
&lt;p&gt;We only require to receive response packets so that we know when to send the next DFU command. We don&amp;#39;t intend to implement packet re-transmissions so this will work for us.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reset Bootloader for SDKv11.0.0 using DFU /HCI over UART</title><link>https://devzone.nordicsemi.com/thread/233165?ContentTypeID=1</link><pubDate>Thu, 06 Feb 2020 22:56:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e0ca95f-abee-4007-88c0-35fd740dcafb</guid><dc:creator>Phil</dc:creator><description>&lt;div class="help_breadcrumbs"&gt;This is the documentation from nRF5 SDKv11.0.0 for the serial DFU we are using:&lt;/div&gt;
&lt;div class="help_breadcrumbs"&gt;&lt;/div&gt;
&lt;div class="help_breadcrumbs"&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/struct_sdk/struct/sdk.html"&gt;Software Development Kit&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&amp;gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/struct_sdk/struct/sdk_nrf5.html"&gt;Previous versions of nRF5 SDK&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&amp;gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v11.0.0/index.html"&gt;nRF5 SDK v11.0.0&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&amp;gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v11.0.0/examples.html"&gt;Examples&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&amp;gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v11.0.0/examples_bootloader.html"&gt;DFU bootloader &lt;/a&gt;&lt;/div&gt;
&lt;div class="help_breadcrumbs"&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v11.0.0/examples_bootloader.html"&gt;examples&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&amp;gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v11.0.0/examples_ble_dfu.html"&gt;BLE &amp;amp; HCI/UART Bootloader/DFU&lt;/a&gt;&lt;/div&gt;
&lt;div class="help_breadcrumbs"&gt;&lt;/div&gt;
&lt;div class="help_breadcrumbs"&gt;It only describes four DFU commands for controlling the boot-loader&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reset Bootloader for SDKv11.0.0 using DFU /HCI over UART</title><link>https://devzone.nordicsemi.com/thread/233159?ContentTypeID=1</link><pubDate>Thu, 06 Feb 2020 22:10:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ed6740cb-d63c-4ed1-93ad-316a9c82d340</guid><dc:creator>Phil</dc:creator><description>&lt;p&gt;That does a software reset from within the nRF51822.&amp;nbsp; What I meant is software reset via DFU command so that the other microcontroller can reset the nRF51822 when it is boot-loader mode. Or at least a DFU command that restarts the boot-loader.&lt;/p&gt;
&lt;p&gt;So far I can only see there are 4 DFU command to control the bootloader: Start Packet, Init Packet, Data Packet and Stop packet.&amp;nbsp; I assumed that sending a Start packet DFU command would reset the boot-loader. However, that is not what we observe.&lt;/p&gt;
&lt;p&gt;If the DFU fails to complete, so the boot-loader doesn&amp;#39;t run the application after the DFU Stop packet is sent, then the nRF51 remains in bootloader mode.&amp;nbsp; When another DFU is started, the bootloader fails and stops sending ACK packets after a couple of DFU command packets.&amp;nbsp; The only recovery mechanism so far is to reset the nRF51.&amp;nbsp; After a reset (power on or by JLink) the nRF51 restarts in boot-loader mode, because the application is invalid, and will correctly perform a DFU.&lt;/p&gt;
&lt;p&gt;Our problem is that we have no way of doing a hardware reset of the nRF51 from the other microocontroller.&amp;nbsp; We only have the UART connection and nRF51 GPIO pin P0.19 and P0.17.&lt;/p&gt;
&lt;p&gt;Is there a known reason why a DFU cannot be repeated while the nRF51 is in boot-loader mode?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reset Bootloader for SDKv11.0.0 using DFU /HCI over UART</title><link>https://devzone.nordicsemi.com/thread/233041?ContentTypeID=1</link><pubDate>Thu, 06 Feb 2020 12:13:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:afc6b4af-083a-4425-be44-1ce8aaa784a4</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you have enabled the SoftDevice you can use &lt;a title="sd_nvic_SystemReset" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s332.api.v2.0.0/group___n_r_f___n_v_i_c___f_u_n_c_t_i_o_n_s.html?cp=4_5_6_3_2_10_2_9#ga2bdb388be7b21d11b347549bb57ed02e"&gt;sd_nvic_SystemReset&lt;/a&gt;, if not you can use nvic_systemreset().&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>