<?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 Migration From SDK v15.0 to SDK v15.3</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/46238/dfu-migration-from-sdk-v15-0-to-sdk-v15-3</link><description>Hello, 
 
 I am looking into migrating DFU and Bootloader over BLE from SDK v15.0 to SDK v15.3. I have a few questions about the code changes which I was hoping I could get some clarification on: 
 
 
 
 Why is s_dfu_settings.boot_validation_* being populated</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 23 Apr 2019 18:21:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/46238/dfu-migration-from-sdk-v15-0-to-sdk-v15-3" /><item><title>RE: DFU Migration From SDK v15.0 to SDK v15.3</title><link>https://devzone.nordicsemi.com/thread/183233?ContentTypeID=1</link><pubDate>Tue, 23 Apr 2019 18:21:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:052308db-14ea-419e-adba-a8130f8ea9d7</guid><dc:creator>suhaibish</dc:creator><description>&lt;p&gt;Awesome, just wanted to confirm that I wasn&amp;#39;t missing any failure modes for some of these checks. I will optimize these locally to help&amp;nbsp;minimize DFU&amp;nbsp;time. Thanks a lot!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Migration From SDK v15.0 to SDK v15.3</title><link>https://devzone.nordicsemi.com/thread/183230?ContentTypeID=1</link><pubDate>Tue, 23 Apr 2019 18:19:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84984092-c4e7-4564-95e2-263adb719fb9</guid><dc:creator>suhaibish</dc:creator><description>&lt;p&gt;Ah yeah, good point, the boot validation info is copied from the signature in&amp;nbsp;boot_validation_extract then computed and verified in&amp;nbsp;nrf_dfu_validation_boot_validate. That seems more reasonable than the crc32 and hash cases.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Migration From SDK v15.0 to SDK v15.3</title><link>https://devzone.nordicsemi.com/thread/183228?ContentTypeID=1</link><pubDate>Tue, 23 Apr 2019 18:11:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b08408c-cdb5-4f9a-9193-0cb67f4ff834</guid><dc:creator>suhaibish</dc:creator><description>&lt;p&gt;Yeah, you&amp;#39;re right, the second point is an unlikely failure mode. I think my real issue is that for dual bank updates, we&amp;#39;re computing the &amp;quot;boot validation&amp;quot; CRC on the image in bank 1 even though it will be copied to bank 0 during activation. I would think this CRC would be populated by the crc_compute after image_copy is called in&amp;nbsp;app_activate . Since you&amp;#39;re saying it&amp;#39;s convention to do it in postvalidate, I&amp;#39;ll probably make this change locally.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Migration From SDK v15.0 to SDK v15.3</title><link>https://devzone.nordicsemi.com/thread/183109?ContentTypeID=1</link><pubDate>Tue, 23 Apr 2019 12:09:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71c7f9e6-c97f-4ac4-add5-55bf254facb9</guid><dc:creator>&amp;#216;yvind R&amp;#248;nningstad</dc:creator><description>[quote userid="77220" url="~/f/nordic-q-a/46238/dfu-migration-from-sdk-v15-0-to-sdk-v15-3"]Why does postvalidate perform a crc32_compute? In SDK v15.0, s_dfu_settings.progress.firmware_image_crc was being used, but that&amp;#39;s been changed to compute it in postvalidate. It seems to me that an application update has up to 4 computations of CRC/hashes (fw_hash_ok, boot_validation_extract, nrf_dfu_validation_boot_validate, postvalidate,) which aren&amp;#39;t all necessary.[/quote]
&lt;p&gt;You&amp;#39;re absolutely right that not all these are necessary. It hasn&amp;#39;t been&amp;nbsp;optimized in this way, but we might do so in the future.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Migration From SDK v15.0 to SDK v15.3</title><link>https://devzone.nordicsemi.com/thread/183108?ContentTypeID=1</link><pubDate>Tue, 23 Apr 2019 12:07:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3701faa3-2825-42da-a232-cb56fb9ee52d</guid><dc:creator>&amp;#216;yvind R&amp;#248;nningstad</dc:creator><description>[quote userid="77220" url="~/f/nordic-q-a/46238/dfu-migration-from-sdk-v15-0-to-sdk-v15-3"]Why is nrf_dfu_validation_boot_validate being called in boot_validation_extract? It seems redundant as we’re recomputing a crc/hash/signature check that we just performed, on data that isn’t in its boot location (for dual bank updates.)[/quote]
&lt;p&gt;This is part of checking the integrity/validity of the init&amp;nbsp;command. It&amp;#39;s a better-safe-than-sorry thing, to make absolutely sure it will boot properly. The CRC and hash would be the same as just calculated, so they could probably be streamlined, but the signature is not quite the same BTW.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU Migration From SDK v15.0 to SDK v15.3</title><link>https://devzone.nordicsemi.com/thread/183104?ContentTypeID=1</link><pubDate>Tue, 23 Apr 2019 12:04:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d3808b2-e8dd-443e-93f9-23861511405b</guid><dc:creator>&amp;#216;yvind R&amp;#248;nningstad</dc:creator><description>[quote userid="77220" url="~/f/nordic-q-a/46238/dfu-migration-from-sdk-v15-0-to-sdk-v15-3"]Why is s_dfu_settings.boot_validation_* being populated after data transfer?[/quote]
&lt;p&gt;You mean, during postvalidate()? This has become convention. You&amp;#39;re right that it could instead be done during activation, but&amp;nbsp;there isn&amp;#39;t anything that happens between postvalidation and activation (except, possibly a reboot), so it hasn&amp;#39;t been viewed as an issue.&lt;/p&gt;
[quote userid="77220" url="~/f/nordic-q-a/46238/dfu-migration-from-sdk-v15-0-to-sdk-v15-3"]I think currently if there’s some failure between postvalidate and the start of activation, we will no longer be able to boot into the old application, even though we should be able to.[/quote]
&lt;p&gt;I see your point, but there isn&amp;#39;t anything that can go wrong in a&amp;nbsp;recoverable way in that time frame, the data is just &amp;quot;at rest&amp;quot;, so a failure&amp;nbsp;at this point (highly unlikely) means the whole flash (including the old app) is untrustable.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>