<?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>Timer V2 in bootloader SDK15</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/35538/timer-v2-in-bootloader-sdk15</link><description>Hello, 
 I&amp;#39;m working in a bootloader based on the one included with SDK15. I want to add a timer that fires every 50 ms to keep track of time. The purpose of this timer is to generate unblocking delays for some tasks that have to do with interfacing another</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 22 Jun 2018 10:14:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/35538/timer-v2-in-bootloader-sdk15" /><item><title>RE: Timer V2 in bootloader SDK15</title><link>https://devzone.nordicsemi.com/thread/137229?ContentTypeID=1</link><pubDate>Fri, 22 Jun 2018 10:14:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1719b26e-f8f6-4bac-b6ac-0ef2d818eff4</guid><dc:creator>Andy</dc:creator><description>&lt;p&gt;In my main application I actually enable a 1-millisecond timer also to keep track of time and I enable it before the BLE stack initialization, and I&amp;#39;ve never ever seen problems with that. Why does the application work with a way more demanding timer and the bootloader doesn&amp;#39;t?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer V2 in bootloader SDK15</title><link>https://devzone.nordicsemi.com/thread/137042?ContentTypeID=1</link><pubDate>Thu, 21 Jun 2018 09:26:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ed8e70c-f44b-469f-9a97-e10d94a4e057</guid><dc:creator>Krzysztof Chruscinski</dc:creator><description>&lt;p&gt;Problem is caused by the fact that enabling softdevice is messing with interrupt vector table. There are couple of vector tables in the system:&lt;/p&gt;
&lt;p&gt;- in mbr, root vector table at 0x0&lt;/p&gt;
&lt;p&gt;- in softdevice&lt;/p&gt;
&lt;p&gt;- in bootloader&lt;/p&gt;
&lt;p&gt;- in application (if present)&lt;/p&gt;
&lt;p&gt;When softdevice is enabled in the bootloader switch occurs. MBR starts to forward interrupts to Softdevice instead of bootloader. Then bootloader provides own vector table address to softdevice (sd_softdevice_vector_table_base_set(BOOTLOADER_START_ADDR)) to let know softdevice where to forward application interrupts (one not handled by softdevice).&lt;/p&gt;
&lt;p&gt;Unfortunately, this operation is not atomic. First nrf_dfu_mbr_init_sd() is called and then table is set. If any interrupt occurs in that spot softdevice will get it and will crash because it has no vector table to forward that interrupt to.&lt;/p&gt;
&lt;p&gt;I know that it&amp;#39;s a bit tricky but you should ensure that no interrupt happends until softdevice is fully enabled.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer V2 in bootloader SDK15</title><link>https://devzone.nordicsemi.com/thread/136924?ContentTypeID=1</link><pubDate>Wed, 20 Jun 2018 13:30:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc6a2b9f-250e-4d7d-914d-223a2650fc65</guid><dc:creator>Andy</dc:creator><description>&lt;p&gt;After testing some more I found out that this workaround breaks my bootloader in certain conditions, since I use the NVMC to write some code to flash on the very first boot. I was doing this before initializing the Softdevice so there was never a problem, now that I moved that initialization I would have to either use sd functions to write to UICR, or to split my initialization routine in two, to initialize stuff before and after the SD initialization.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll split it for now, but this is not ideal :/&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer V2 in bootloader SDK15</title><link>https://devzone.nordicsemi.com/thread/136901?ContentTypeID=1</link><pubDate>Wed, 20 Jun 2018 12:28:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d355b5dc-220a-41b1-82a4-df5900fd7852</guid><dc:creator>Andy</dc:creator><description>&lt;p&gt;Hi Hung, your workaround did indeed fix the issue. I don&amp;#39;t really understand why though. I am initializing all my stuff in nrf_dfu_user_init(), which is executed just before nrf_dfu_init(). I moved it after and it looks like it works now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer V2 in bootloader SDK15</title><link>https://devzone.nordicsemi.com/thread/136886?ContentTypeID=1</link><pubDate>Wed, 20 Jun 2018 11:25:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7d164a5-ca53-4100-b308-3b46b1b4f68d</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Andy,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We haven&amp;#39;t found the root cause yet. However, I found that if I start the timers&amp;nbsp; after the MBR initialize the softdevice then it works fine. My suggestion for now is to start your app timer (nrf_bootloader_led_blink_timer_start)&amp;nbsp; after the call&amp;nbsp;nrf_dfu_init() inside&amp;nbsp;nrf_bootloader_init().&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Strange enough, if I use larger timeout timer, it works regardless where the timer is started. I guess it has something to do with the timing of the RTC due to the initialize of the softdevice. I will report this to R&amp;amp;D and get back to you when we have an update.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For now, please try the workaround and let me know the result.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer V2 in bootloader SDK15</title><link>https://devzone.nordicsemi.com/thread/136817?ContentTypeID=1</link><pubDate>Tue, 19 Jun 2018 17:15:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7f61f9c-cea5-4e34-93b7-c4cf6e08a40f</guid><dc:creator>Andy</dc:creator><description>&lt;p&gt;Thanks Hung, I will wait for your verdict :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer V2 in bootloader SDK15</title><link>https://devzone.nordicsemi.com/thread/136807?ContentTypeID=1</link><pubDate>Tue, 19 Jun 2018 15:29:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2dee7703-a3f9-4334-943e-94622c9fb35f</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Andy,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We&amp;nbsp;tried here and was seeing the same issue. We will have further investigation and let you know what we find.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>