<?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>Firmware on  custom board (Application + Bootloader)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/51423/firmware-on-custom-board-application-bootloader</link><description>I&amp;#39;ve reached a critical point in the firmware development process where I need to start considering integrating a bootloader with the application code. 
 I have a custom board with an nrf52840 SoC. I have created a new bsp for the board and I&amp;#39;m able to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 21 Oct 2019 13:22:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/51423/firmware-on-custom-board-application-bootloader" /><item><title>RE: Firmware on  custom board (Application + Bootloader)</title><link>https://devzone.nordicsemi.com/thread/215947?ContentTypeID=1</link><pubDate>Mon, 21 Oct 2019 13:22:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7e2a0d3-816e-4329-b311-ad804452f494</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I believe this post has become a duplicate of your latest ticket:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/53464/generating-production-image-without-dfu-ota"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/53464/generating-production-image-without-dfu-ota&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Let us follow up in that thread, and give me a detailed explanation on how you determine that &amp;quot;it doesn&amp;#39;t work&amp;quot;, and what it says when you program the different parts (BL, SD, BL_settings, application).&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware on  custom board (Application + Bootloader)</title><link>https://devzone.nordicsemi.com/thread/215944?ContentTypeID=1</link><pubDate>Mon, 21 Oct 2019 13:16:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26b65099-ea74-428d-89b8-510ad53eb8d5</guid><dc:creator>Tim Adu</dc:creator><description>&lt;p&gt;Also, do you think this is a bit odd: I generate the bootloader settings, read it out immediately, and the start address is different, plus I get a warning message: &lt;strong&gt;Bad access at 0x7F000: not enough data to read 4 contiguous bytes:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="bat"&gt;Generated Bootloader DFU settings .hex file and stored it in: ../production/images/ns_wms_bootloader_settings.hex

Bootloader DFU Settings:
* File:                     ../production/images/ns_wms_bootloader_settings.hex
* Family:                   NRF52840
* Start Address:            0x000FF000
* CRC:                      0x390CDFC7
* Settings Version:         0x00000001 (1)
* App Version:              0x00000000 (0)
* Bootloader Version:       0x00000000 (0)
* Bank Layout:              0x00000000
* Current Bank:             0x00000000
* Application Size:         0x0002AD34 (175412 bytes)
* Application CRC:          0x2D2EC708
* Bank0 Bank Code:          0x00000001
* Softdevice Size:          0x00024E7C (151164 bytes)
* Boot Validation CRC:      0x00000000
* SD Boot Validation Type:  0x00000000 (0)
* App Boot Validation Type: 0x00000000 (0)

Bad access at 0x7F000: not enough data to read 4 contiguous bytes

Bootloader DFU Settings:
* File:                     ../production/images/ns_wms_bootloader_settings.hex
* Family:                   NRF52840
* Start Address:            0x000FE000
* CRC:                      0x390CDFC7
* Settings Version:         0x00000001 (1)
* App Version:              0x00000000 (0)
* Bootloader Version:       0x00000000 (0)
* Bank Layout:              0x00000000
* Current Bank:             0x00000000
* Application Size:         0x0002AD34 (175412 bytes)
* Application CRC:          0x2D2EC708
* Bank0 Bank Code:          0x00000001
* Softdevice Size:          0x00000000 (0 bytes)
* Boot Validation CRC:      0x00000000
* SD Boot Validation Type:  0x00000000 (0)
* App Boot Validation Type: 0x00000000 (0)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Any thoughts about this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware on  custom board (Application + Bootloader)</title><link>https://devzone.nordicsemi.com/thread/215921?ContentTypeID=1</link><pubDate>Mon, 21 Oct 2019 12:32:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da900f05-a0cb-4600-a0ea-76c17b7cc5e2</guid><dc:creator>Tim Adu</dc:creator><description>&lt;p&gt;I tried it. It didn&amp;#39;t work. My updated script:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="batchfile"&gt;#---------- Settings ----------------#
device_family=&amp;quot;NRF52840&amp;quot;
app_image_path=&amp;quot;../path_to_production_app_hex/application.hex&amp;quot;
app_version=&amp;quot;0&amp;quot;
bl_version=&amp;quot;0&amp;quot;
bl_settings_version=&amp;quot;1&amp;quot;
key_file=&amp;quot;../path_to_generated_keys/private.key&amp;quot;
output_file=&amp;quot;../path_to_store_generated_bl_settings/bootloader_settings.hex&amp;quot;
softdevice_file=&amp;quot;../path_to_softdevice_image/s140_nrf52_6.1.0_softdevice.hex&amp;quot;
#-----------------------------------#

echo &amp;quot;---------------------------------------------------------------&amp;quot;

#Delete any existing bootloader settings image
rm -f $output_file
nrfutil settings generate --family $device_family --application $app_image_path --application-version $app_version --bootloader-version $bl_version --bl-settings-version $bl_settings_version --softdevice $softdevice_file --key-file $key_file $output_file&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I read a thread with a similar problem: &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/19068/uploading-application-and-bootloader-application-not-starting"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/19068/uploading-application-and-bootloader-application-not-starting&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Is&amp;nbsp; there maybe an equivalent way to do it in SDK 15.2.0&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware on  custom board (Application + Bootloader)</title><link>https://devzone.nordicsemi.com/thread/215910?ContentTypeID=1</link><pubDate>Mon, 21 Oct 2019 11:56:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16a559dd-3c70-4b42-8de9-5f8e244824a7</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;My last question&lt;/p&gt;
[quote user="Edvin Holmseth"]Did you use the corresponding public and private key in the bootloader and bootloader settings, respectively?[/quote]
&lt;p&gt;&amp;nbsp;You don&amp;#39;t use your key to sign off the application image when you create your bootloader settings? Can you try to add the following:&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;em&gt;--key-file private.key&amp;quot;&lt;/em&gt; before $output_file&lt;/p&gt;
&lt;p&gt;That should create the correct signature for your file, so that the bootloader will accept the application if you flash it together with the BL + SD + app + BL_settings.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Yes, unfortunately, the bootloader settings is not part of the guide.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware on  custom board (Application + Bootloader)</title><link>https://devzone.nordicsemi.com/thread/215668?ContentTypeID=1</link><pubDate>Fri, 18 Oct 2019 09:58:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b76719a-e3f9-4e8e-a6f3-09e69a7bdfbd</guid><dc:creator>Tim Adu</dc:creator><description>[quote userid="26071" url="~/f/nordic-q-a/51423/firmware-on-custom-board-application-bootloader/215637"]Did you use the corresponding public and private key in the bootloader and bootloader settings, respectively?[/quote]
&lt;p&gt;Okay.. I think I see what you are referring to there. I just saw in the nrfutil settings generate help text that there is an option of validating the boot using the private key. Is that what you mean?&lt;/p&gt;
&lt;p&gt;If that&amp;#39;s the case, then this was completely omitted from the tutorials. Can you describe exactly the syntax then for validating using the private key?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware on  custom board (Application + Bootloader)</title><link>https://devzone.nordicsemi.com/thread/215664?ContentTypeID=1</link><pubDate>Fri, 18 Oct 2019 09:26:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5991b2d9-a7d1-4c67-b066-d83b28d331a2</guid><dc:creator>Tim Adu</dc:creator><description>&lt;ol&gt;
&lt;li&gt;I started with the pca10056_ble project. The only change I made was removing the dummy/default public_key.c and replacing with the one I generated using nrfutil&lt;/li&gt;
&lt;li&gt;Below is the shell script I made to generate the bootloader settings:&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="batchfile"&gt;---------- Settings ----------------#
device_family=&amp;quot;NRF52840&amp;quot;
app_image_path=&amp;quot;../production/images/application_v2.hex&amp;quot;
app_version=&amp;quot;0&amp;quot;
bl_version=&amp;quot;0&amp;quot;
bl_settings_version=&amp;quot;1&amp;quot;
output_file=&amp;quot;../production/images/bootloader_settings.hex&amp;quot;
#-----------------------------------#

#Delete any existing bootloader settings image
rm -f $output_file
nrfutil settings generate --family $device_family --application $app_image_path --application-version $app_version --bootloader-version $bl_version --bl-settings-version $bl_settings_version $output_file&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;(I am using the latest nrfutil version (5.2.0).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;3. I followed the guide here: &lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/getting-started-with-nordics-secure-dfu-bootloader"&gt;https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/getting-started-with-nordics-secure-dfu-bootloader&lt;/a&gt; (steps A1 and A2) to generate the public and private keys.&lt;/p&gt;
&lt;p&gt;What exactly do you mean in your last question?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware on  custom board (Application + Bootloader)</title><link>https://devzone.nordicsemi.com/thread/215637?ContentTypeID=1</link><pubDate>Fri, 18 Oct 2019 07:05:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af4d54e1-f03a-4d65-bbe9-2e427cf3c4cc</guid><dc:creator>Edvin</dc:creator><description>[quote user="TimA"]What I need now is for the bootloader to load the applicaton without having to do DFU/OTA update.[/quote]
&lt;p&gt;&amp;nbsp;I understand, but I am trying to rule out mistakes. Maybe you have not generated the keys correctly.&lt;/p&gt;
&lt;p&gt;Let me try another way, then.&lt;/p&gt;
&lt;p&gt;Have you done&amp;nbsp;&lt;strong&gt;any&lt;/strong&gt; changes to the bootloader project? What bootloader project did you start with? the pca10056_ble_debug or pca10056_ble?&lt;/p&gt;
&lt;p&gt;What nrfutil command did you use to generate the bootloader settings?&lt;/p&gt;
&lt;p&gt;Did you use the corresponding public and private key in the bootloader and bootloader settings, respectively?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware on  custom board (Application + Bootloader)</title><link>https://devzone.nordicsemi.com/thread/215566?ContentTypeID=1</link><pubDate>Thu, 17 Oct 2019 14:20:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93b94917-7228-4206-b5db-57150f8dc699</guid><dc:creator>Tim Adu</dc:creator><description>&lt;p&gt;What I need now is for the bootloader to load the applicaton without having to do DFU/OTA update.&lt;/p&gt;
&lt;p&gt;I just read this thread:&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/19068/uploading-application-and-bootloader-application-not-starting"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/19068/uploading-application-and-bootloader-application-not-starting&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So I&amp;#39;m guessing my device is stuck in bootloader mode.&lt;/p&gt;
&lt;p&gt;How can I force the bootloader to load the application?&lt;/p&gt;
&lt;p&gt;Also, I read this line in nrf_bootloader_app_start.c:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;uint32_t start_addr = MBR_SIZE; // Always boot from end of MBR. If a SoftDevice is present, it will boot the app.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;quot;if a softdevice is present, it will boot the app.&amp;quot; How do we ensure that either the MBR or softdevice boots the application?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Tim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware on  custom board (Application + Bootloader)</title><link>https://devzone.nordicsemi.com/thread/215526?ContentTypeID=1</link><pubDate>Thu, 17 Oct 2019 12:52:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87e9e48c-3863-4612-af59-f1d2e59a897c</guid><dc:creator>Edvin</dc:creator><description>[quote user="TimA"]It says the sSoftDevice size is 0 bytes! I find that a bit odd. What do you think?[/quote]
&lt;p&gt;&amp;nbsp;That should be fine. It says when I generate the bl_settings here as well.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Does the application start if you flash only the bootloader + SD, and then you upload the application via DFU using nRF Connect?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware on  custom board (Application + Bootloader)</title><link>https://devzone.nordicsemi.com/thread/215498?ContentTypeID=1</link><pubDate>Thu, 17 Oct 2019 11:58:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99f7297b-b255-4c7f-89ae-3a35d8bbd75f</guid><dc:creator>Tim Adu</dc:creator><description>&lt;p&gt;Well I think I almost figured it out. This&amp;nbsp; tutorial was super helpful:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/getting-started/posts/adjustment-of-ram-and-flash-memory"&gt;https://devzone.nordicsemi.com/nordic/short-range-guides/b/getting-started/posts/adjustment-of-ram-and-flash-memory&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I had to change the start address of the application and integrate the softdevice into my application.&lt;/p&gt;
&lt;p&gt;I managed to merge all files successfully, but the application still does not start. I used nRF Connect to watch my new image like you illustrated above and it looks as expected, based on the memory map described here: &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.2.0/lib_bootloader.html"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.2.0/lib_bootloader.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/app_5F00_production_5F00_image.hex"&gt;devzone.nordicsemi.com/.../app_5F00_production_5F00_image.hex&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;(See the attached hex file).&lt;/p&gt;
&lt;p&gt;Right now the softdevice is integrated in the application, but not initialized (as I mentioned in the beginning, we are not implementing any BLE features for now).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Any ideas on why the application still does not start?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here are the contents of the bootloader settings:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;Bootloader DFU Settings:
* File: &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; ns_bootloader_setting.hex
* Family: &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; NRF52840
* Start Address:&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; 0x000FF000
* CRC:&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; 0x48172AA9
* Settings Version: &amp;#160; &amp;#160; &amp;#160; &amp;#160; 0x00000001 (1)
* App Version:&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; 0x00000000 (0)
* Bootloader Version: &amp;#160; &amp;#160; &amp;#160; 0x00000000 (0)
* Bank Layout:&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; 0x00000000
* Current Bank: &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; 0x00000000
* Application Size: &amp;#160; &amp;#160; &amp;#160; &amp;#160; 0x0001F688 (128648 bytes)
* Application CRC:&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; 0x05F5197F
* Bank0 Bank Code:&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; 0x00000001
* Softdevice Size:&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; 0x00000000 (0 bytes)
* Boot Validation CRC:&amp;#160; &amp;#160; &amp;#160; 0x00000000
* SD Boot Validation Type:&amp;#160; 0x00000000 (0)
* App Boot Validation Type: 0x00000000 (0)
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It says the sSoftDevice size is 0 bytes! I find that a bit odd. What do you think?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Tim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware on  custom board (Application + Bootloader)</title><link>https://devzone.nordicsemi.com/thread/215214?ContentTypeID=1</link><pubDate>Wed, 16 Oct 2019 08:03:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f6f12f1-0b3c-40e0-ad8b-516fe004cfdf</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Tim,&lt;/p&gt;
&lt;p&gt;Your app.hex looks a bit strange.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Does your app use the softdevice?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The app.hex, does that come from when you compiled the application, or did you do a flash dump after programming it? The reason I ask is that when I watch your app.hex with nRF Connect -&amp;gt; Programmer it looks like this:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-cb16f9451d154ad5ba21c5c983fdead5/pastedimage1571212753448v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;So the application has not put aside any space for the softdevice, which should be on the bottom/start. In addition, there is something in the top/end of the flash. what is that?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Does your application work if you program only app.hex and softdevice? It probably will not, because it doesn&amp;#39;t have space for the flash, but what I mean is that it will not work to merge them if you can&amp;#39;t flash both simultaneously.&lt;/p&gt;
&lt;p&gt;So basically, you need to make your application work while you set aside space for the softdevice. Please refer to one of the ble_peripheral examples and the flash settings. If you are unsure on how to do that, please let me know what IDE you use, and I can give you some pointers.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware on  custom board (Application + Bootloader)</title><link>https://devzone.nordicsemi.com/thread/215080?ContentTypeID=1</link><pubDate>Tue, 15 Oct 2019 12:38:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f41425e-cc5b-4d18-8c7f-b8d091a0ffef</guid><dc:creator>Tim Adu</dc:creator><description>&lt;p&gt;Alright, so I tried merging in this order:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Bootloader and bootloader settings =&amp;gt; OK&lt;/li&gt;
&lt;li&gt;Merged bootloader and Application =&amp;gt; OK&lt;/li&gt;
&lt;li&gt;Application (+Bootloader +Settings) and Softdevice =&amp;gt; FAIL&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;1. Do I have to change the start address of any of the components, or is this handled by the mergehex utility?&lt;/p&gt;
&lt;p&gt;2. Is the merge order relevant?&lt;/p&gt;
&lt;p&gt;3. My application currently doesn&amp;#39;t include the SoftDevice. For now it&amp;#39;s a completely &amp;quot;bluetooth-less&amp;quot; application. Could this be an issue?&lt;/p&gt;
&lt;p&gt;Here are my hex files:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/app.hex"&gt;devzone.nordicsemi.com/.../app.hex&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/7043.bootloader_5F00_settings.hex"&gt;devzone.nordicsemi.com/.../7043.bootloader_5F00_settings.hex&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/secure_5F00_ble_5F00_s140_5F00_bootloader.hex"&gt;devzone.nordicsemi.com/.../secure_5F00_ble_5F00_s140_5F00_bootloader.hex&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/s140_5F00_nrf52_5F00_6.1.0_5F00_softdevice.hex"&gt;devzone.nordicsemi.com/.../s140_5F00_nrf52_5F00_6.1.0_5F00_softdevice.hex&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Tim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware on  custom board (Application + Bootloader)</title><link>https://devzone.nordicsemi.com/thread/214902?ContentTypeID=1</link><pubDate>Mon, 14 Oct 2019 14:51:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af1e42cd-7ef9-4be8-9122-3400cb63ac7d</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;The conflicts are probably because you try to merge MBR and the softdevice. The MBR is already included in the Softdevice, so you don&amp;#39;t need both.&lt;/p&gt;
&lt;p&gt;Try to merge the softdevice, application and bootloader (+Settings). There shouldn&amp;#39;t be any conflicting areas there.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware on  custom board (Application + Bootloader)</title><link>https://devzone.nordicsemi.com/thread/214795?ContentTypeID=1</link><pubDate>Mon, 14 Oct 2019 11:13:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d725b6fc-fa66-4b2f-a451-084dd6195e1b</guid><dc:creator>Tim Adu</dc:creator><description>&lt;p&gt;Alright. I finally have time to do this. I&amp;#39;m dedicating this week to get this to work.&lt;br /&gt;Thanks for your previous reply.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Could I also just merge the MBR with the image and flash the output image as a single hex file?&lt;/li&gt;
&lt;li&gt;Do these hex images need to be merged in any particular order?&lt;/li&gt;
&lt;li&gt;When I try merging the Bootloader (+settings), Application, MBR and Softdevice, I get an error - &amp;quot;the hex file cannot be merged since there are conflicts&amp;quot;. How can I determine the conflict source?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;And FYI, I&amp;#39;m going for the BLE bootloader&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;br /&gt;Thanks&lt;br /&gt;&lt;br /&gt;Tim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware on  custom board (Application + Bootloader)</title><link>https://devzone.nordicsemi.com/thread/210960?ContentTypeID=1</link><pubDate>Fri, 20 Sep 2019 13:32:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c492b58b-ed84-458c-8b61-1e5c18d20774</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;You can merge all the hex files and program them in one go. That shouldn&amp;#39;t be a problem.&lt;/p&gt;
&lt;p&gt;Are you still working on the serial bootloader? Again, I have to say that if you intend to use the BLE bootloader in the end, it is easier to work with the BLE bootloader. If anything, it will advertise as &amp;quot;DfuTarg&amp;quot; if there is something wrong with the bootloader settings, so you should know that something is working.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you don&amp;#39;t use the softdevice in your bootloader, you still need the MBR. It is found in SDK\components\softdevice\mbr\nrf52840\hex\mbr_nrf52_2.4.1_mbr.hex.&lt;/p&gt;
&lt;p&gt;merge this with your bootloader.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="TimA"]How do I debug this? (I need to generate an image that can be flashed at the factory, so it cannot be a dfu package)[/quote]
&lt;p&gt;&amp;nbsp;It is a bit tricky to debug the bootloader project, because turning off optimization makes the project too big for the size limit of the flash area (since the bootloader is placed near the end of the flash, unlike a normal application that will typically start at the start of flash.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="TimA"]When flashing the device, should it be done in stages (bootloader first, and then application), or can I merge the bootloader and application into a single image and flash that instead?[/quote]
&lt;p&gt;&amp;nbsp;That is not a problem. You should be able to merge everything and flashing it as one .hex file. Remember to reset the device after it is programmed. Either power cycle it, or run &amp;quot;nrfjprog --reset&amp;quot;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you need to debug, then you must use the project that is called ..._debug, e.g. the SDK\examples\dfu\secure_bootloader\pca10056_ble_debug. This bootloader takes up a bit more space, and is placed a bit further down in the flash, so there is room for both debugging (step through without optimization turned on) and logging.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you generated the dfu image with the same key as you used in your bootloader (private_key-&amp;gt;image, public_key-&amp;gt;bootloader project), then it should jump to the application if these are programmed:&lt;/p&gt;
&lt;p&gt;MBR or softdevice&lt;br /&gt;Application&lt;br /&gt;Bootloader&lt;br /&gt;Bootloader settings.&lt;/p&gt;
&lt;p&gt;I suspect that you were missing the MBR. Try to program that as well and see if the application starts up.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware on  custom board (Application + Bootloader)</title><link>https://devzone.nordicsemi.com/thread/210944?ContentTypeID=1</link><pubDate>Fri, 20 Sep 2019 13:03:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:520e24c9-0fa8-4bca-b32a-ab99e8ba4ca2</guid><dc:creator>mrono</dc:creator><description>&lt;p&gt;In step 6 you should also include the softdevice hex file. Then you should have a complete image that can be flashed in one go.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware on  custom board (Application + Bootloader)</title><link>https://devzone.nordicsemi.com/thread/210909?ContentTypeID=1</link><pubDate>Fri, 20 Sep 2019 11:21:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46abcf95-b0ea-411b-b5c7-8a6206f9a7d3</guid><dc:creator>Tim Adu</dc:creator><description>&lt;p&gt;Hello Edvin,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve been able to do&amp;nbsp; the following&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Build a debug image of my application, flashed the custom board and works as expected.&lt;/li&gt;
&lt;li&gt;Build a release image, flashed the board (just to see what happens). Nothing happens&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;(1) and (2) are done from within Segger Embedded Studio. Are there any settings to be aware of when building a release configuration?&lt;/p&gt;
&lt;p&gt;As for the bootloader generation, I managed to (in this exact sequence):&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Generate private key&lt;/li&gt;
&lt;li&gt;Compile the uecc library&lt;/li&gt;
&lt;li&gt;Build the bootloader&lt;/li&gt;
&lt;li&gt;Generate the bootloader settings hex&lt;/li&gt;
&lt;li&gt;Merge the built bootloader and settings using nrfutil (lets call the output device_bl.hex)&lt;/li&gt;
&lt;li&gt;Merged device_bl.hex and my application hex (release version)&lt;/li&gt;
&lt;li&gt;Flashed the device using nrfjprog. Nothing happens.&lt;/li&gt;
&lt;li&gt;Repeated (1) to (7) with a debug build image. Nothing happens&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Questions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How do I debug this? (I need to generate an image that can be flashed at the factory, so it cannot be a dfu package)&lt;/li&gt;
&lt;li&gt;When flashing the device, should it be done in stages (bootloader first, and then application), or can I merge the bootloader and application into a single image and flash that instead?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;My setup&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Segger Embedded Studio v4.22&lt;/li&gt;
&lt;li&gt;SDK 15.2.0&lt;/li&gt;
&lt;li&gt;Secure ble dfu bootloader project used&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Tim&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware on  custom board (Application + Bootloader)</title><link>https://devzone.nordicsemi.com/thread/206611?ContentTypeID=1</link><pubDate>Wed, 28 Aug 2019 11:57:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7bfb787c-b6af-4e93-af96-d2856d15651c</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;1: Yes. You can merge the hex files and program them in one chunk, but it is also possible to program them separately. Note that the bootloader has a CRC check, so unless you program the bootloader settings generated with the correct application and private key, the bootloader will reject the application, and stay in bootloader mode.&lt;/p&gt;
&lt;p&gt;2: If you mean to use .bat scripts to program using nrfjprog and/or update the firmware via DFU using nrfutil, then yes. It is possible. (I usually do this to test DFU stuff).&lt;/p&gt;
&lt;p&gt;3: There are some precompiled bootloaders located in:&lt;/p&gt;
&lt;p&gt;SDK15.2.0\examples\dfu\secure_dfu_test_images.&lt;/p&gt;
&lt;p&gt;However, I really (!) recommend you to compile your own bootloaders with your own keys generated the way that is described in the tutorial that I linked to in the first reply.&lt;/p&gt;
&lt;p&gt;The reason for this is that I am not sure what sort of keys or bootloader&amp;#39;s that are compiled in the precompiled .hex files and .zip files.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The bat scripts that I usually use to test looks something like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="batchfile"&gt;REM nrfutil keys generate private.key
REM nrfutil keys display --key pk private.key --format code --out_file public_key.c

nrfjprog -e --snr 123456789
nrfjprog --program softdevice.hex --snr 123456789
nrfjprog --program bootloader.hex --snr 123456789
nrfjprog --reset --snr 123456789

nrfutil pkg generate --application application.hex --application-version 1 --hw-version 52 --sd-req 0xB6 --key-file private.key dfu_test_image.hex

nrfutil dfu serial -pkg dfu_test_image.zip -p COM4 -snr 123456789 -b 115200&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Just change the serial numbers after --snr or -snr to match the serial number of your debugger (or on the DK).&lt;/p&gt;
&lt;p&gt;Also, you need to use the correct names for the softdevice hex file, the bootloader.hex is the .hex file from bootloader that you compiled, the application is the hex file for an application that you want to flash, and so on...&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware on  custom board (Application + Bootloader)</title><link>https://devzone.nordicsemi.com/thread/206524?ContentTypeID=1</link><pubDate>Wed, 28 Aug 2019 08:10:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:041fe57d-a125-4702-911c-67b4de85cf13</guid><dc:creator>Tim Adu</dc:creator><description>&lt;p&gt;I had assumed that a custom board could be flashed with the final image (application + bootloader) using Segger Flasher, a 10 pin needle adapter, and the &lt;strong&gt;nrfjprog&lt;/strong&gt; utility - this setup facilitates batch programming at the factory.&lt;br /&gt;I just discovered the &lt;strong&gt;mergehex&lt;/strong&gt; utility.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;would this be fine to combine the application and bootloader, and then program a device using the setup above?&lt;/li&gt;
&lt;li&gt;Can&amp;nbsp; you confirm that this is not possible? If this is the case, can you suggest a way (if possible) to use the DFU utility to batch program devices?&lt;/li&gt;
&lt;li&gt;This &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.2.0/lib_bootloader.html"&gt;guide&lt;/a&gt; mentions that the bootloader can be flashed directly. Where exactly in the SDK is the bootloader image located (I&amp;#39;m using SDK 15.2.0)?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Tim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware on  custom board (Application + Bootloader)</title><link>https://devzone.nordicsemi.com/thread/206278?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2019 08:38:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38c30511-22f3-4038-9b93-5999340f330d</guid><dc:creator>Tim Adu</dc:creator><description>&lt;p&gt;Great! Thanks. I&amp;#39;ll get back to you in a few days.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware on  custom board (Application + Bootloader)</title><link>https://devzone.nordicsemi.com/thread/206271?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2019 08:33:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f776d8b8-91fd-482b-a54b-d5c654c7619c</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;The difference between the serial and ble bootloader is that the serial bootloader uses UART instead of BLE to transfer the images.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Serial bootloader is located in: SDK15.2.0\examples\dfu\secure_bootloader\pca10056_uart&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;BLE bootloader is located in: SDK15.2.0\examples\dfu\secure_bootloader\pca10056_ble&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I would still recommend to test the ble bootloader, which you can do on a DK in the meantime while you work on the antenna.&lt;/p&gt;
&lt;p&gt;However, if you want to test the serial bootloader, you can do that as well. In that case, it is a quite similar approach.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You can start off by using &lt;a href="https://github.com/NordicSemiconductor/pc-nrfutil/releases" rel="noopener noreferrer" target="_blank"&gt;nrfutil &lt;/a&gt;(which is also linked in the getting started guide) to create the images and perform the serial DFU.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The nrfutil tool has a &amp;quot;guide&amp;quot; you can access by typing &amp;quot;nrfutil --help&amp;quot; after you have installed it and added it to your environment path. There is also a list over useful commands &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_nrfutil%2FUG%2Fnrfutil%2Fnrfutil_intro.html&amp;amp;cp=6_5" rel="noopener noreferrer" target="_blank"&gt;here&lt;/a&gt;, such as how to &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_nrfutil%2FUG%2Fnrfutil%2Fnrfutil_dfu_serial.html&amp;amp;cp=6_5_4_4" rel="noopener noreferrer" target="_blank"&gt;perform the serial DFU&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware on  custom board (Application + Bootloader)</title><link>https://devzone.nordicsemi.com/thread/206262?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2019 08:18:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5cbed87a-13e9-4ee6-bc68-b3be09a8f6bf</guid><dc:creator>Tim Adu</dc:creator><description>&lt;p&gt;Thanks Edvin,&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I use SDK 15.2.0&lt;/li&gt;
&lt;li&gt;A little bit about your response in (2) - you mentioned a serial bootloader. How does this work? I&amp;#39;ll have to use this for now, as we are working on optimizing the Bluetooth antenna for phase 2, which is why we split into two phases. Could you elaborate a bit on the serial bootloader.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Thanks for the links and response. I&amp;#39;ll check them out and reply in a few days,&lt;/p&gt;
&lt;p&gt;/Tim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware on  custom board (Application + Bootloader)</title><link>https://devzone.nordicsemi.com/thread/206254?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2019 08:05:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5713a298-6aed-48d5-a0d8-0d2f86730ee3</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Tim,&lt;/p&gt;
&lt;p&gt;1: Yes, there is a bootloader in the SDK. I don&amp;#39;t know what SDK version you use (which one is it?)&lt;/p&gt;
&lt;p&gt;2: It is possible if you use the serial bootloader, but my impression is that the bootloader that uses BLE to transfer the application is the most used. If so, I would recommend going directly to phase 2.&lt;/p&gt;
&lt;p&gt;3: The bootloader will take care of this. You can use a tool called nrfutil to create the DFU(/FOTA) images, and there you will set what the image contains (Bootloader, softdevice or application (or a combination).&lt;/p&gt;
&lt;p&gt;4: Yes. Check out &lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/getting-started-with-nordics-secure-dfu-bootloader" rel="noopener noreferrer" target="_blank"&gt;this tutorial&lt;/a&gt;, which will explain how to use the BLE bootloader. It is written for a fairly old SDK version (12.0.0), but you should be able to follow it using the latest SDK (SDK15.3.0) as well.&lt;/p&gt;
&lt;p&gt;5: As mentioned, I suggest that you do this directly. The blogpost in the link above will take you through this.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I hope that clears up some of your questions. I suggest that you walk through the guide from the link (without your application, just use the examples from the SDK to get familiar with it), and then try to combine it with the example found in:&lt;/p&gt;
&lt;p&gt;SDK\examples\ble_peripheral\ble_app_buttonless_dfu&lt;/p&gt;
&lt;p&gt;And then move to including this in your application.&lt;/p&gt;
&lt;p&gt;Let me know if you are stuck somewhere in the testing.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>