<?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>How to add bootloader to device</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/24058/how-to-add-bootloader-to-device</link><description>Hi all, 
 I am started my project using the softdevice S130 v2.0.1 and the ble_app_uart example(SDK11) on a custom board with the nRF51822. I had to made some changes for the clock source because of the custom board, but I am able to connect to the device</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 11 Sep 2017 09:10:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/24058/how-to-add-bootloader-to-device" /><item><title>RE: How to add bootloader to device</title><link>https://devzone.nordicsemi.com/thread/94740?ContentTypeID=1</link><pubDate>Mon, 11 Sep 2017 09:10:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:669b2602-3cf6-422e-a8e1-a2696dc6f2fd</guid><dc:creator>Jorge</dc:creator><description>&lt;p&gt;What I have made for my DFU to work was to not check the crc inside the function &lt;code&gt;bootloader_app_is_valid()&lt;/code&gt;. I have made that this function always returns true.&lt;/p&gt;
&lt;p&gt;The other way I could not update the bootloader.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add bootloader to device</title><link>https://devzone.nordicsemi.com/thread/94732?ContentTypeID=1</link><pubDate>Fri, 08 Sep 2017 14:32:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a131b1b6-c45b-4dec-9d22-63983dc50395</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;You&amp;#39;re not able to update the bootloader using Serial DFU, but you&amp;#39;re able to update the application and the SoftDevice? You have to remove the &lt;code&gt;BANK_VALID_APP&lt;/code&gt; flag from the code when you generate the bootloader hex to use in the DFU zip packet, i.e. set&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint8_t  m_boot_settings[CODE_PAGE_SIZE]    __attribute__((at(BOOTLOADER_SETTINGS_ADDRESS))) __attribute__((used));
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Otherwise the hex file will be to large( you&amp;#39;ll include an empty flash page) which will result in the image being rejected.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add bootloader to device</title><link>https://devzone.nordicsemi.com/thread/94739?ContentTypeID=1</link><pubDate>Wed, 30 Aug 2017 12:54:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69d6e44f-0e76-4966-8904-9f02b5e4e0a4</guid><dc:creator>Jorge</dc:creator><description>&lt;p&gt;I have successfully built the bootloader. And with it I can now load every part of the code except the bootloader itself. I can load via DFU different applications, Softdevice and even different bootloaders. But I cannot load via DFU this bootloader project. I am not sure why but it&amp;#39;s giving me a timeout error.
Do you have any idea why the bootloader project is not loaded correctly using the serial DFU?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add bootloader to device</title><link>https://devzone.nordicsemi.com/thread/94737?ContentTypeID=1</link><pubDate>Fri, 04 Aug 2017 13:55:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4af10f80-3166-4052-ba3e-1d360c388c73</guid><dc:creator>Jorge</dc:creator><description>&lt;p&gt;I don&amp;#39;t know why, but it seems that I have to load first the SD, then the Bootloader and at the end the app. Doing this everything work. On my board and on the DK, not sure why it doesn&amp;#39;t work if I send the bootloader after the application...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add bootloader to device</title><link>https://devzone.nordicsemi.com/thread/94733?ContentTypeID=1</link><pubDate>Fri, 04 Aug 2017 12:12:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53cc8eed-fd84-464c-9e6a-d73b696caa7b</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Ok, let me know what you find out.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add bootloader to device</title><link>https://devzone.nordicsemi.com/thread/94736?ContentTypeID=1</link><pubDate>Fri, 04 Aug 2017 11:40:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7109af09-ca8d-48e0-93db-375c0d697c5e</guid><dc:creator>Jorge</dc:creator><description>&lt;p&gt;It has the 32KHz crystal connected. On my ble_app_uart I use this clock configuration and then I use &lt;code&gt;NRF_CLOCK-&amp;gt;XTALFREQ = 0xFFFFFF00;&lt;/code&gt; to set the 32KHz clock.&lt;/p&gt;
&lt;p&gt;When I want to use the app on the DK board I just comment this last part and it still works.
So I think the bootloader is not running on my custom board because of some clock configuration related problem. I will make more tests on this then.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add bootloader to device</title><link>https://devzone.nordicsemi.com/thread/94735?ContentTypeID=1</link><pubDate>Fri, 04 Aug 2017 11:29:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6eb8b293-f316-484d-af99-c7675ad692df</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Does your custom board have the optional 32kHz crystal? If not, then the configuration you had is correct.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add bootloader to device</title><link>https://devzone.nordicsemi.com/thread/94734?ContentTypeID=1</link><pubDate>Fri, 04 Aug 2017 11:24:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb76e7e8-e531-46c7-83dd-74f242741347</guid><dc:creator>Jorge</dc:creator><description>&lt;p&gt;I had the clock configuration different, using the RC, because of my custom board.&lt;/p&gt;
&lt;p&gt;Now with your configuration of the clock the device advertises.&lt;/p&gt;
&lt;p&gt;The clock configuration I had was :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; nrf_clock_lf_cfg_t rc_clock_lf_cfg = { .source = NRF_CLOCK_LF_SRC_RC,	\
.rc_ctiv = 4,											\
.rc_temp_ctiv = 1};
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add bootloader to device</title><link>https://devzone.nordicsemi.com/thread/94738?ContentTypeID=1</link><pubDate>Fri, 04 Aug 2017 11:07:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0c7f7b2-b545-42de-999e-15b4bac3dbf6</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;What kind of clock configuration do you have in the bootloader project, i.e. is the NRF_CLOCK_LFCLKSRC set to the following?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define NRF_CLOCK_LFCLKSRC      {.source        = NRF_CLOCK_LF_SRC_XTAL,            \
                                 .rc_ctiv       = 0,                                \
                                 .rc_temp_ctiv  = 0,                                \
                                 .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Because the debugger will force the clocks of nRF51 to stay on, but once you disconnect it then they will not be on.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add bootloader to device</title><link>https://devzone.nordicsemi.com/thread/94731?ContentTypeID=1</link><pubDate>Fri, 04 Aug 2017 09:26:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b82ce279-8f4f-4e76-910b-d717982e3595</guid><dc:creator>Jorge</dc:creator><description>&lt;p&gt;I have runned the debugger on the bootloader, and after the breakpoint on the &lt;code&gt;bootloader_app_start()&lt;/code&gt; I just let it run. If I do this then the app works, but the moment I stop the debugging the app stops to work. Even rebooting the board doesn&amp;#39;t work.&lt;/p&gt;
&lt;p&gt;It seems there is some difference running from the debug session or not.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add bootloader to device</title><link>https://devzone.nordicsemi.com/thread/94730?ContentTypeID=1</link><pubDate>Fri, 04 Aug 2017 08:59:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:74a723c3-6da7-445c-af90-70395598abf0</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Flash all the .hex files, i.e. SD, app and BL. If you reach the breakpoint in main, then set a breakpoint at the  bootloader_util_app_start(CODE_REGION_1_START); statement in &lt;code&gt;bootloader_app_start()&lt;/code&gt; in bootloader.c at line 308. If you reach this function, then it means that the bootloader is branching to the application. You should then start a debug session in the application and set a breakpoint in its main.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add bootloader to device</title><link>https://devzone.nordicsemi.com/thread/94728?ContentTypeID=1</link><pubDate>Fri, 04 Aug 2017 08:49:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e43fabc9-680a-43f7-82e9-5ca16d64d15d</guid><dc:creator>Jorge</dc:creator><description>&lt;p&gt;I can merge the three files together without any errors.&lt;/p&gt;
&lt;p&gt;For the debugging should I have all the parts on the board or just the SD and bootloader?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add bootloader to device</title><link>https://devzone.nordicsemi.com/thread/94729?ContentTypeID=1</link><pubDate>Fri, 04 Aug 2017 08:32:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c1ccef0-782f-4c53-8c79-26b5bab14acc</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;The order should not matter. Are you able to merge the Bootloader, SoftDevice and Application using mergehex with out any errors? If not then you have overlapping hex files. Could you try to start a debug session in the bootloader project, set a breakpoint in main and see if you reach it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add bootloader to device</title><link>https://devzone.nordicsemi.com/thread/94727?ContentTypeID=1</link><pubDate>Fri, 04 Aug 2017 07:59:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28dbb8d5-a506-472f-818d-e5e62bdf39e0</guid><dc:creator>Jorge</dc:creator><description>&lt;p&gt;I have made this change but the app still doesn&amp;#39;t advertise. I am not sure if I have to load the parts in some specific order, I am loading the SD130 first then the Bootloader130 and after this the app. But I still don&amp;#39;t see the device advertising the uart profile.&lt;/p&gt;
&lt;p&gt;If I load only the SD + app then I can see it advertising.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add bootloader to device</title><link>https://devzone.nordicsemi.com/thread/94725?ContentTypeID=1</link><pubDate>Fri, 04 Aug 2017 07:55:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18632dd4-6716-4649-893b-0073ff7bba1d</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Yes, the single bank serial bootloader should work without any modifications to the nRF51 DK. Also see my answer below.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add bootloader to device</title><link>https://devzone.nordicsemi.com/thread/94726?ContentTypeID=1</link><pubDate>Fri, 04 Aug 2017 07:48:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51412f2c-8225-41ad-a01e-9a498fe06350</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hi Jorge, the serial bootloader does not advertise, so this is expected, but I think the issue with the application not starting  is that the bootloader settings does not state that there is a valid application.&lt;/p&gt;
&lt;p&gt;In order to flash a combined SoftDevice, Bootloader and Application, where the device jumps to the application without having to perform a OTA update, you have to set the &lt;code&gt;BANK_VALID_APP&lt;/code&gt; flag in &lt;code&gt;bootloader_settings.c&lt;/code&gt;, i.e. change the line&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint8_t  m_boot_settings[CODE_PAGE_SIZE]    __attribute__((at(BOOTLOADER_SETTINGS_ADDRESS))) __attribute__((used));   
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;to the following&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint8_t  m_boot_settings[CODE_PAGE_SIZE]    __attribute__((at(BOOTLOADER_SETTINGS_ADDRESS))) __attribute__((used)) = {BANK_VALID_APP};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;-Bjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>