<?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>Custom Bootloader CRC check failed because of pair manag</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/79083/custom-bootloader-crc-check-failed-because-of-pair-manag</link><description>Hello Nordic team! 
 
 We are developing system on nrf52832 chip. Let me describe our system a little bit. 
 
 It is constructed out of the soft device 332, main application and custom bootloader. We are preforming update over CAN in custom bootloader</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 03 Sep 2021 10:26:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/79083/custom-bootloader-crc-check-failed-because-of-pair-manag" /><item><title>RE: Custom Bootloader CRC check failed because of pair manag</title><link>https://devzone.nordicsemi.com/thread/327941?ContentTypeID=1</link><pubDate>Fri, 03 Sep 2021 10:26:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:623138ef-6ae6-40b2-9acd-78ac5f161bc1</guid><dc:creator>Sebastijan</dc:creator><description>&lt;p&gt;Hi Eniar,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you very much. I solve everything with your suggestions.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Seba&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Bootloader CRC check failed because of pair manag</title><link>https://devzone.nordicsemi.com/thread/327928?ContentTypeID=1</link><pubDate>Fri, 03 Sep 2021 09:16:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa44f59b-b1b4-4385-a924-a86eccfe6060</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Seba,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The sdk_config.h configuration does not have any impact on the linker configuration of the application, if that is what you ask? It makes sense to take this into account yes, so that the configured application start address + size ends below the start of the FDS pages. This way you will get a build error if the application grows so large that it overlaps the FDS pages.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;einar&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Bootloader CRC check failed because of pair manag</title><link>https://devzone.nordicsemi.com/thread/327898?ContentTypeID=1</link><pubDate>Fri, 03 Sep 2021 07:35:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4973b78b-9dc3-4e75-adb2-60189270073e</guid><dc:creator>Sebastijan</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi&amp;nbsp;Einar,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you for detailed explanation.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;We tried to exclude FDS area and it worked. :) Thanks!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;One more question regarding app flash size. Probably i have to exclude area in main application also?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt; Or does this parameter &amp;quot;&lt;span&gt;FDS_VIRTUAL_PAGES = 3&lt;/span&gt;&amp;quot; already do that?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Seba&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Bootloader CRC check failed because of pair manag</title><link>https://devzone.nordicsemi.com/thread/327609?ContentTypeID=1</link><pubDate>Wed, 01 Sep 2021 12:25:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21cd22c0-4681-4baf-96dc-4312e2f00788</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Seba,&lt;/p&gt;
&lt;p&gt;I will first describe how this works in the SDK when you use the SDK bootloader (though I understand you do not).&lt;/p&gt;
&lt;p&gt;You configure the &lt;em&gt;size&lt;/em&gt; of the FDS region by macros in sdk_config.h. The FDS_VIRTUAL_PAGE_SIZE is normally 1024. This is in 4 byte words, so this is one page of 4 kB. The number of pages is specified&amp;nbsp;with&amp;nbsp;FDS_VIRTUAL_PAGES. Most SDK examples has this set to 3, but you need to check your application configuration.&lt;/p&gt;
&lt;p&gt;The end address of the FDS pages is calculated by the internal&amp;nbsp;flash_end_addr() in fds.c. This looks for a bootloader by checking a specific word in the end of the MBR params page (0xFF8). If this is set (not 0xFFFFFFFF) this holds the start address of the bootloader, and the FDS pages will be located immediately below this point. If there is no bootloader, the FDS pages will be located in the end of the flash.&lt;/p&gt;
&lt;p&gt;You can see a graphical representation of this in the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/lib_bootloader.html?cp=8_1_3_5_0_7#lib_bootloader_memory"&gt;memory layout in the bootloader documentation&lt;/a&gt;. Here FDS data is what is called&amp;nbsp;&amp;quot;Application data&amp;quot;. So for instance, if you have a bootloader that starts at&amp;nbsp;0x00078000 and use 3 pages for FDS, this means that the first FDS page will start at&amp;nbsp;&lt;span&gt;0x00075000.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The above will also be valid for your custom bootloader if it is similar to the nRF5 SDK bootloader, and use a MBR etc. If your bootloader scheme is completely&amp;nbsp;different then you need to have an overview of your memory layout and adapt the FDS implementation (specifically&amp;nbsp;flash_end_addr()) so that the FDS pages are located where you want them. And in any case you must adapt your bootloader&amp;nbsp;so that this region is not included in the region you calculate&amp;nbsp;CRC of to ensure that the application is valid.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Bootloader CRC check failed because of pair manag</title><link>https://devzone.nordicsemi.com/thread/327572?ContentTypeID=1</link><pubDate>Wed, 01 Sep 2021 11:14:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be4ca8c8-e89b-4772-bae2-ca911f8f199b</guid><dc:creator>Sebastijan</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi Einar,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks for the lightning quick response!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Could it be that your application has some data (perhaps a constant or something else) in flash *after* the FDS pages? FDS pages are normally located immediately below the bootloader, which is typically at the end of the flash, so that is not typical, but I do not know which changes you have made.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I have to check this.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Alternatively, have you adapted your custom bootloader so that the region the CRC is calculated for includes the FDS pages? If so, I would think the most sensible would be to change that so that the FDS pages are no longer part of the CRC region. After all, FDS is typically used for dynamic data.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I also like this idea.&lt;/p&gt;
&lt;p&gt;One question can you help me find where this &amp;quot;FDS&amp;quot; area is defined? I know you said below bootloader bot i meant exact location?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Seba&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Bootloader CRC check failed because of pair manag</title><link>https://devzone.nordicsemi.com/thread/327196?ContentTypeID=1</link><pubDate>Mon, 30 Aug 2021 11:49:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f1e244e9-45b9-4f62-b011-af348af24949</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Seba,&lt;/p&gt;
[quote user=""]Soft device probably does not handle its own CRC mechanism on start-up right?[/quote]
&lt;p&gt;The SoftDevice does not validate itself, no.&lt;/p&gt;
[quote user=""]Can you help us what will be best approach, we do not want to dig inside SD and &amp;quot;pair manager&amp;quot;&amp;nbsp; and changing passcode destination write because we do not want to mess something in SD.[/quote]
&lt;p&gt;I understand you have your own custom bootloader, but let me describe how this is done using the SDK bootloader. With that, the CRC is calculated for the application itself, not the entire application regions. The application in this case is everything between the application start address (first page after the SoftDevice) and the highest address in the application hex file. So, as long as the FDS regions are after the end of the application, that will not cause problems with the CRC calculation using the default SDK bootloader.&lt;/p&gt;
&lt;p&gt;A few thoughts based on that:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Could it be that your application has some data (perhaps a constant or something else) in flash *after* the FDS pages? FDS pages are normally located immediately below the bootloader, which is typically at the end of the flash, so that is not typical, but I do not know which changes you have made.&lt;/li&gt;
&lt;li&gt;Alternatively, have you adapted your custom bootloader so that the region the CRC is calculated for includes the FDS pages? If so, I would think the most sensible would be to change that so that the FDS pages are no longer part of the CRC region. After all, FDS is typically used for dynamic data.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>