<?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>Unexplained power consumption when MPSL Timeslots are scheduled</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/81279/unexplained-power-consumption-when-mpsl-timeslots-are-scheduled</link><description>My application flashes an LED periodically, and I would like to synchronize the LED flashing with radio idle time in order to minimize max current draw. It seems that using MPSL Timeslots is the preferred method. Using timeslots appears to be working</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 19 Nov 2021 08:06:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/81279/unexplained-power-consumption-when-mpsl-timeslots-are-scheduled" /><item><title>RE: Unexplained power consumption when MPSL Timeslots are scheduled</title><link>https://devzone.nordicsemi.com/thread/339749?ContentTypeID=1</link><pubDate>Fri, 19 Nov 2021 08:06:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:94eb39f2-3726-440a-add3-0152c3e5cb96</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Sorry Charles for late response, I was knocked out for few days because of the flu.&lt;/p&gt;
&lt;p&gt;The team have found the bug in the MPSL where the&amp;nbsp;&lt;span&gt;HF internal clock is not turn off at the end off the MSPL timeslot.&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;The workaround is to use the XTAL for the &lt;span&gt;mpsl_timeslot_request_t&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;You can tell to the customer to replace in the MPSL timeslot example :
&lt;div&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;/div&gt;
&lt;pre&gt;&lt;pre class="ui-code" data-mode="text"&gt;.params.earliest.hfclk = MPSL_TIMESLOT_HFCLK_CFG_NO_GUARANTEE &lt;/pre&gt;
by 
&lt;pre class="ui-code" data-mode="text"&gt;.params.normal.hfclk = MPSL_TIMESLOT_HFCLK_CFG_XTAL_GUARANTEED&lt;/pre&gt;

&lt;/pre&gt;
&lt;div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;br /&gt; Whole correct struct init&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;pre&gt;&lt;pre class="ui-code" data-mode="text"&gt;static mpsl_timeslot_request_t timeslot_request_earliest = {
 .request_type = MPSL_TIMESLOT_REQ_TYPE_EARLIEST,
 .params.earliest.hfclk = MPSL_TIMESLOT_HFCLK_CFG_XTAL_GUARANTEED,
 .params.earliest.priority = MPSL_TIMESLOT_PRIORITY_NORMAL,
 .params.earliest.length_us = TIMESLOT_LENGTH_US,
 .params.earliest.timeout_us = 1000000
};
static mpsl_timeslot_request_t timeslot_request_normal = {
 .request_type = MPSL_TIMESLOT_REQ_TYPE_NORMAL,
 .params.normal.hfclk = MPSL_TIMESLOT_HFCLK_CFG_XTAL_GUARANTEED,
 .params.normal.priority = MPSL_TIMESLOT_PRIORITY_NORMAL,
 .params.normal.distance_us = TIMESLOT_REQUEST_DISTANCE_US,
 .params.normal.length_us = TIMESLOT_LENGTH_US
};&lt;/pre&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unexplained power consumption when MPSL Timeslots are scheduled</title><link>https://devzone.nordicsemi.com/thread/339530?ContentTypeID=1</link><pubDate>Wed, 17 Nov 2021 23:18:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:307ecbbb-26da-4944-ac12-31260913a73e</guid><dc:creator>csteaderman</dc:creator><description>&lt;p&gt;Any progress on the investigation into this issue?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unexplained power consumption when MPSL Timeslots are scheduled</title><link>https://devzone.nordicsemi.com/thread/337822?ContentTypeID=1</link><pubDate>Mon, 08 Nov 2021 07:35:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:671b19b1-ad86-43a8-af2c-d372e02be69d</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I see, the high idle currents are not as short lived as i thought. Seems like there is something left enabled in background when a timeslot is requested in the next radio idle period. This gives us better picture and atleast corrected me with my assumptions. This might not be Timer related.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unexplained power consumption when MPSL Timeslots are scheduled</title><link>https://devzone.nordicsemi.com/thread/337711?ContentTypeID=1</link><pubDate>Fri, 05 Nov 2021 13:36:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:764e056d-3cb0-430d-85ca-9eeaefb1ca7d</guid><dc:creator>csteaderman</dc:creator><description>&lt;p&gt;OK, So I annotated each image showing relevant points. If you look at the average current for each 10 second plot, the non-MPSL example is using 94.25 uA, while the MPSL example is using 159.08 uA. The areas of high idle current in the MPSL example are not times when my code is running. My code/callback is active only during the LED flashing. That means that the MPSL library is doing something more in the background, but only if a callback is scheduled to be called in the next radio idle window.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/2080x3646/__key/communityserver-discussions-components-files/4/8510.non_2D00_mpsl.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/2080x3646/__key/communityserver-discussions-components-files/4/1256.mpsl.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unexplained power consumption when MPSL Timeslots are scheduled</title><link>https://devzone.nordicsemi.com/thread/337611?ContentTypeID=1</link><pubDate>Fri, 05 Nov 2021 07:46:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7de1d5a-0b40-4d10-bd03-a4f4380e7df1</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;please annotate the images as the team is looking into this now, the detail images would help a lot&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unexplained power consumption when MPSL Timeslots are scheduled</title><link>https://devzone.nordicsemi.com/thread/337455?ContentTypeID=1</link><pubDate>Thu, 04 Nov 2021 12:14:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a1edb7d6-590c-4035-8f79-38961600d3fd</guid><dc:creator>csteaderman</dc:creator><description>&lt;p&gt;Just to be clear, I&amp;#39;m not presently worried about the spikes that appear on the graph from PPK2, it is the elevated &amp;quot;idle&amp;quot; between the advertisement radio spike that&amp;nbsp;&lt;strong&gt;&lt;em&gt;only&lt;/em&gt;&lt;/strong&gt; appears between radio spikes when my scheduled task is going to be run. If you aren&amp;#39;t seeing what I&amp;#39;m describing, I can annotate the images. Please let me know.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unexplained power consumption when MPSL Timeslots are scheduled</title><link>https://devzone.nordicsemi.com/thread/337386?ContentTypeID=1</link><pubDate>Thu, 04 Nov 2021 07:13:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:525d0962-de08-43b7-ae07-b722737471cb</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You are right, the power spike seems short lived and seems like it is not extending into the user timeslot. I need to ask the team of MPSL to understand what it is doing just before the user timeslot starts to have this spike.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unexplained power consumption when MPSL Timeslots are scheduled</title><link>https://devzone.nordicsemi.com/thread/337323?ContentTypeID=1</link><pubDate>Wed, 03 Nov 2021 15:13:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c94b89da-d480-4cc6-93b0-af51e7a4be94</guid><dc:creator>csteaderman</dc:creator><description>&lt;p&gt;My concern (right now) is not the power consumption &lt;em&gt;&lt;strong&gt;during&lt;/strong&gt; &lt;/em&gt;my event processing, but rather the power consumption of the MPSL library &lt;strong&gt;&lt;em&gt;prior&amp;nbsp;&lt;/em&gt;&lt;/strong&gt;to my event processing. If you look at the graph, the power consumption between radio events when my event is&amp;nbsp;&lt;strong&gt;&lt;em&gt;not&lt;/em&gt;&lt;/strong&gt; scheduled to run is quite low. But between radio event when my event&amp;nbsp;&lt;strong&gt;&lt;em&gt;is&lt;/em&gt;&lt;/strong&gt; scheduled to run has higher power consumption&amp;nbsp;&lt;strong&gt;&lt;em&gt;prior&lt;/em&gt;&lt;/strong&gt; to my event even being started. So turning off TIMER0 in my handler it too late. I believe that the problem is in the MPSL library and what it is doing in the background between radio events for which a scheduled timeslot has been requested.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unexplained power consumption when MPSL Timeslots are scheduled</title><link>https://devzone.nordicsemi.com/thread/337222?ContentTypeID=1</link><pubDate>Wed, 03 Nov 2021 09:48:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1dae9a09-636c-4d26-b69c-a448dca2186a</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;That explains it.&lt;/p&gt;
&lt;p&gt;using nrf_timer_xxx related stuff is expensive. And seems like the MPSL starts the timeslot with the TIMER0 enabled at 1 MHz. You can brutally disable the TIMER0 when the timeslot starts and use&amp;nbsp;k_timer (which is rtos timer using RTC) API to close the timeslot in time.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unexplained power consumption when MPSL Timeslots are scheduled</title><link>https://devzone.nordicsemi.com/thread/337164?ContentTypeID=1</link><pubDate>Wed, 03 Nov 2021 01:08:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc152a45-7ffa-4745-936f-4c3e88bfa6a7</guid><dc:creator>csteaderman</dc:creator><description>&lt;p&gt;The non-MPSL version is using timers as such:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    // Initialize led period timer and work handlers.
    k_timer_init(&amp;amp;led_period_timer, led_period_timer_handler, NULL);
    k_work_init(&amp;amp;led_period_work, led_period_work_handler);

    // Initialize led duty cycle timer and work handlers.
    k_timer_init(&amp;amp;led_duty_cycle_timer, led_duty_cycle_timer_handler, NULL);
    k_work_init(&amp;amp;led_duty_cycle_work, led_duty_cycle_work_handler);
.
.
.
    // start timers
    k_timer_start(&amp;amp;led_period_timer, K_MSEC(LED_IDLE_PERIOD_MS), K_MSEC(LED_IDLE_PERIOD_MS)); // periodic
    k_timer_start(&amp;amp;led_duty_cycle_timer, K_MSEC(LED_IDLE_DUTY_CYCLE_MS), K_NO_WAIT); // one shot, restarted in periodic handler
    // turn on led
    gpio_pin_set(_LedStatus_dev, LED_STATUS_PIN, LED_ON);
.
.
.
    // LED period expires callback
    k_timer_start(&amp;amp;led_duty_cycle_timer, K_MSEC(LED_IDLE_DUTY_CYCLE_MS), K_NO_WAIT); // one shot, restarted in periodic handler
    // turn on led
    gpio_pin_set(_LedStatus_dev, LED_STATUS_PIN, LED_ON);
.
.
.
    // LED duty cycle expires callback
    gpio_pin_set(_LedStatus_dev, LED_STATUS_PIN, LED_OFF);
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The timing for the MPSL version is managed as shown in the code snippet of the original post:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    StatusLedOn();
    nrf_timer_cc_set(NRF_TIMER0, NRF_TIMER_CC_CHANNEL0,
    			TIMER_EXPIRY_US);
.
.
.
	case MPSL_TIMESLOT_SIGNAL_TIMER0:
        StatusLedOff();
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unexplained power consumption when MPSL Timeslots are scheduled</title><link>https://devzone.nordicsemi.com/thread/337096?ContentTypeID=1</link><pubDate>Tue, 02 Nov 2021 12:52:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1028f23e-b77e-4c4f-a438-5ce188839c47</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In the non-MPSL version of your tests are you using Timer or RTC to schedule the led on/off? The NRF_TIMER uses HFCLK but if this was same in your non-MPSL version (using Timer) then this is very interesting side affect you are seeing which seems buggy in my opinion. To be able to debug this, i would need to replicate your experiment. If you are using same timers in both non-mpsl and mpsl experimetn then can you please give me a minimalistic project so that i can test this effects quickly?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>