<?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>OTA DFU: CRC Error Fixed after re-program bootloader</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/9716/ota-dfu-crc-error-fixed-after-re-program-bootloader</link><description>situation: 
 We are developing an nRF51 application with OTA DFU. we use SDK 9.0.0 and the DFU bootloader version is v8. We have prepared different two packages. Single OTA DFU works with the each package. Other conditions are as follows: 
 
 IC: nRF51822</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 15 Dec 2015 06:21:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/9716/ota-dfu-crc-error-fixed-after-re-program-bootloader" /><item><title>RE: OTA DFU: CRC Error Fixed after re-program bootloader</title><link>https://devzone.nordicsemi.com/thread/35954?ContentTypeID=1</link><pubDate>Tue, 15 Dec 2015 06:21:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad774790-9c42-432a-b67c-b5e8d2a9e041</guid><dc:creator>GlennEngel</dc:creator><description>&lt;p&gt;This worked for me too.l  A much cleaner fix than mine.  Hopefully Nordic has some mechanism to update all their examples with the correct pstorage_size_t definition!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: OTA DFU: CRC Error Fixed after re-program bootloader</title><link>https://devzone.nordicsemi.com/thread/35953?ContentTypeID=1</link><pubDate>Wed, 09 Dec 2015 19:57:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46af3abd-63cb-4c11-b6a0-fca42d1d7028</guid><dc:creator>Ryan Braun</dc:creator><description>&lt;p&gt;Ran into a similar issue here.&lt;/p&gt;
&lt;p&gt;As GlennEngel noted, the issue is related to erasing the swap area.  And as R. Kawajiri noted replacing pstorage_platform.h with an example resolved his issue.  The confluence of these observations revealed that pstorage_size_t is important when attempting to use pstorage for large data blocks.  The bootloader examples properly define it as uint32_t, but many of the application examples use uint16_t.  You&amp;#39;ll need something like this in your bootloader pstorage_platform.h:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;typedef uint32_t pstorage_size_t;      /** Size of length and offset fields. */
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Thanks for pointing the way, all.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: OTA DFU: CRC Error Fixed after re-program bootloader</title><link>https://devzone.nordicsemi.com/thread/35952?ContentTypeID=1</link><pubDate>Sun, 15 Nov 2015 23:34:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6696b279-fd9f-4322-809c-68e01705c74c</guid><dc:creator>GlennEngel</dc:creator><description>&lt;p&gt;The Workaround Fix: Edit dfu_types.h and change DFU_APP_DATA_RESERVED from 0 to 0x6000 and rebuild your bootloader.&lt;/p&gt;
&lt;p&gt;I had the exact same problem today and tracked it down to a bug in the bootloader erase functionality when your device has 256K Flash.  It works fine on a 128K device.&lt;/p&gt;
&lt;p&gt;The dfu_prepare_func_swap_erase function attempts to erase a swap area to temporarily store the image.  It calculates the size of the swap area by subtracting the size of the Softdevice and the bootloader from the total (256K) and dividing by two.  In my case this worked out to DFU_IMAGE_MAX_SIZE_BANKED=0x12000.&lt;/p&gt;
&lt;p&gt;This gets passed to pstorage_clear which has a uint16_t for the size parameter, resulting in the erase size getting truncated to 0x2000.  As a result, only 0x2000 bytes are being erased instead of 0x12000 which causes a CRC error when an app larger than this updates since the entire region has not been erased.&lt;/p&gt;
&lt;p&gt;I ended up setting DFU_APP_DATA_RESERVED 0x6000 to consume some extra space in the calculations and I&amp;#39;m now able to update apps and bootloader OTA from either the android app or the PC based Master Control Panel app.&lt;/p&gt;
&lt;p&gt;A better fix would be to fix the erase function to erase more than 0x10000 bytes but the above fix was easier and quicker for me.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: OTA DFU: CRC Error Fixed after re-program bootloader</title><link>https://devzone.nordicsemi.com/thread/35951?ContentTypeID=1</link><pubDate>Fri, 16 Oct 2015 00:36:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6d5e56f-4d72-4712-9faa-6d567bdf2f62</guid><dc:creator>R. Kawajiri</dc:creator><description>&lt;p&gt;I solved the problem by replace &lt;code&gt;pstorage_platform.h&lt;/code&gt; of bootloader to example one. However, I don&amp;#39;t know which configuration caused the symptoms for now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: OTA DFU: CRC Error Fixed after re-program bootloader</title><link>https://devzone.nordicsemi.com/thread/35950?ContentTypeID=1</link><pubDate>Thu, 15 Oct 2015 13:03:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3b23b35-9936-46f1-85af-2f926e267d60</guid><dc:creator>R. Kawajiri</dc:creator><description>&lt;p&gt;It seems to have failed that the bootloader erase flash for preparing swap before receiving application or bootloader image.&lt;/p&gt;
&lt;p&gt;Reason I think so:&lt;/p&gt;
&lt;p&gt;When I edit bootloader code to skip CRC check and I do OTA DFU with packages that just different device name with three characters, it almost works but the device name is strange. The device name become close from &amp;quot;ZZZ&amp;quot; to &amp;quot;AAA&amp;quot;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>