<?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>Generating bootloader settings</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/65920/generating-bootloader-settings</link><description>While exploring documentaion and trying to learn more about the DFU (and bootloader settings), I found info on how to generate the bootloader settings , which also explains why the bootloader example was booting to dfu mode the first time, and then to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 15 Sep 2020 12:13:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/65920/generating-bootloader-settings" /><item><title>RE: Generating bootloader settings</title><link>https://devzone.nordicsemi.com/thread/269647?ContentTypeID=1</link><pubDate>Tue, 15 Sep 2020 12:13:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88c783e0-4b27-48f1-8d0d-21af5f56f871</guid><dc:creator>Ricardo Rodrigues</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In between I was also experimenting and had actually already tested using mergehex to merge both my app and the bootloader settings, but was testing the flashing with nrfconnect programmer.&lt;/p&gt;
&lt;p&gt;This nrfjprog tool is much easier, and I have already placed all of this inside a nice Makefile as you suggested.&lt;/p&gt;
&lt;p&gt;I also changed the --bootloader-version from 2 to 1, as I am using SDK 12.&lt;/p&gt;
&lt;p&gt;It looks like the bootloader settings file is now correct, or you have any other suggestion?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Ricardo&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generating bootloader settings</title><link>https://devzone.nordicsemi.com/thread/269638?ContentTypeID=1</link><pubDate>Tue, 15 Sep 2020 11:49:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0543fb8-e201-4cfa-910f-7d74c2476a4c</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Ricardo,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]Thought this info to be relevant for defining the correct values for flash size (the app is currently 47604 bytes, but will probably still grow slightly).[/quote]
&lt;p&gt;&amp;nbsp;Do you refer to the application size 47604 bytes from the bootloader settings print/log? If so, this only refers to the current application. It does not mean that all future applications must have the same size. They can be smaller or larger. The bootloader settings file is specific for this application only. Whenever you run a DFU in the future, these settings will be replaced.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]how to flash this settings.hex together with the app, bootloader, softdevice, etc?[/quote]
&lt;p&gt;&amp;nbsp;You can e.g. use mergehex (part of nrfjprog).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Currently (but this may be updated only a couple of days ago. I am not sure) you can merge maximum two .hex files in one operation, so to merge the softdevice (SD), bootloader(BL), application(APP) and bootloader settings (BLS), you can use the following commands:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;mergehex --merge SD.hex BL.hex --output temp1.hex
mergehex --merge temp1.hex APP.hex --output temp2.hex
mergehex --merge temp2.hex BLS.hex --output merged_file.hex&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And all the hex files for the BL, APP, SD and BLS will be merged into merged_file.hex.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]- how can I set the &amp;quot;Softdevice Size&amp;quot; to the correct value?[/quote]
&lt;p&gt;&amp;nbsp;Look up &amp;quot;nrfutil settings generate --help&amp;quot; and look at the &amp;quot;--softdevice&amp;quot; parameter. This is not something you need. Test without this first.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]- Shouldn&amp;#39;t we also set the &amp;quot;Boot Validation CRC&amp;quot; value?[/quote]
&lt;p&gt;&amp;nbsp;no.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The file you have looks good. Try it together with your application. It is not necessary to merge the files either before testing. Just use nrfjprog to program your files.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrfjprog --eraseall
nrfjprog --program BL.hex --verify
nrfjprog --program SD.hex --verify
nrfjprog --program APP.hex --verify
nrfjprog --program BLS.hex --verify
nrfjprog --reset&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Testing like this may lead to a lot of typing. Try to save the content of this last snippet to a .bat file, e.g. create a file called test.bat. Then copy this text into that .bat file, and call &amp;quot;test.bat&amp;quot; from your command terminal.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>