<?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>High current when advertising with RTOS</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/35449/high-current-when-advertising-with-rtos</link><description>Hi all, 
 I have ported my RTOS to nRF52832. It can run app and BLE properly. But when I measure the power consumption, the current is too high when BLE is enabled. Please see the below four figures. 
 (1) CPU is idle 
 
 (2) ADC (triggered by RTC2/PPI</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 15 Jun 2018 17:59:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/35449/high-current-when-advertising-with-rtos" /><item><title>RE: High current when advertising with RTOS</title><link>https://devzone.nordicsemi.com/thread/136418?ContentTypeID=1</link><pubDate>Fri, 15 Jun 2018 17:59:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89caa8b5-d57d-4c49-b6c0-29b3d4197b4e</guid><dc:creator>robert</dc:creator><description>&lt;p&gt;I found the solution. Yes, it is caused by FPU interrupt. After reading errata #87, I guess SoftDevice enables FPU IRQ so&amp;nbsp;that FPU interrupt keep happening due to this errata. When the patch code is placed inside idleTask(), it might be interrupted by FPU interrupt. I think it should be better to be placed in the&amp;nbsp;FPU ISR.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So, I add a FPU ISR and put the patch code inside the ISR. It works very well. The figure below shows ADC sampling at 100Hz with&amp;nbsp;three peaks indicate BLE advertising timing.&lt;/p&gt;
&lt;p&gt;I think it should be useful to add this workaround&amp;nbsp;in nRF52832 revision errata doc.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/800x512/__key/communityserver-discussions-components-files/4/7607.scope_5F00_0.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High current when advertising with RTOS</title><link>https://devzone.nordicsemi.com/thread/136415?ContentTypeID=1</link><pubDate>Fri, 15 Jun 2018 16:40:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aecb6fd0-1aa6-469a-9dd9-843f4b3a111b</guid><dc:creator>robert</dc:creator><description>&lt;p&gt;No luck and even worse. The CPU&amp;nbsp;is completely halted&amp;nbsp;with the patch code. The CPU is no more working and gets reset by watchdog. (I have configured watchdog timeout with 3 seconds)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High current when advertising with RTOS</title><link>https://devzone.nordicsemi.com/thread/136321?ContentTypeID=1</link><pubDate>Fri, 15 Jun 2018 10:49:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:208edd21-bc25-4159-b166-810176d9c793</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Most of your scenarios show a base current of ~3.5 mA, which is very high.&lt;/p&gt;
&lt;p&gt;It could be the FPU that is waking up the CPU (&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.Rev2.errata/dita/errata/nRF52832/Rev2/latest/anomaly_832_87.html?cp=2_1_1_0_1_24"&gt;errata #87&lt;/a&gt;). Could you try adding this prior to entering sleep?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#if (__FPU_USED == 1)
 __set_FPSCR(__get_FPSCR() &amp;amp; ~(0x0000009F)); 
 (void) __get_FPSCR();
 NVIC_ClearPendingIRQ(FPU_IRQn);
#endif
 my_sleep_function();&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>