<?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>nrf52832 OTA over ESB based on SDK17.1.0</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/96494/nrf52832-ota-over-esb-based-on-sdk17-1-0</link><description>Hi everyone: I developed an application based on ESB wireless communication protocol ofr the nRF52832, and I would like to perform an OTA DFU with it. Do you know any example of some over the air FW upgrade of nRF52832 chip via ESB protocol. 
 SDK is</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 19 Sep 2023 01:35:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/96494/nrf52832-ota-over-esb-based-on-sdk17-1-0" /><item><title>RE: nrf52832 OTA over ESB based on SDK17.1.0</title><link>https://devzone.nordicsemi.com/thread/446536?ContentTypeID=1</link><pubDate>Tue, 19 Sep 2023 01:35:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22ae5acd-dd92-46ef-8e34-5865f8bd8552</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;Thanks for your reply, I get it.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Lurn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 OTA over ESB based on SDK17.1.0</title><link>https://devzone.nordicsemi.com/thread/446522?ContentTypeID=1</link><pubDate>Mon, 18 Sep 2023 18:44:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f13a7a1-8c05-4520-955c-872d96f38e5e</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Lurn,&lt;/p&gt;
&lt;p&gt;I am out of office until January. Please create a new ticket (just checking some work stuff, and stumbled upon this one).&lt;/p&gt;
&lt;p&gt;In the nRF5 SDK we don&amp;#39;t encrypt the DFU image. It is only signed (private key) and verified (public key).&lt;/p&gt;
[quote user="Lurn_Z"]And does the Nordic chip have a unique identification code?[/quote]
&lt;p&gt;No. Not for this use case. The only unique data are calibration data and address data. If you want something unique for every device, other than this, you must generate this yourself. It can e.g. be stored in the UICR registers if you don&amp;#39;t intend to change it for the lifetime of the device.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But if you want to encrypt the FW before sending it, you would need to implement this yourself. The bootloader would then need to decrypt it before swapping the old firmware with the new one. This is feasible, and I know of other customers who have done similar things before without too much change in the bootloader.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Again, I will be out of office for the rest of the year, so I will not see any follow up questions until then. I suggest you create a new ticket.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 OTA over ESB based on SDK17.1.0</title><link>https://devzone.nordicsemi.com/thread/442874?ContentTypeID=1</link><pubDate>Thu, 24 Aug 2023 06:38:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cf251d34-3b30-4475-8661-9c437db14e36</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;Not sure if you still following this case, but I want to know is the role of public key and private key only for matching? Is there any process of encrypting and decrypting the firmware in the bootloader? I just find the slip_encode/decode.&lt;/p&gt;
&lt;p&gt;And does the Nordic chip have a unique identification code?&amp;nbsp;It allows me to do an operation similar to activation to prevent my firmware content from being leaked.&lt;/p&gt;
&lt;p&gt;Or do you have any other way to encrypt the firmware?&lt;/p&gt;
&lt;p&gt;In &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/37260/adding-encryption-to-secure-dfu-sdk-v15"&gt;this link&lt;/a&gt;&amp;nbsp;it shows a way, but it looks using softdevice, but I didn&amp;#39;t use the softdevice, just MBR.&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Lurn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 OTA over ESB based on SDK17.1.0</title><link>https://devzone.nordicsemi.com/thread/422204?ContentTypeID=1</link><pubDate>Tue, 25 Apr 2023 08:22:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:686c9f01-53df-4942-ba21-5b697f7b0c2c</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;Sorry,&amp;nbsp;I didn&amp;#39;t do the calculations just saw that the last packet was not 64 bytes.&lt;/p&gt;
&lt;p&gt;And yes I saw the code here,&lt;/p&gt;
&lt;p&gt;nrf_drv_uart_tx(&amp;amp;p_dfu-&amp;gt;uart_instance, encoded_slip_packet, encoded_slip_packet_length+1);&lt;/p&gt;
&lt;p&gt;So as you said, I should modify the MTU_SIZE to 131 it will be batter than now.&lt;/p&gt;
&lt;p&gt;I will try this.&lt;/p&gt;
&lt;p&gt;Update:&lt;/p&gt;
&lt;p&gt;After change the values, I can update successfully too. But&amp;nbsp;for now I can&amp;#39;t see different whit it, but as you said, I can find that in my bootloader.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;#define UART_SLIP_MTU&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(2 * (RX_BUF_SIZE + 1) + 1)&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;so I think the value you suggested should be better than before.&lt;/p&gt;
&lt;p&gt;Thanks a lot.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Lurn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 OTA over ESB based on SDK17.1.0</title><link>https://devzone.nordicsemi.com/thread/422203?ContentTypeID=1</link><pubDate>Tue, 25 Apr 2023 08:13:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79b61690-7d6c-48fe-9ff7-cf9171dd8128</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;52=n*4, where n = 13, so that is fine.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you want to skip this part, you can adjust the bootloader to pad the remaining 1, 2 or 3 bytes with 0xFF. It is probably better than just asserting.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I discussed the MTU_SIZE/2 fix with the colleague who wrote the DFU_Master application a few years ago, and we figured out that the reason faulted now is a change in the bootloader. Before, it would gather up several packets, and do a big write containing more packets. The default behavior now is that it writes to flash after every package, which is why it failed.&lt;/p&gt;
&lt;p&gt;We also looked at the buffer size, and found the reasoning behind why it was divided by 2.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you look in the bootloader, you will find:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define RX_BUF_SIZE                     (64) //to get 64bytes payload
#define OPCODE_OFFSET                   (sizeof(uint32_t) - NRF_SERIAL_OPCODE_SIZE)
#define DATA_OFFSET                     (OPCODE_OFFSET + NRF_SERIAL_OPCODE_SIZE)
#define UART_SLIP_MTU                   (2 * (RX_BUF_SIZE + 1) + 1)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;So the reason behind this is that the &amp;quot;SLIP&amp;quot; encoding will sometimes have to add an extra byte in cases where the actual payload byte is the same as the END or ESC character in the SLIP library.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Hence, it needs to double the buffer size. On the last line there, you can see that we take the RX_BUF_SIZE+1, which would be the actual buffer + one byte (I don&amp;#39;t remember. It could be the byte indicating the length or something). Then double it, in case all bytes are escape or end characters (which in theory could happen, but probably won&amp;#39;t happen). Then you add 1 in the end to account for the actual end byte of the buffer. So you end up with a buffer size of: (2 * (64 +1) + 1 ) = 2*65 + 1 = 130 + 1 = 131 bytes.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So in order to do the exact opposite of this, you can use:&lt;/p&gt;
&lt;p&gt;MAX_ACTUAL_PAYLOAD = (((MAX_MTU - 1) / 2) -1)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;which will be 64. So if the payload buffer is maximum 64 bytes, it should always be safe:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define MTU_SIZE 131
#define MAX_ACTUAL_PAYLOAD (((MTU_SIZE - 1)/2) - 1) // = 64 bytes.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Note that MTU_SIZE is also increased to 131, which corresponds to the actual MTU size of the UART buffer in the bootloader from SDK17.1.0.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 OTA over ESB based on SDK17.1.0</title><link>https://devzone.nordicsemi.com/thread/422197?ContentTypeID=1</link><pubDate>Tue, 25 Apr 2023 07:49:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:01eb4052-8107-46e1-85be-b5c32028bf71</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;I used a custom board, and the UART connection method is jump wire. So the connection will be a bit unstable.&lt;/p&gt;
&lt;p&gt;After I ported the code to an Android device(No more &lt;span&gt;jump wire&amp;nbsp;&lt;/span&gt;connections), it works fine.&lt;/p&gt;
&lt;p&gt;And I only change the&amp;nbsp;MAX_ACTUAL_PAYLOAD to&amp;nbsp;MTU_SIZE/2 as you do.&lt;/p&gt;
&lt;p&gt;On the Android device I tested 5 times,&amp;nbsp;they are all successful, althougt the final package isn&amp;#39;t 64 bytes. and I checked it that only the final package isn&amp;#39;t n*4 bytes.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_flash: nrf_fstorage_write(addr=0x0000AA40, src=0x20000558, len=64 bytes), queue usage: 1
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_flash: Flash write success: addr=0x0000AA40, pending 0
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_req_handler: Request handling complete. Result: 0x1
00&amp;gt; &amp;lt;info&amp;gt; nrf_dfu_serial_uart: Allocated buffer 20000554
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (data)
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_flash: nrf_fstorage_write(addr=0x0000AA80, src=0x200005DC, len=52 bytes), queue usage: 1
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_flash: Flash write success: addr=0x0000AA80, pending 0
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_req_handler: Request handling complete. Result: 0x1&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Update:&lt;/p&gt;
&lt;p&gt;If you want I can show you the code on android, but it&amp;nbsp;is not much different with DFU master,&amp;nbsp;just modified the underlying code of the serial port communication.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Lurn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 OTA over ESB based on SDK17.1.0</title><link>https://devzone.nordicsemi.com/thread/422191?ContentTypeID=1</link><pubDate>Tue, 25 Apr 2023 07:27:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b21a4cb7-539e-4417-81a4-5e5a5d9e16cf</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Sorry for the late reply. I have been out of office.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am sorry, but I am a bit confused.&lt;/p&gt;
&lt;p&gt;Did you figure out the length problem? If the length of the .bin / .dat file is not n*4 bytes, you can try to open it in a binary editor (e.g. Hex Editor Neo), and add 0xFF&amp;#39;s until it is n*4 bytes long before you convert it to a hex file.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And on your failing tests, are you running this on 2x DKs, or do you have some custom HW? Are you using UART Flow Control (on both sides) of the UART connection?&lt;/p&gt;
&lt;p&gt;Regarding the Error 4 it is a bit difficult to say, because the error handler in the bootloader is very limited. You can try to set a breakpoint there, and look at the callstack to see if you can figure out what triggered the error handler to be triggered. It should be an APP_ERROR_CHECK() or an assert of some sort.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 OTA over ESB based on SDK17.1.0</title><link>https://devzone.nordicsemi.com/thread/421707?ContentTypeID=1</link><pubDate>Fri, 21 Apr 2023 11:11:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b362df45-a68c-42c4-bf70-abc94bd6882f</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;First of all thank you for taking so much time to help me with this problem.&lt;/p&gt;
&lt;p&gt;Now I can update successfully although I always get something wrong, but I think the question is on my hardware and the connect way.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll start porting it to other devices to test.&lt;/p&gt;
&lt;p&gt;Thanks again for your help&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Lurn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 OTA over ESB based on SDK17.1.0</title><link>https://devzone.nordicsemi.com/thread/421698?ContentTypeID=1</link><pubDate>Fri, 21 Apr 2023 10:33:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38398b80-c5ed-4176-ac2c-76c194d9c6e6</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;OK, I was update successfully one time(I think), after I modify the TX pin state, and then, I never success.&lt;/p&gt;
&lt;p&gt;The last log shows:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/0421_5F00_DFU_5F00_test_5F00_1828.log"&gt;devzone.nordicsemi.com/.../0421_5F00_DFU_5F00_test_5F00_1828.log&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And I still get the error &amp;ldquo; Hash verification failed. &amp;rdquo;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 OTA over ESB based on SDK17.1.0</title><link>https://devzone.nordicsemi.com/thread/421692?ContentTypeID=1</link><pubDate>Fri, 21 Apr 2023 10:01:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41537475-caf4-4e98-a297-de3989dd9e51</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;I think the reason is that the UART tx pin of my mast device is floating, causing some unpredictable things.&lt;/p&gt;
&lt;p&gt;I set the gpio to PULLUP, and it&amp;nbsp;solved tht problem.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    if (p_config-&amp;gt;pselrxd != NRF_UART_PSEL_DISCONNECTED)
    {
        nrf_gpio_cfg_input(p_config-&amp;gt;pselrxd, NRF_GPIO_PIN_PULLUP);
    }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;But after that I get anoter error.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_validation: Hash verification. start address: 0x1000, size: 0x9E60
00&amp;gt; &amp;lt;warning&amp;gt; nrf_dfu_validation: Hash verification failed.
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_validation: Expected FW hash:
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_validation:  58 BD B7 97 03 3B 8A 07|X....;..
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_validation:  50 C0 C3 07 70 B5 37 10|P...p.7.
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_validation:  DC 8D 10 71 31 F3 FF 54|...q1..T
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_validation:  1D 39 BF 14 77 EC 79 AD|.9..w.y.
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_validation: Actual FW hash:
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_validation:  43 FB 69 A9 B1 CF FB A8|C.i.....
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_validation:  98 9C D5 89 FA D5 4D BB|......M.
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_validation:  9A 65 6E E1 30 58 CD DE|.en.0X..
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_validation:  CB 38 DB E3 D9 33 F8 07|.8...3..
00&amp;gt; &amp;lt;warning&amp;gt; nrf_dfu_serial: DFU request completed with result: 0xB
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_serial: Sending Response: [0x4, 0xB]
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_settings: Writing settings...
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_settings: Erasing old settings at: 0x0007F000
&amp;lt;debug&amp;gt; nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x0007F000, len=&amp;lt;info&amp;gt; app: Inside main&lt;/pre&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/0421_5F00_DFU_5F00_test_5F00_1755.log"&gt;devzone.nordicsemi.com/.../0421_5F00_DFU_5F00_test_5F00_1755.log&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Lurn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 OTA over ESB based on SDK17.1.0</title><link>https://devzone.nordicsemi.com/thread/421635?ContentTypeID=1</link><pubDate>Fri, 21 Apr 2023 06:47:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff1fca09-5009-4cb2-a85a-34c6b4544b2a</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;Update:&lt;/p&gt;
&lt;p&gt;1. I modify the bootloader addr and size.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/7446.flash2.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;due to the bootloader is debug mode, I can&amp;#39;t set the address to 0x78000, because if end address is 0x7E000, the size is not enough.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1682059784482v2.png" /&gt;&lt;/p&gt;
&lt;p&gt;this is my set now.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1682059915638v3.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2. Base the 1. sometime the error like this.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/0421_5F00_DFU_5F00_test_5F00_1356.log"&gt;devzone.nordicsemi.com/.../0421_5F00_DFU_5F00_test_5F00_1356.log&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Is this error because the length is not a multiple of 4 bytes?&lt;/p&gt;
&lt;p&gt;But I think this packet is the last packte, so i can&amp;#39;t decide his size.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Should I need to modify the bootloader? I mean if the target device in DFU mode need some&amp;nbsp;special state?&lt;/p&gt;
&lt;p&gt;such as the macro&amp;nbsp;NRF_DFU_SINGLE_BANK_APP_UPDATES is 0 now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 OTA over ESB based on SDK17.1.0</title><link>https://devzone.nordicsemi.com/thread/421614?ContentTypeID=1</link><pubDate>Fri, 21 Apr 2023 03:00:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d8ada81-e46d-426a-9ffe-606dd4b56e0a</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;Sorry, I still can&amp;#39;t update.&lt;/p&gt;
&lt;p&gt;this log is program the mbr, bootloader, app, settings.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/0421_5F00_DFU_5F00_test_5F00_1032.log"&gt;devzone.nordicsemi.com/.../0421_5F00_DFU_5F00_test_5F00_1032.log&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;and this is my flash region&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1682044802434v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I also try to make a script even use your script, but not worked.&lt;/p&gt;
&lt;p&gt;I was only used bootloader and mbr.hex&amp;nbsp; without application too.&lt;/p&gt;
&lt;p&gt;this log is only have bootloader and mbr.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/0421_5F00_DFU_5F00_test_5F00_1051.log"&gt;devzone.nordicsemi.com/.../0421_5F00_DFU_5F00_test_5F00_1051.log&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Is my file too large causing insufficient space? Because the return error is 4.&lt;/p&gt;
&lt;p&gt;But my application should be this size, and I can update via nrfutil.&lt;/p&gt;
&lt;p&gt;I have no idea about this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 OTA over ESB based on SDK17.1.0</title><link>https://devzone.nordicsemi.com/thread/421511?ContentTypeID=1</link><pubDate>Thu, 20 Apr 2023 13:02:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35e96a91-1bf7-4aeb-ba03-7defb4f415ee</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;At first, thanks for your help.&lt;/p&gt;
&lt;p&gt;So now you can run the DFU master correctly.&lt;/p&gt;
&lt;p&gt;Due to the time difference, I will try to modify the MAX_ACTUAL_PAYLOAD to MTU_SIZE/2 &lt;span&gt;tomorrow&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;And I used the&amp;nbsp; j-flash to program the init.bin and app.bin, it can set the offset. and&amp;nbsp;I think there won&amp;#39;t be a problem with that. If something wrong, I will make a script to do this.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Lurn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 OTA over ESB based on SDK17.1.0</title><link>https://devzone.nordicsemi.com/thread/421462?ContentTypeID=1</link><pubDate>Thu, 20 Apr 2023 11:33:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07db7293-a709-43b3-9c55-f3dd541d9edf</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Ok, so I ran the DFU Master sample (for the first time, actually).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It is correct, as you said that at least the UART sample expects the application binary to be present at address 0x30000 on the device running the DFU Master application. The init packet is expected at address 0x9000.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I found one bug that caused the bootloader to assert after the first application image packet was sent. The reason was that the bootloader was trying to write 62 bytes to flash. The reason for this was that in the DFU Master application, the&amp;nbsp;MAX_ACTUAL_PAYLOAD is set to (MTU_SIZE/2-2), which gives 62. nrf_fstorage_write requires the length of the chunk that it is going to write to be a multiple of 4 bytes. So I changed MAX_ACTUAL_PAYLOAD to MTU_SIZE/2 instead of (MTU_SIZE/2-2), and after that it worked.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So, what I did was that I unzipped the dfu image which was a zip file. Inside that file, there are 3 files. The json file we will not use. The smallest file, called new_app.dat is the init packet. I renamed it init_packet.bin. The other, which is the application file, I renamed app_image.bin. Just to keep track of what is what.&lt;/p&gt;
&lt;p&gt;Then I used this script (in a .bat file):&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;del files\dfu_img\app_image.hex
del files\dfu_img\init_packet.hex
bin2hex.py --offset 0x9000 files\dfu_img\init_packet.bin files\dfu_img\init_packet.hex
bin2hex.py --offset 0x30000 files\dfu_img\app_image.bin files\dfu_img\app_image.hex&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This generated the init packet and app image hex files, which I then programmed together with the dfu master (compiled in SDK14.2.0)&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrfjprog -e --snr 682396787
nrfjprog --program files\DFU_MASTER.hex --verify --snr 682396787
nrfjprog --program files\dfu_img\init_packet.hex --verify --snr 682396787
nrfjprog --program files\dfu_img\app_image.hex --verify --snr 682396787
nrfjprog --reset --snr 682396787&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;now, connecting the UART wires between the two DKs. Put the target DK in DFU mode, and pressed button 1 on the DFU Master. That performed the DFU transfer of the new image, and the application changed.&lt;/p&gt;
&lt;p&gt;Actually, I scripted everything, except unpacking the application image (which you could probably also script). Attached for reference:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;make -j9
make -j9 -C ..\..\..\..\peripheral\blinky\pca10056\mbr\armgcc



del files\app.hex
del files\settings.hex
del files\bl.hex
copy ..\arm5_no_packs\_build\nrf52840_xxaa_mbr.hex files\bl.hex

copy ..\..\..\..\peripheral\blinky\pca10056\mbr\armgcc\_build\nrf52840_xxaa.hex files\app.hex
nrfutil settings generate --family NRF52840 --application files\app.hex --application-version 1 --bootloader-version 1 --bl-settings-version 1 files\settings.hex

nrfjprog -e --snr 683963588
nrfjprog --program ..\..\..\..\..\components\softdevice\mbr\hex\mbr_nrf52_2.4.1_mbr.hex --verify  --snr 683963588
nrfjprog --program files\bl.hex --verify  --snr 683963588
nrfjprog --program files\app.hex --verify --snr 683963588
nrfjprog --program files\settings.hex --verify --snr 683963588
nrfjprog --reset --snr 683963588

nrfutil pkg generate --application files\new_app.hex --application-version 2 --hw-version 52 --sd-req 0x00 --key-file ..\..\..\private.key files\dfu_img.zip

timeout 10

del files\DFU_MASTER.hex
copy ..\..\..\..\..\..\14.2.0\examples\test\DFUMaster_UART\pca10040\blank\arm5_no_packs\_build\nrf52832_xxaa.hex files\DFU_MASTER.hex
del files\dfu_img\app_image.hex
del files\dfu_img\init_packet.hex
bin2hex.py --offset 0x9000 files\dfu_img\init_packet.bin files\dfu_img\init_packet.hex
bin2hex.py --offset 0x30000 files\dfu_img\app_image.bin files\dfu_img\app_image.hex

nrfjprog -e --snr 682396787
nrfjprog --program files\DFU_MASTER.hex --verify --snr 682396787
nrfjprog --program files\dfu_img\init_packet.hex --verify --snr 682396787
nrfjprog --program files\dfu_img\app_image.hex --verify --snr 682396787
nrfjprog --reset --snr 682396787
::nrfutil dfu serial -pkg files\dfu_img.zip -p COM8&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 OTA over ESB based on SDK17.1.0</title><link>https://devzone.nordicsemi.com/thread/421383?ContentTypeID=1</link><pubDate>Thu, 20 Apr 2023 07:26:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51299383-971a-4d8e-afb0-6c412690b886</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;Update:&lt;/p&gt;
&lt;p&gt;I can transfer files but never succeed.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The process is as follows.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;1. I flash the DFU master application on the master board.&lt;/p&gt;
&lt;p&gt;2. make sure my target board in DFU mode.&lt;/p&gt;
&lt;p&gt;3. program the init.bin and app.bin to master board.&lt;/p&gt;
&lt;p&gt;4. connect master board and target board.&lt;/p&gt;
&lt;p&gt;5. run the DFU master.&lt;/p&gt;
&lt;p&gt;In source code the application_image_address = 0x30000;&lt;/p&gt;
&lt;p&gt;and I get error like this&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_EXECUTE (data)
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_req_handler: Whole firmware image received. Postvalidating.
00&amp;gt; &amp;lt;error&amp;gt; app: Received a fault! id: 0x00004002, pc: 0x00000000, info: 0x200046F0&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;the full log file is here.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/0420_5F00_DFU_5F00_test_5F00_1448.log"&gt;devzone.nordicsemi.com/.../0420_5F00_DFU_5F00_test_5F00_1448.log&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In readme it shows the address.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1681975116717v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;so I change the&amp;nbsp;&lt;span&gt;application_image_address = 0x10000;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;the error log is here&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_CREATE (data)
00&amp;gt; &amp;lt;error&amp;gt; nrf_dfu_req_handler: Cannot create data object without valid init command
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_req_handler: Request handling complete. Result: 0x8
00&amp;gt; &amp;lt;warning&amp;gt; nrf_dfu_serial: DFU request completed with result: 0x8
00&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_serial: Sending Response: [0x1, 0x8]
00&amp;gt; &amp;lt;error&amp;gt; app: Received an error: 0x00000004!&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;and log file:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/0420_5F00_DFU_5F00_test_5F00_1456.log"&gt;devzone.nordicsemi.com/.../0420_5F00_DFU_5F00_test_5F00_1456.log&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Another question:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In readme it said that&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1681975335290v2.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;3)&amp;nbsp;Open the .zip file and unzip the init .dat file and the binary image .bin of the application or the softdevice/bootloader.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;it should be unzip the .zip file&amp;nbsp;instead of unzip the init.data?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Hope you can give some solutions.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Lurn&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 OTA over ESB based on SDK17.1.0</title><link>https://devzone.nordicsemi.com/thread/421357?ContentTypeID=1</link><pubDate>Thu, 20 Apr 2023 03:16:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63dc53ce-0e5e-42ae-8a12-5cd68eed49b9</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;Yes, I won&amp;#39;t run it on nRF, but&amp;nbsp;I think the quickest way to test whether there is a problem with this process is to use this example&lt;/p&gt;
&lt;p&gt;About the DFU master, I can transfer the packet successfully(i think), but my pending update device log shows no data received.&lt;/p&gt;
&lt;p&gt;The process is as follows&lt;/p&gt;
&lt;p&gt;I set the device in DFU mode, connect the DFU master with UART, then just run the DFU master.&lt;/p&gt;
&lt;p&gt;In order to confirm that there is no abnormality in my DFU mode, I use the nrfutil to update it, and it was worked.&lt;/p&gt;
&lt;p&gt;the dfu master log like this&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/dfu3.txt"&gt;devzone.nordicsemi.com/.../dfu3.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;and my device in DFU mode log is here&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/dfu.txt"&gt;devzone.nordicsemi.com/.../dfu.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Can you tell me what is wrong?&lt;/p&gt;
&lt;p&gt;Update:&lt;/p&gt;
&lt;p&gt;I checked the log when updating with nrfutil, at first I get a PING event and the data is 0x9, 0x1 with a&amp;nbsp;SLIP_BYTE_END&amp;nbsp; 0300&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;10&amp;gt; &amp;lt;info&amp;gt; nrf_dfu_serial_uart: len = 1, ret_code = 17, p_data[0] = 9
10&amp;gt; 
10&amp;gt; &amp;lt;info&amp;gt; nrf_dfu_serial_uart: len = 1, ret_code = 17, p_data[0] = 1
10&amp;gt; 
10&amp;gt; &amp;lt;info&amp;gt; nrf_dfu_serial_uart: len = 1, ret_code = 0, p_data[0] = C0
10&amp;gt; 
10&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_serial: Received ping 1
10&amp;gt; 
10&amp;gt; &amp;lt;info&amp;gt; nrf_dfu_serial_uart: Allocated buffer 20000554
10&amp;gt; 
10&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_req_handler: Handle NRF_DFU_OP_PING
10&amp;gt; 
10&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_req_handler: Request handling complete. Result: 0x1
10&amp;gt; 
10&amp;gt; &amp;lt;debug&amp;gt; nrf_dfu_serial: Sending Response: [0x9, 0x1]&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;in the DFU master, it also send the ping command log, you can see it in the dfu mater log, but my device didn&amp;#39;t get it.&lt;/p&gt;
&lt;p&gt;In order to confirm that the DFU mater send it ok, I connect it to my pc with UART, and I can get the data.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/dfu_5F00_master_5F00_uart.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;So I think maybe my device which is in DFU mode&amp;nbsp;didn&amp;#39;t receive the packet,&amp;nbsp;but why?&lt;/p&gt;
&lt;p&gt;Update 2:&lt;/p&gt;
&lt;p&gt;I found that the GND of both of them is not connected, when I connect them, I can receive data.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Lurn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 OTA over ESB based on SDK17.1.0</title><link>https://devzone.nordicsemi.com/thread/421255?ContentTypeID=1</link><pubDate>Wed, 19 Apr 2023 12:16:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:645f5966-e328-483e-9c2b-a509b94eeab9</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Regarding the 8.15.9 DeviceFamilyPack, click the &amp;quot;Select Software Packs button in the toolbar in Keil, and select &amp;quot;latest&amp;quot; instead of &amp;quot;fixed&amp;quot;:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1681905811670v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Then, you need to click &amp;quot;OK&amp;quot; -&amp;gt; &amp;quot;OK&amp;quot; (in the next popup), then right click &amp;quot;device&amp;quot; in the project menu to the left, select &amp;quot;options for...&amp;quot; then select &amp;quot;8.44.1&amp;quot; in the &amp;quot;Version&amp;quot; option (or whatever version the &amp;quot;latest&amp;quot; in the previous step selected).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As long as you placed the sample in SDK14.2.0\examples\peripheral, so that it has a similar folder structure as the other examples, it should compile.&amp;nbsp;&lt;/p&gt;
[quote user="Lurn_Z"]can you give me a code base SDK 17.1.0 ? I want to test it.[/quote]
&lt;p&gt;Sorry, I don&amp;#39;t have time to port this to 17.1.0 now. Seeing as you probably won&amp;#39;t be running this on an nRF in the end either way, and this is only to see a possible implementation, I don&amp;#39;t think you need to port it either.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What you probably want to start looking into is how the uart_send_init_packet() sends the init packet, and how uart_send_application_image() is used to send the application image (which is split over several packets).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 OTA over ESB based on SDK17.1.0</title><link>https://devzone.nordicsemi.com/thread/421244?ContentTypeID=1</link><pubDate>Wed, 19 Apr 2023 11:37:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:feaacaf8-44e1-4e41-beb0-46a74ff566f8</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;I want to port this code to an example for my SDK such as&amp;nbsp;\examples\peripheral\blinky&lt;/p&gt;
&lt;p&gt;but it have too much&amp;nbsp;Compile Error, although I included the header file still got many undefined errors.&lt;/p&gt;
&lt;p&gt;can you give me a code base SDK 17.1.0 ? I want to test it.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Lurn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 OTA over ESB based on SDK17.1.0</title><link>https://devzone.nordicsemi.com/thread/421238?ContentTypeID=1</link><pubDate>Wed, 19 Apr 2023 11:19:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c242232-baa5-45d2-a024-a12c34606db8</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;I didn&amp;#39;t find the file &amp;quot;nrf_serial_dfu.h&amp;quot;&lt;/p&gt;
&lt;p&gt;and also I did not have the pack.&lt;/p&gt;
&lt;p&gt;the download log is here.&lt;/p&gt;
&lt;p&gt;Cannot download file &lt;a href="http://developer.nordicsemi.com/nRF5_SDK/pieces/nRF_DeviceFamilyPack/NordicSemiconductor.nRF_DeviceFamilyPack.8.15.0.pack:"&gt;developer.nordicsemi.com/.../NordicSemiconductor.nRF_DeviceFamilyPack.8.15.0.pack:&lt;/a&gt; Object not found&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 OTA over ESB based on SDK17.1.0</title><link>https://devzone.nordicsemi.com/thread/421218?ContentTypeID=1</link><pubDate>Wed, 19 Apr 2023 10:35:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e6eef34-79c5-4134-b82b-3f225895f100</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;The DFU master does what the computer running nrfutil does when transferring the image.&amp;nbsp;&lt;/p&gt;
[quote user="Lurn_Z"]&lt;p&gt;what I should do is make sure my nrf-device is in DFU mode, and just run the &amp;quot;DFU Mast code&amp;quot;, am I understand currently?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;Yes.&lt;/p&gt;
&lt;p&gt;I have not tested this, but I believe there is some description saying how to do the test. Check out the DFU_SPI_readme.docx (yes, it is written for the SPI variant, but it covers your questions).&lt;/p&gt;
&lt;p&gt;It explains how to transfer the DFU image (.zip file) to the flash of the DFU master by using JFlash. I played around with .bin files the other day. The thing with these is that they are not address mapped, like hex files are. But there is a tool that you can test (pip install bin2hex.py), and you can use this to convert .bin files to .hex files with an offset, so that you can program them using nrfjprog (for testing purposes).&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;bin2hex.py --offset 0x12000000 bin_file.bin hex_file.hex
nrfjprog --program hex_file.hex&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Lurn_Z"]And a question about it, what is the format of image .hex/.bin or .zip?[/quote]
&lt;p&gt;Read the doc for the SPI sample, and you will see, but in short, it is the .bin and .dat inside the .zip that actually contains the data that is needed.&lt;/p&gt;
&lt;p&gt;BR,&lt;br /&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 OTA over ESB based on SDK17.1.0</title><link>https://devzone.nordicsemi.com/thread/421187?ContentTypeID=1</link><pubDate>Wed, 19 Apr 2023 08:42:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1407cc81-b909-4c0e-875a-dc714f4a5386</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;I read the code about &amp;quot;DFU Master&amp;quot;, I think in this code it use another nrf-device, and what I should do is make sure my nrf-device is in DFU mode, and just run the &amp;quot;DFU Mast code&amp;quot;, am I understand currently?&lt;/p&gt;
&lt;p&gt;And a question about it, what is the format of image .hex/.bin or .zip?&lt;/p&gt;
&lt;p&gt;If it&amp;nbsp;&lt;span&gt;run a part of nrfutil that does the transfer, I think it should be a .zip which made by nrfutil, Am i right?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Lurn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 OTA over ESB based on SDK17.1.0</title><link>https://devzone.nordicsemi.com/thread/421174?ContentTypeID=1</link><pubDate>Wed, 19 Apr 2023 07:56:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e26b8f5e-e9cd-4d31-af35-28e7ec270a68</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;No worries, Lurn,&lt;/p&gt;
&lt;p&gt;What you are writing makes sense to me! So we are back at having a UART bootloader without the possibility to use nrfutil, if I understand correctly.&lt;/p&gt;
&lt;p&gt;However, you could still use nrfutil to generate the DFU images on a computer, and then somehow transfer that to the computer that will transfer the image to the nrf-device, right?&lt;/p&gt;
&lt;p&gt;In that case, you would only need the ARM device to run the part of nrfutil that does the transfer, which is only a small part of nrfutil.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;While we do not have a strip down version of nrfutil, the colleague that wrote the &lt;a href="https://devzone.nordicsemi.com/guides/short-range-guides/b/software-development-kit/posts/getting-started-with-nordics-secure-dfu-bootloader"&gt;getting started with DFU guide&lt;/a&gt;&amp;nbsp;also wrote a sample application that can run on another nRF device, and will update the target nRF device over UART. Click that link, and search for &amp;quot;DFU Master Code&amp;quot;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I believe it may be easier to analyze and reverse engineer the process from that sample than it is to interpret the nrfutil source code.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately, we don&amp;#39;t have very much good documentation on nrfutil, but a couple of useful links are:&lt;/p&gt;
&lt;p&gt;A general description of the DFU procedure can be &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lib_bootloader_dfu_process.html?cp=9_1_3_5_1_0#lib_bootloader_dfu_step"&gt;found here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The UART Serial protocol is &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lib_dfu_transport_serial.html?cp=9_1_3_5_2_3"&gt;described here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Just in case, the link to &lt;a href="https://github.com/NordicSemiconductor/pc-nrfutil"&gt;nrfutil source code&lt;/a&gt;. But I find it difficult to navigate to understand the protocol.&lt;/p&gt;
&lt;p&gt;Lastly, one additional hint could be to hook on a UART to computer sniffer/analyzer, and observe an update, to see if you can make sense of the packets, as described in the links above.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best of luck!&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 OTA over ESB based on SDK17.1.0</title><link>https://devzone.nordicsemi.com/thread/421139?ContentTypeID=1</link><pubDate>Wed, 19 Apr 2023 03:49:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:506c1744-40a3-46d3-81b8-7950c31d5c36</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;Hello Edvin,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m so sorry for finding out that I&amp;#39;ve entered a misunderstanding.&lt;/p&gt;
&lt;p&gt;Originally I was saying that I need to upgrade via UART, and yes it worked, but But after I finished testing, my colleague told me that we are using ARM architecture, so I can&amp;#39;t update my nrf-device by use nrfutil, Because the source code has some libraries that cannot be ported to the host device.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So I wanted to use the bluetooth update and ask you a lot of questions about it, but when I finished work yesterday and asked my &lt;span&gt;colleague&lt;/span&gt;&amp;nbsp;about bluetooth related things ready to debug the bluetooth upgrade, he told me that our host device does not have bluetooth enabled (I Know that our host device has bluetooth, but I don&amp;#39;t know it won&amp;#39;t be used).&lt;/p&gt;
&lt;p&gt;Sorry for taking up so much of your time with these wrong questions.&lt;/p&gt;
&lt;p&gt;Let me sort out the current situation.&lt;/p&gt;
&lt;p&gt;1. I can enter the DFU mode&amp;nbsp;normally.&lt;/p&gt;
&lt;p&gt;2. I can update success via UART on PC.&lt;/p&gt;
&lt;p&gt;3. I can&amp;#39;t port the ntfutil to host device, because it use ARM.&lt;/p&gt;
&lt;p&gt;4.&amp;nbsp;Since 3 is not established, I can&amp;#39;t upgrade nrf-device on the host device.&lt;/p&gt;
&lt;p&gt;So I think the question should be how to&amp;nbsp;update nrf-device without ntfutil.&lt;/p&gt;
&lt;p&gt;And I think there is a method like this:&lt;/p&gt;
&lt;p&gt;I can receive the update file and save it to bank1, then enter the DFU mode, it will check and update itself.&lt;/p&gt;
&lt;p&gt;But I don&amp;#39;t know how to receive the file and save it to bank1.&lt;/p&gt;
&lt;p&gt;I found an &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/46336/bootloader-no-transport-dual-bank-dfu-and-dependencies"&gt;example&lt;/a&gt; made by Vidar, but it also used nrfutil.&lt;/p&gt;
&lt;p&gt;Apologies again for the previous question.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Lurn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 OTA over ESB based on SDK17.1.0</title><link>https://devzone.nordicsemi.com/thread/421041?ContentTypeID=1</link><pubDate>Tue, 18 Apr 2023 12:57:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f88c4191-3045-486a-9858-2a530d783a61</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Lurn,&lt;/p&gt;
&lt;p&gt;NRF_DFU_BLE_REQUIRES_BONDS is set to 0 in your bootloader&amp;#39;s sdk_config.h file, right?&lt;/p&gt;
&lt;p&gt;If it is not set to 0, try to set it to 0. If it is set to 0, please try to debug ble_dfu_transport_init() in nrf_dfu_ble.c.&lt;/p&gt;
&lt;p&gt;Does the line:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;if (nrf_dfu_settings_adv_name_is_valid())&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;return true? (you can simply add a log line using NRF_LOG_INFO(); and it will pop up in the log that you pasted)).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Also check if the line:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    if ((m_flags &amp;amp; DFU_BLE_FLAG_USE_ADV_NAME) != 0)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;in gap_params_init() returns true. If it does, it will use a different advertising name.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Let us start with those, and take it from there, depending on what you see.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 OTA over ESB based on SDK17.1.0</title><link>https://devzone.nordicsemi.com/thread/420964?ContentTypeID=1</link><pubDate>Tue, 18 Apr 2023 09:32:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24bfb726-c5c9-423f-93d9-a4923c18b3ea</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;I use the bootloader_ble_s132_pca10040_debug to build the bootloader.&lt;/p&gt;
&lt;p&gt;Then I use this cmd to program it.&lt;pre class="ui-code" data-mode="text"&gt;nrfutil settings generate --family NRF52 --application app.hex --application-version 0 --bootloader-version 0 --bl-settings-version 2 settings.hex

nrfjprog --eraseall -f NRF52
nrfjprog --program s132_nrf52_7.2.0_softdevice.hex --verify -f NRF52
nrfjprog --program bootloader.hex --verify -f NRF52
nrfjprog --program app.hex --verify -f NRF52
nrfjprog --program settings.hex --verify -f NRF52
nrfjprog --reset -f NRF52&lt;/pre&gt;&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/96494/nrf52832-ota-over-esb-based-on-sdk17-1-0/420464"]&lt;p&gt;Strictly speaking, we don&amp;#39;t have a size of 5A000, because the bootloader takes up address 0x71000 to 0x80000, so you can set start address 0x26000 and size 0x4B000&lt;/p&gt;
&lt;p&gt;But it wouldn&amp;#39;t be an issue unless your application is so big that it starts growing into your bootloader.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The IRAM1 settings (RAM settings) you can leave as is. The softdevice requires 8 bytes (the same as MBR) if you do not enable it in your application.&lt;/p&gt;[/quote]
&lt;p&gt;I set the application start address to 0x26000 adn size is 0x4B000, Since I&amp;#39;m not using bluetooth just ESB in my application,&amp;nbsp;no other modifications about the RAM/ROM.&lt;/p&gt;
&lt;p&gt;To enter the DFU mode, I use the&amp;nbsp;NRF_POWER_GPREGRET register.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define BOOTLOADER_DFU_GPREGRET_MASK                 (0xF8)      /**&amp;lt; Mask for GPGPREGRET bits used for the magic pattern written to GPREGRET register to signal between main app and DFU. */
#define BOOTLOADER_DFU_GPREGRET                      (0xB0)      /**&amp;lt; Magic pattern written to GPREGRET register to signal between main app and DFU. The 3 lower bits are assumed to be used for signalling purposes.*/
#define BOOTLOADER_DFU_START_BIT_MASK                (0x01)      /**&amp;lt; Bit mask to signal from main application to enter DFU mode using a buttonless service. */
#define BOOTLOADER_DFU_START    (BOOTLOADER_DFU_GPREGRET | BOOTLOADER_DFU_START_BIT_MASK)      /**&amp;lt; Magic number to signal that bootloader should enter DFU mode because of signal from Buttonless DFU in main app.*/


static void enter_dfu_mode(void)
{
    uint8_t old_gpregret = nrf_power_gpregret_get();
    UART_PRINTF(&amp;quot;get the old_gpregret = %d&amp;quot;, old_gpregret);
    uint8_t temp = 0;

    nrf_power_gpregret_set(BOOTLOADER_DFU_START);
    while((temp &amp;amp; BOOTLOADER_DFU_START) != BOOTLOADER_DFU_START)
    {
        temp = nrf_power_gpregret_get();
        UART_PRINTF(&amp;quot;temp = %d&amp;quot;, temp);
    }
    UART_PRINTF(&amp;quot;nrf_pwr_mgmt_shutdown NRF_PWR_MGMT_SHUTDOWN_GOTO_DFU and system reset.&amp;quot;);
    nrf_delay_ms(10);
    nrf_pwr_mgmt_shutdown(NRF_PWR_MGMT_SHUTDOWN_GOTO_DFU);
    NVIC_SystemReset();
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I get the log over RTT shows &amp;quot;nrf_pwr_mgmt_shutdown NRF_PWR_MGMT_SHUTDOWN_GOTO_DFU and system reset&amp;quot;, then I reconnect the RTT it shows&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;00&amp;gt; In nrf_bootloader_init
00&amp;gt; Calling nrf_dfu_settings_init()...
00&amp;gt; Initializing nrf_fstorage_nvmc backend.
00&amp;gt; Using settings page.
00&amp;gt; Copying forbidden parts from backup page.
00&amp;gt; Destination settings are identical to source, write not needed. Skipping.
00&amp;gt; Backing up settings page to address 0x7E000.
00&amp;gt; Destination settings are identical to source, write not needed. Skipping.
00&amp;gt; Enter nrf_bootloader_fw_activate
00&amp;gt; No firmware to activate.
00&amp;gt; CRC check of app failed. Return 1
00&amp;gt; App is valid
00&amp;gt; DFU mode requested via GPREGRET.
00&amp;gt; WDT is not enabled
00&amp;gt; in weak nrf_dfu_init_user
00&amp;gt; timer_stop (0x20005980)
00&amp;gt; timer_activate (0x20005980)
00&amp;gt; Entering DFU mode.
00&amp;gt; Initializing transports (found: 1)
00&amp;gt; Initializing BLE DFU transport
00&amp;gt; Setting up vector table: 0x00071000
00&amp;gt; Enabling SoftDevice.
00&amp;gt; State request: 0x00000000
00&amp;gt; Notify observer 0x0007C9E8 =&amp;gt; ready
00&amp;gt; State change: 0x00000000&lt;/pre&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;but I can&amp;#39;t find the ble name via nrf_connect on my phone. I didn&amp;#39;t change the name, so the name should be&amp;nbsp;&lt;span&gt;&amp;quot;DfuTarg&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;#ifndef NRF_DFU_BLE_ADV_NAME&lt;br /&gt;#define NRF_DFU_BLE_ADV_NAME &amp;quot;DfuTarg&amp;quot;&lt;br /&gt;#endif&lt;/p&gt;
&lt;p&gt;Can you please tell me where I am wrong?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Lurn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>