<?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>Start debug buttonless dfu with bootloader</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/44932/start-debug-buttonless-dfu-with-bootloader</link><description>Hello! 
 I want merge and write via SWD full firmware, including: main firmware, bootloader, settings page. 
 When I start debug, all data correctly writed, but main firmware not start, bootloader thinks that firmware broken. After that, I update firmware</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 20 Mar 2019 12:37:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/44932/start-debug-buttonless-dfu-with-bootloader" /><item><title>RE: Start debug buttonless dfu with bootloader</title><link>https://devzone.nordicsemi.com/thread/177327?ContentTypeID=1</link><pubDate>Wed, 20 Mar 2019 12:37:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a80afd4-e8aa-460a-ab48-ec437eebd41f</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="Sergey T"]The skip of the checksum check works, and the transition to the main firmware is carried out, however, it is obvious that this option is invalid.[/quote]
&lt;p&gt;Since skipping CRC checksum works, this tells us that the flash region which the CRC is calculated for has changed. If the only difference is the FDS pages, then it seems that the FDS pages are part of the application are in this regard. That happens if the application .hex file you use to generate the bootloader settings page (via nrfutil) has some data above the FDS pages, as the CRC is calculated of everything between the lowest and highest address in the .hex file. Have you for instance put some persistent data at a specific location in flash in the application .hex file? Can you check the .hex file and verify at which address it ends?&lt;/p&gt;
&lt;p&gt;Assuming this is the case, there are two obvious solutions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The best/correct is to move the persistent data to &lt;em&gt;below&lt;/em&gt; the FDS pages. This is important for&amp;nbsp;several reasons.&lt;/li&gt;
&lt;li&gt;Alternatively, skipping the CRC check in the bootloader doe snot actually have a significant down-side. It will help if the application get accidentally corrupted, but the likelihood of that happening with a properly tested application is small. And moreover, there is anyway no way to recover from accidentally corrupting flash in the bootloader and/or SoftDevice region. So the CRC check before every boot is in fact something that seems important, but really isn&amp;#39;t for most applications.&lt;/li&gt;
&lt;/ul&gt;
[quote user="Sergey T"]FDS not included in CRC calculation, because as I write above, after update via phone, main() run with empty and with writed FDS&amp;nbsp;equally.[/quote]
&lt;p&gt;&amp;nbsp;I did not understand what you are saying here. Can you elaborate?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Start debug buttonless dfu with bootloader</title><link>https://devzone.nordicsemi.com/thread/177182?ContentTypeID=1</link><pubDate>Tue, 19 Mar 2019 21:24:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef78b657-27cc-49d9-b96b-140a58323c2c</guid><dc:creator>Turnaev</dc:creator><description>&lt;p&gt;Hello!&lt;/p&gt;
&lt;p&gt;Thanks for the answer.&lt;/p&gt;
&lt;p&gt;Changing the value of FLASH_SIZE has no effect. As it turned out, this value is not used anywhere at all, including in the flash_placement.xml file.&lt;/p&gt;
&lt;p&gt;The skip of the checksum check works, and the transition to the main firmware is carried out, however, it is obvious that this option is invalid.&lt;/p&gt;
&lt;p&gt;FDS not included in CRC calculation, because as I write above, after update via phone, main() run with empty and with writed FDS&amp;nbsp;equally.&lt;/p&gt;
&lt;p&gt;This is very strange, and could not understand yet..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Start debug buttonless dfu with bootloader</title><link>https://devzone.nordicsemi.com/thread/176751?ContentTypeID=1</link><pubDate>Mon, 18 Mar 2019 14:25:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10ccf795-2a7c-4e95-a84f-0dd59930fe9b</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The bootloader (pca10040e_ble) starts at&amp;nbsp;0x28000, and the pages immediately below are FDS pages. What you are seeing&amp;nbsp;at the beginning of the pages at 0x26000 and 0x27000 is the page tags used by FDS, which is written the first time FDS is initialized. (See &lt;a href="https://www.nordicsemi.com/DocLib/Content/SDK_Doc/nRF5_SDK/v15-3-0/lib_fds_format?1173#lib_fds_format_page"&gt;Page tag&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;The only reason I could think of that would make this prevent the bootloader from starting the application is if the CRC of the application includes the FDS pages, which will be the case if the application .hex file spans across this region in flash. Does it? If so that is probably a mistake, and you should make sure it does not happen (for instance by setting a smaller&amp;nbsp;FLASH_SIZE in the linker settings in SES when you build the application). Another thing you could do is skip the CRC check in the bootloader altogether, by modifying the call to&amp;nbsp;app_is_valid() in&amp;nbsp;dfu_enter_check() in nrf_bootloader.c, always passing false.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>