<?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>SDK v15 DFU Bootloader hangs on execute instruction</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/33225/sdk-v15-dfu-bootloader-hangs-on-execute-instruction</link><description>Hi, I&amp;#39;m migraing our project to the latest NRF5 SDK v15.0.0 (S132 v6.0.0). We were previously on v12.2.0 (S132 v3.0.0) using the BLE DFU Bootloader. I&amp;#39;ve modified our bootloader code to match the example from the latest SDK. It compiles and runs on our</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 28 May 2018 12:12:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/33225/sdk-v15-dfu-bootloader-hangs-on-execute-instruction" /><item><title>RE: SDK v15 DFU Bootloader hangs on execute instruction</title><link>https://devzone.nordicsemi.com/thread/133645?ContentTypeID=1</link><pubDate>Mon, 28 May 2018 12:12:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:844cbce3-295d-4e2a-9b13-5682232ceb1b</guid><dc:creator>dingari</dc:creator><description>&lt;p&gt;Hi Bjorn, you can disregard my previous answer. &lt;/p&gt;
&lt;p&gt;There were some files that the secure bootloader example was compiling and I wasn&amp;#39;t. Everything seems to be in order now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK v15 DFU Bootloader hangs on execute instruction</title><link>https://devzone.nordicsemi.com/thread/133616?ContentTypeID=1</link><pubDate>Mon, 28 May 2018 09:49:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6106f267-2677-4fc8-9ad1-f27c94216705</guid><dc:creator>dingari</dc:creator><description>&lt;p&gt;Hi Bjorn, sorry to wake this old thread.&lt;/p&gt;
&lt;p&gt;However, I&amp;#39;m facing a related issue now. My current devices, which have been programmed with the secure bootloader from SDK v12.2.0, can&amp;#39;t be updated with the new bootloader via OTA DFU, since the new bootloader size is different from the old (0x8000 vs 0x6000).&lt;/p&gt;
&lt;p&gt;After looking at the Makefile for the BLE Secure Bootloader, I can see that -flto is present in the CFLAGS, and the size is set to 0x6000 in the linker file. So I&amp;#39;m quite puzzled why the bootloader is misbehaving in my case.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m thinking about trying a newer version of GCC and see if the bootloader works with link time optimization. Otherwise I need to open all my current devices and re-flash the firmware via SWD, which is really not an option.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK v15 DFU Bootloader hangs on execute instruction</title><link>https://devzone.nordicsemi.com/thread/128215?ContentTypeID=1</link><pubDate>Fri, 13 Apr 2018 10:44:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7df9af9f-1347-425c-adb5-bb0d9b740bc7</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;Not exactly sure why this is the case. &lt;a href="https://devzone.nordicsemi.com/b/blog/posts/getting-more-out-of-make"&gt;This blog post&lt;/a&gt; says the following:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;strong&gt;NOTE:&lt;/strong&gt;&amp;nbsp;The safe thing to do is to assume that the flags that aren&amp;#39;t included in the default Makefiles are just as interesting as the ones that are. For example, the Link Time Optimization (&lt;code&gt;-flto&lt;/code&gt;) flag was dropped starting with SDK v9 when GCC was upgraded to v4.9. The rationale for this change isn&amp;#39;t obvious but as far as I know it was intentional (and&amp;nbsp;&lt;code&gt;-flto&lt;/code&gt;&amp;nbsp;hasn&amp;#39;t been reintroduced).&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/21743/linker-optimization-flag--flto-not-working"&gt;This case&lt;/a&gt; might also be helpful. It seems that none of our examples are compiled with Link Time Optimization &amp;amp; therefore not tested either. Those are my best two guesses as to why this is the case. Hope that helps a bit!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK v15 DFU Bootloader hangs on execute instruction</title><link>https://devzone.nordicsemi.com/thread/128096?ContentTypeID=1</link><pubDate>Thu, 12 Apr 2018 14:01:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:efec3b4a-7651-47d0-8c3b-c161ab273d82</guid><dc:creator>dingari</dc:creator><description>&lt;p&gt;Yes, removing the -flto allows the bootloader to behave normally. I&amp;#39;m curious as to why this is happening. Of course I could remove the flag, but then I have to increase the size of the bootloader code (around 8kB seems to do the trick). It&amp;#39;s not the end of the world, but a smaller bootloader is preferrable.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK v15 DFU Bootloader hangs on execute instruction</title><link>https://devzone.nordicsemi.com/thread/128080?ContentTypeID=1</link><pubDate>Thu, 12 Apr 2018 13:22:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:461bc10c-d28d-4171-992e-67b2546f88aa</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;Are you saying that everything works fine if you remove the -flto flag? &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/18880/why-not-include-gcc-s-link-time-optimization" target="_blank" rel="noopener noreferrer"&gt;This devzone case &lt;/a&gt;gives you a bit more information. If everything does work without this flag, could you not just remove the flag. It seems there is not too much performance difference from what I understand.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK v15 DFU Bootloader hangs on execute instruction</title><link>https://devzone.nordicsemi.com/thread/128009?ContentTypeID=1</link><pubDate>Thu, 12 Apr 2018 09:52:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:500a34e5-c964-479d-abd4-7677b41ca498</guid><dc:creator>dingari</dc:creator><description>&lt;p&gt;Hmm, looking at nrf_bootloader_dfu_timers.c I&amp;#39;m suspecting the infinite loop is occurring due to a failed `ASSERT` on a return code from the timer module in this function:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void timer_start(app_timer_t * p_timer, uint32_t timeout_ms, nrf_bootloader_dfu_timeout_callback_t callback)
{
    ret_code_t err_code;

    timer_init();

    err_code = app_timer_stop(p_timer);
    ASSERT(err_code == NRF_SUCCESS);

    if (timeout_ms != 0)
    {
        //lint -save -e611 &amp;quot;Suspicious cast&amp;quot;
        err_code = app_timer_start(p_timer, APP_TIMER_TICKS(timeout_ms), (void *)callback);
        //lint -restore
        ASSERT(err_code == NRF_SUCCESS);
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I had to disable link time optimization to have the necessary debug symbols available in gdb for debugging. However, without the -flto flag the bootloader doesn&amp;#39;t crash... So I&amp;#39;m at a loss on how I can debug this. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK v15 DFU Bootloader hangs on execute instruction</title><link>https://devzone.nordicsemi.com/thread/127992?ContentTypeID=1</link><pubDate>Thu, 12 Apr 2018 09:07:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c4bc86f-3752-4494-954a-a881e384c51c</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;This case was not assigned to my group. Another application engineer will look at your question as soon as they have time.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK v15 DFU Bootloader hangs on execute instruction</title><link>https://devzone.nordicsemi.com/thread/127943?ContentTypeID=1</link><pubDate>Thu, 12 Apr 2018 06:19:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48917998-20ee-4f15-9398-8c3b9b1d871b</guid><dc:creator>Takeshi Goda</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/33310/invert-pwm-behaviour"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/33310/invert-pwm-behaviour&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;Can you tell me how to solve this problem?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK v15 DFU Bootloader hangs on execute instruction</title><link>https://devzone.nordicsemi.com/thread/127940?ContentTypeID=1</link><pubDate>Thu, 12 Apr 2018 06:14:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:abcacfa5-83c1-45a7-9cb3-48f3af25c298</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;Looking at the secure dfu bootloader example in sdk 15, the function&amp;nbsp;nrf_bootloader_dfu_inactivity_timer_restart() gets called twice: once in the dfu_observer() function inside nrf_bootloader.c to handle the NRF_DFU_EVT_OBJECT_RECEIVED event &amp;amp; once in&amp;nbsp;nrf_bootloader_init() also in nrf_bootloader.c.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Having you tried adding some NRF_LOG_ERROR() calls to debug the bootloader with an RTT client? I would try that to figure out where the error is occuring.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK v15 DFU Bootloader hangs on execute instruction</title><link>https://devzone.nordicsemi.com/thread/127769?ContentTypeID=1</link><pubDate>Wed, 11 Apr 2018 09:09:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ffb1fbcd-d85b-417a-8f78-b99c81d254e5</guid><dc:creator>dingari</dc:creator><description>&lt;p&gt;I think these are the relevant lines in the .map file for the bootloader:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x000000000007c1a0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nrf_bootloader_dfu_inactivity_timer_restart.constprop.38&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x000000000007c20c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; image_copy.part.0.constprop.35&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure where the infinite loop is occurring, but it&amp;#39;s triggered somewhere after I issue an Execute command after sending the first object of the firmware.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK v15 DFU Bootloader hangs on execute instruction</title><link>https://devzone.nordicsemi.com/thread/127753?ContentTypeID=1</link><pubDate>Wed, 11 Apr 2018 08:24:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a34efcc0-9b23-4cdf-9d7f-22e78402a6d7</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;Could you take a look at the .map file &amp;amp; see where in the code&amp;nbsp;0x0007c1ea corresponds to? Where is the infinite loop occurring? You can find the .map file in your build folder.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>