<?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>Secure DFU without Flow control (SDK 15.2)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/42982/secure-dfu-without-flow-control-sdk-15-2</link><description>Hi All, 
 
 I have implemented the code for MASTER serial DFU in ST micro controller. which can send the app .bin file. I&amp;#39;m using 57600 baud and disable the flow control. 
 I&amp;#39;m getting Unexpected OP_CODE error. Is it because of data loss? 
 Can we send</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 08 Feb 2019 15:57:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/42982/secure-dfu-without-flow-control-sdk-15-2" /><item><title>RE: Secure DFU without Flow control (SDK 15.2)</title><link>https://devzone.nordicsemi.com/thread/170168?ContentTypeID=1</link><pubDate>Fri, 08 Feb 2019 15:57:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4930e377-2051-457a-8d68-506115c94d05</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;As suggested by my colleague in&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/support-private/support/221440"&gt;this&lt;/a&gt; case, we were expecting the opposite behaviour, i.e. that you would need a longer delay with increasing baudrate. We kindly ask you to use the&amp;nbsp;&lt;a href="https://www.nordicsemi.com/DocLib/Content/SDK_Doc/nRF5_SDK/v15-2-0/lib_hardfault"&gt;hardfault handling library&lt;/a&gt;&amp;nbsp;to identify the cause of the hardfault in the bootloader.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We would also like to see traces of the UART lines during the transfer so that we can verify that the&amp;nbsp; data is transferred correctly.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Secure DFU without Flow control (SDK 15.2)</title><link>https://devzone.nordicsemi.com/thread/169803?ContentTypeID=1</link><pubDate>Wed, 06 Feb 2019 19:59:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ec28feb-6c04-4f8e-96c1-3c8e7e8a39e7</guid><dc:creator>Goudra</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Is there any suggestion on this?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Basava.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Secure DFU without Flow control (SDK 15.2)</title><link>https://devzone.nordicsemi.com/thread/169098?ContentTypeID=1</link><pubDate>Fri, 01 Feb 2019 14:59:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d2c2d3a-058b-4f66-b6ef-6550c3d37962</guid><dc:creator>Goudra</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Now i&amp;#39;m sending data at 9600 baud rate using nrfutils command from the Prompt. Its working. But we have implemented same in St controller side(C code), here we saw same issue with hardware fault.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then we log the working CMD prompt data, we observe the log packet by packet. While sending&amp;nbsp; Firmware packet, after every 3 packet its need 200msec delay. (I really dont know why this delay is needed after&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;3packet&lt;/strong&gt;?).&lt;/p&gt;
&lt;p&gt;So, we considered it in our code and implemented it. Now issue got resolved. We struggled a lot to find out this and took 2 week of time.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To verify that delay, we tested with different baud like 4800. Now it is taking 400msec after every 3 packet.&lt;/p&gt;
&lt;p&gt;and for 14400baud it is taking ~150msec delay.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I request you, Can you please let us know why the bootloader needs a delay after 3 packet? and&lt;/p&gt;
&lt;p&gt;why the delay is changing based on the baud rate?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Because of this delay requirement some time its not working with 57600baud.&lt;/p&gt;
&lt;p&gt;please find log file above &amp;quot;&lt;span&gt;&amp;quot;&amp;nbsp;&lt;/span&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/Baudrate_5F00_9600.htm"&gt;Baudrate_9600.htm&lt;/a&gt;&lt;span&gt;&amp;nbsp;&amp;quot;&lt;/span&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;Please let us know the delay requirement.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks ,&lt;/p&gt;
&lt;p&gt;Basava&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Secure DFU without Flow control (SDK 15.2)</title><link>https://devzone.nordicsemi.com/thread/168929?ContentTypeID=1</link><pubDate>Thu, 31 Jan 2019 16:17:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4771c307-778e-4107-aab9-0e051a400c49</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Can use the&amp;nbsp;nRF5_SDK_15.2.0_9412b96\examples\dfu\secure_bootloader\pca10040_uart_debug instead and attach the RTT log output? I&amp;nbsp;would like to see the debug log of the bootloader code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;current_object is only modified in&amp;nbsp;nrf_dfu_obj_op() so the issue must lie in the request handler chain. The request (&lt;span&gt;nrf_dfu_request_t&amp;nbsp;) originates from&amp;nbsp;nrf_dfu_serial_on_packet_received() in nrf_dfu_serial.c so maybe there is something that goes wrong there. Can you set a breakpoint there or print the&amp;nbsp;&amp;nbsp;nrf_dfu_request_t request.select.object_type field to verify that the received packet is parsed correctly.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;As far as I can see this variable,&amp;nbsp;request.select.object_type isnt modified in the calls from&amp;nbsp;nrf_dfu_serial_on_packet_received to&amp;nbsp;nrf_dfu_obj_op()&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Secure DFU without Flow control (SDK 15.2)</title><link>https://devzone.nordicsemi.com/thread/168547?ContentTypeID=1</link><pubDate>Tue, 29 Jan 2019 16:57:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c0c34d1-1e3c-419f-90e2-ba4a5625611d</guid><dc:creator>Goudra</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;We used different example to build our bootloader. We used&amp;nbsp; &amp;nbsp;&amp;quot;secure_bootloader_uart_mbr_pca10040 &amp;quot;&amp;nbsp; &lt;strong&gt;&amp;nbsp;pca10040_uart&amp;nbsp;&lt;/strong&gt; &amp;nbsp;example.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I tried to upload my Fw file from the command prompt using 9600 baud and without flow control. Its uploading properly. Below attachment shows LOG file. As in the log file, after every 3 FW packet it is taking 200msec delay.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/Baudrate_5F00_9600.htm"&gt;devzone.nordicsemi.com/.../Baudrate_5F00_9600.htm&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Same Flow I have implemented with C code to send my FW file. But after updating 12k or 16k bytes . I&amp;#39;m not getting reply from the Bootloader. I traced it and it is in hardware fault.&lt;/p&gt;
&lt;p&gt;1. So to avoid this hardware fault i have increases the delay to 1sec between each 64bytes packet. Still it went to hardware fault.&lt;/p&gt;
&lt;p&gt;2. Then I reduced the each packet size to 32bytes and kept 1sec delay in between Tx packet. For this configuration also i&amp;#39;m not getting CRC. I traced it. but it&amp;nbsp;is a different issue now.&amp;nbsp; I found issue in the below code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As in the LOG, before sending initialization packet, Object will be selected as &lt;strong&gt;1&lt;/strong&gt; ie&amp;nbsp;&lt;strong&gt;NRF_DFU_OBJ_TYPE_COMMAND &lt;/strong&gt;&amp;nbsp;&lt;strong&gt;&lt;/strong&gt;and&amp;nbsp;&lt;strong&gt;current_object&amp;nbsp;&amp;nbsp;&lt;/strong&gt;will update with 1 and&amp;nbsp; init&amp;nbsp; data should send after this.&lt;/p&gt;
&lt;p&gt;Same way, to send FW packet, we need to select and create object&amp;nbsp; &lt;strong&gt;&amp;nbsp;&lt;/strong&gt;with 2 ie&amp;nbsp;&lt;strong&gt;NRF_DFU_OBJ_TYPE_DATA. &lt;/strong&gt;Now&amp;nbsp;&lt;strong&gt;current_object&lt;/strong&gt; become 2 and start sending FW packet using opcode &lt;strong&gt;0x08.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;After sending some packet&amp;nbsp;&lt;strong&gt;current_object &lt;/strong&gt;becomes&lt;strong&gt; 1&amp;nbsp;&lt;/strong&gt;. But i didn&amp;#39;t change the obj number still the&amp;nbsp;&lt;strong&gt;current_object&amp;nbsp;&lt;/strong&gt;value is modified.&amp;nbsp; I really dont know how it is changed.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To check this i have created global variable to store this value. After some time variable value becoming zero. So some values are overlapped it and changed the value.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To&amp;nbsp;make sure this overlapped issue, I have created the global arry with 500byte and the created the&amp;nbsp;&lt;span&gt;global variable. Then followed the updating procedure. After sending some FW packet array value and global variable value become Zero&amp;nbsp;&lt;strong&gt;current_object value changed to 2 to 1.&amp;nbsp;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Because&lt;/b&gt;&lt;span&gt;&lt;b&gt;&amp;nbsp;of this,&amp;nbsp; code will consider&amp;nbsp;FW packet as init packet&amp;nbsp; and&amp;nbsp;&amp;nbsp;later it will give invalid parameter error.&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;strong&gt;Please help me to understand what is going wrong.&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;static bool nrf_dfu_obj_op(nrf_dfu_request_t * p_req, nrf_dfu_response_t * p_res)&lt;br /&gt;{&lt;br /&gt; /* Keep track of the current object type since write and execute requests don&amp;#39;t contain it. */&lt;br /&gt; &lt;strong&gt;static nrf_dfu_obj_type_t current_object = NRF_DFU_OBJ_TYPE_COMMAND;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;if ( (p_req-&amp;gt;request == NRF_DFU_OP_OBJECT_SELECT)&lt;br /&gt; || (p_req-&amp;gt;request == NRF_DFU_OP_OBJECT_CREATE))&lt;br /&gt; {&lt;br /&gt; STATIC_ASSERT(offsetof(nrf_dfu_request_select_t, object_type) ==&lt;br /&gt; offsetof(nrf_dfu_request_create_t, object_type),&lt;br /&gt; &amp;quot;Wrong object_type offset!&amp;quot;);&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;current_object = (nrf_dfu_obj_type_t)(p_req-&amp;gt;select.object_type);&lt;/strong&gt;&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;bool response_ready = true;&lt;/p&gt;
&lt;p&gt;switch (&lt;strong&gt;current_object&lt;/strong&gt;)&lt;br /&gt; {&lt;br /&gt; case NRF_DFU_OBJ_TYPE_COMMAND:&lt;br /&gt; nrf_dfu_command_req(p_req, p_res);&lt;br /&gt; break;&lt;/p&gt;
&lt;p&gt;case NRF_DFU_OBJ_TYPE_DATA:&lt;br /&gt; response_ready = nrf_dfu_data_req(p_req, p_res);&lt;br /&gt; break;&lt;/p&gt;
&lt;p&gt;default:&lt;br /&gt; /* The select request had an invalid object type. */&lt;br /&gt; NRF_LOG_ERROR(&amp;quot;Invalid object type in request.&amp;quot;);&lt;br /&gt; current_object = NRF_DFU_OBJ_TYPE_INVALID;&lt;br /&gt; p_res-&amp;gt;result = NRF_DFU_RES_CODE_INVALID_OBJECT;&lt;br /&gt; break;&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;return response_ready;&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Basavanagouda&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Secure DFU without Flow control (SDK 15.2)</title><link>https://devzone.nordicsemi.com/thread/168410?ContentTypeID=1</link><pubDate>Tue, 29 Jan 2019 10:06:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee6fa244-4de4-4be0-9a30-39db4335423e</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Great! Happy to hear that you&amp;#39;re able to perform DFU with nrfutil with baudrate set to 9600.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you use the debug version of the serial bootloader for the nRF52832? You can find it in&amp;nbsp;nRF5_SDK_15.2.0_9412b96\examples\dfu\secure_bootloader\pca10040_uart_debug.&lt;/p&gt;
&lt;p&gt;Use Segger RTT Viewer or see the RTT output in the Debug Terminal if you&amp;#39;re using Segger Embedded Studio. Please attach the log output to this question. It will hopefully provide some information to why the Hardfault occurs.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Secure DFU without Flow control (SDK 15.2)</title><link>https://devzone.nordicsemi.com/thread/168360?ContentTypeID=1</link><pubDate>Tue, 29 Jan 2019 05:09:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51ec762e-793d-4ee5-9416-9fc5c1be25bc</guid><dc:creator>Goudra</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for the reply. I have tried with 9600 baud rate with nrfutil. Its taking around 50 sec to upload and it updated properly.&lt;/p&gt;
&lt;p&gt;So same thing i have implemented C code to transmit FW packet to BLE. I&amp;#39;m making 64 bytes of packet of 4 bytes and sending it to BLE. It receiving properly. After sending 4k asking for CRC. I&amp;#39;m getting CRC.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m facing issue here.&lt;/p&gt;
&lt;p&gt;1. After sending 4 or 5 4kbytes packet. Bootloader code going for Hardware fault.&lt;/p&gt;
&lt;p&gt;2. I&amp;#39;m not understanding this issue. It will update the FW using CMD prompt nrfutil commands.&lt;/p&gt;
&lt;p&gt;3. But with my code it is going for Hardware fault.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Is there any delay required for each packet?&lt;/p&gt;
&lt;p&gt;What will be the reason for this hardware fault issue?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Please let me know the suggestions.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Secure DFU without Flow control (SDK 15.2)</title><link>https://devzone.nordicsemi.com/thread/168003?ContentTypeID=1</link><pubDate>Fri, 25 Jan 2019 15:42:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b125673c-c9e8-4db8-bb62-8ed87ae6ebeb</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hi Goudra,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We have seen buffer overflow issues with previous SDK versions and the serial BL examples are designed with HWFC in mind. Can you try to lower the baudrate to 9600 and see if get any error with this configuration?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Bjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>