<?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>DFU Verification Failure from Custom App</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/87738/dfu-verification-failure-from-custom-app</link><description>I am writing my own DFU app for the nRF52832. I am using C# and .NET with Visual Studio. 
 For reasons I don&amp;#39;t want to get into I can&amp;#39;t use the Nordic SDK library with this project. 
 In a previous project I was able to write my own DFU process. I have</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 11 May 2022 18:00:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/87738/dfu-verification-failure-from-custom-app" /><item><title>RE: DFU Verification Failure from Custom App</title><link>https://devzone.nordicsemi.com/thread/367481?ContentTypeID=1</link><pubDate>Wed, 11 May 2022 18:00:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:85ed348b-1d5d-4c2d-b528-02fa488d8966</guid><dc:creator>Tony</dc:creator><description>&lt;p&gt;You can ignore all of this whole thread if you like. We found the problem. We found it after finally being able to get logging going in the bootloader.&lt;/p&gt;
&lt;p&gt;We then ran the DFU using the nordic nRF Connect app. Then we took a log with ours.&lt;/p&gt;
&lt;p&gt;For reasons related to how our app was doing things we found that we were only sending 178 bytes, but the nordic app was sending 180.&lt;/p&gt;
&lt;p&gt;We got flash write failures when we only sent 178 bytes. I fixed that and now everything is working fine.&lt;/p&gt;
&lt;p&gt;I never got any other errors to indicate this was the issue, however, so it would be nice if the bootloader or SDK would be able to either handle blocks != 180 bytes or give some error on the command channel that would have been caught indicating what was going on.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Verification Failure from Custom App</title><link>https://devzone.nordicsemi.com/thread/367470?ContentTypeID=1</link><pubDate>Wed, 11 May 2022 15:41:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b29950fc-b64e-4428-aa40-e35e2dd1e0ff</guid><dc:creator>Tony</dc:creator><description>&lt;p&gt;We figured out how to fit the bootloader in the flash. We moved it down in flash by 0x1000 and then increased the size by the same.&lt;/p&gt;
&lt;p&gt;Now when we debug the bootloader it is stopping with an error on Stopped by Vector Catch. It is basically hard faulting.&lt;/p&gt;
&lt;p&gt;We are erasing the app so it should in theory stay in the bootloader. We want to be able to debug the bootloader.&lt;/p&gt;
&lt;p&gt;What are we doing wrong?&lt;/p&gt;
&lt;p&gt;Nevermind. We changed from being just 0x1000 larger to being 64k instead of 32k. Turns out it must be on some kind of even boundary or something.&lt;/p&gt;
&lt;p&gt;Now we are trying to figure out why the logging isn&amp;#39;t showing up.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Verification Failure from Custom App</title><link>https://devzone.nordicsemi.com/thread/367458?ContentTypeID=1</link><pubDate>Wed, 11 May 2022 14:55:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e0ab8060-f38b-4579-b467-5573c47d1ff0</guid><dc:creator>Tony</dc:creator><description>&lt;p&gt;We are trying to get set up to actually debug the bootloader. We are running into some trouble. If we enable the logging so we can watch the output, the bootloader doesn&amp;#39;t fit in the flash anymore.&lt;/p&gt;
&lt;p&gt;We think it should be able to because we do have logging turned on for our APP and can see logging output from it.&lt;/p&gt;
&lt;p&gt;Can you help us get the bootloader so that we can build with logging turned on? We build the bootloader from your standard example with very little change. We just need help setting up the build config or linker script or ???? to get it to output debug logging messages.&lt;/p&gt;
&lt;p&gt;We will then try doing DFU using the nRF Connect app (which works) and then using our app and compare the debug output.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Verification Failure from Custom App</title><link>https://devzone.nordicsemi.com/thread/367361?ContentTypeID=1</link><pubDate>Wed, 11 May 2022 10:11:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7b820b7-6b32-48cb-a9d0-7c21eb8ccf2a</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There is no real documentation for the init packet unfortunately (though you can get some hints on it and how it is built using Google&amp;#39;s protocol buffer in &lt;a href="https://infocenter.nordicsemi.com/topic/ug_nrfutil/UG/nrfutil/nrfutil_customizing.html"&gt;Customizing the init packet&lt;/a&gt;), but it should not matter though. It is generated by nRF Util, and the DFU master only transports it, and then it is read by the bootloader.&lt;/p&gt;
&lt;p&gt;The init packet (init command) is stored in the bootloader settings page (see &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/structnrf__dfu__settings__t.html"&gt;nrf_dfu_settings_t&lt;/a&gt;), so by comparing the flash as suggested before you will see if there is an issue with the init packet as well as the other data you have transferred. This should more or less immediately tell you exactly where you need to look closer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Verification Failure from Custom App</title><link>https://devzone.nordicsemi.com/thread/367256?ContentTypeID=1</link><pubDate>Tue, 10 May 2022 20:01:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c172555-8e67-4065-8fc7-06a445fba924</guid><dc:creator>Tony</dc:creator><description>&lt;p&gt;Can you please send me the Init packet format specifically the hash for the .bin file and where I can find it? The only thing that makes sense is that my init packet is not getting sent correctly from my app or processed correctly. We have looked in the docs and they say to look in the bootloader example. We looked there and can&amp;#39;t find the exact format being used to determine which bytes are the hash.&amp;nbsp; I would also like to privately send you our init packet file so you can help better.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Verification Failure from Custom App</title><link>https://devzone.nordicsemi.com/thread/367215?ContentTypeID=1</link><pubDate>Tue, 10 May 2022 14:14:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8c810a8-64e8-480f-8ffa-7f6c285b10ce</guid><dc:creator>Tony</dc:creator><description>&lt;p&gt;I am not even sure how to go about all of that. I would like to send you my DFU .zip file and log of my process. Maybe you will spot something that will help. How do I send you some private files?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Verification Failure from Custom App</title><link>https://devzone.nordicsemi.com/thread/367202?ContentTypeID=1</link><pubDate>Tue, 10 May 2022 13:32:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ed0fe73-fdbf-4216-bd7f-09e87d331651</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;That is a good question. The only reason for getting&amp;nbsp;EXT_ERROR_VERIFICATION_FAILED is if postvalidation fails because the firmware hash is not correct there. Perhaps you can use for instance nrfutil to perform a DFU, and abort the operation before activating, so that you can compare the flash content of the nRF with what you have when you use your DFU master implementation? There should be a difference there, and perhaps knowing what is different where would give some pointers.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Verification Failure from Custom App</title><link>https://devzone.nordicsemi.com/thread/367030?ContentTypeID=1</link><pubDate>Mon, 09 May 2022 20:27:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5bb437e6-aeb4-4219-8845-3a81932d9628</guid><dc:creator>Tony</dc:creator><description>&lt;p&gt;Well, I just wrote out each small 124 byte chunk that I am sending over BLE and which is matching the checksum that I do after sending a whole 4096 bytes and read that resulting file from the Android phone and compared it to the .bin file inside the .zip file I am using for DFU and the files match exactly.&lt;/p&gt;
&lt;p&gt;So what else could be the issue?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Verification Failure from Custom App</title><link>https://devzone.nordicsemi.com/thread/367029?ContentTypeID=1</link><pubDate>Mon, 09 May 2022 19:07:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e8918c1-38c6-42c5-8155-f485af6f7787</guid><dc:creator>Tony</dc:creator><description>&lt;p&gt;This makes sense. I will try dumping the raw bytes as I send them and compare to the raw bytes contained in the .zip file and see if there is a diff.&lt;/p&gt;
&lt;p&gt;Can you confirm that the blocks of 4096 bytes put together should match the raw .bin file in the .zip file that is the DFU bundle?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Verification Failure from Custom App</title><link>https://devzone.nordicsemi.com/thread/367028?ContentTypeID=1</link><pubDate>Fri, 29 Apr 2022 11:36:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d894b098-d965-4e93-b9a8-5b125f435e38</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Tony,&lt;/p&gt;
[quote user=""]If I tried to use that same .zip file with my process it gets a&amp;nbsp;EXT_ERROR_VERIFICATION_FAILED at the final step when I do the Execute operation.[/quote]
&lt;p&gt;This means that has been transferred to the nRF is corrupt, as the hash does not match the hash in the init packet.&lt;/p&gt;
[quote user=""]I then download the 107K binary data file in 4096 byte chunks. All chunk checksums match during the download.[/quote]
&lt;p&gt;These are checksums generated by your, app so in itself that does not mean that there was no issue. I do not have any insight into your DFU master application, but my gut feeling would be that perhaps there is an issue with how you segment the image chunks before sending them? You could perhaps dump the flash memory of the nRF right before the execute operation using one of our working implantations and your implementation, and compare the two dumps. That would hopefully give some insight into where you should look.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>