<?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>Current consumption ble</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/51951/current-consumption-ble</link><description>Hi, 
 I&amp;#39;m using nrf52832 with s132, so I don&amp;#39;t find any information about the current consumed by the device when I&amp;#39;m connected by Bluetooth. I use the driver st7735 and an LCD screen. When my phone is not connected by Bluetooth and my device sleep, the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 13 Sep 2019 06:08:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/51951/current-consumption-ble" /><item><title>RE: Current consumption ble</title><link>https://devzone.nordicsemi.com/thread/209521?ContentTypeID=1</link><pubDate>Fri, 13 Sep 2019 06:08:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0bce8dfc-e03e-4530-bce2-ade9311f4075</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Happy to help.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Current consumption ble</title><link>https://devzone.nordicsemi.com/thread/209505?ContentTypeID=1</link><pubDate>Fri, 13 Sep 2019 01:05:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b361d75e-45bb-4b60-b02b-2e3dbdc019aa</guid><dc:creator>lydie</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Ok, I will do that.&lt;/p&gt;
&lt;p&gt;Thanks for your help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Current consumption ble</title><link>https://devzone.nordicsemi.com/thread/209429?ContentTypeID=1</link><pubDate>Thu, 12 Sep 2019 12:33:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46d4bb78-b2c3-48ae-a2cc-a5d8131b700f</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hi lydie,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sorry for not explaining this better. I would check the EVENTS_ registers just before&amp;nbsp;&amp;nbsp;sd_app_evt_wait() is called in&amp;nbsp;nrf_pwr_mgmt_run(). As I tried to explain in my previous comments, any pending events, i.e. if any EVENTS_ register for any peripheral isnt cleared prior to calling&amp;nbsp;&lt;span&gt;sd_app_evt_wait(), then&amp;nbsp;sd_app_evt_wait() will return immediatly.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Hence I would start looking at the EVENTS regisiters of the peripherals that you are using your application, e.g. UART and SPI .&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Bjørn&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Current consumption ble</title><link>https://devzone.nordicsemi.com/thread/209355?ContentTypeID=1</link><pubDate>Thu, 12 Sep 2019 09:15:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b65d0205-8ec5-4bf3-97ff-98e96300b8ce</guid><dc:creator>lydie</dc:creator><description>&lt;p&gt;Yes, but where? I printed in all handler function of each service, but no events are called.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Current consumption ble</title><link>https://devzone.nordicsemi.com/thread/209341?ContentTypeID=1</link><pubDate>Thu, 12 Sep 2019 08:40:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88a703c3-b0ca-4489-9721-8013b4c7f152</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Well, you could print the values with the UART interface or monitor the registers of the peripherals in debug session.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Current consumption ble</title><link>https://devzone.nordicsemi.com/thread/209216?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2019 14:08:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8191cac2-9a3c-41b2-a881-cc38515d0e79</guid><dc:creator>lydie</dc:creator><description>&lt;p&gt;Yes! Ok, and how can I know if any of EVENTS_xxxx are set to 1?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Current consumption ble</title><link>https://devzone.nordicsemi.com/thread/209199?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2019 13:33:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9256af4-3f99-459b-87c6-30ba435bdfa0</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Ok, so you are using the UART to print log statements? By EVENTS_xxxx I mean the EVENTS registers for each of the peripherals, e.g. the UART event registers listed here: &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/uart.html?cp=3_1_0_49_9#topic"&gt;UART&amp;nbsp;Registers&lt;/a&gt;&lt;/p&gt;
&lt;table border="1" cellpadding="4" cellspacing="0" frame="border" rules="all" summary=""&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td colspan="1" headers="d19014343e543" rowspan="1" valign="top" width="15%"&gt;EVENTS_CTS&lt;/td&gt;
&lt;td colspan="1" headers="d19014343e546" rowspan="1" valign="top" width="15%"&gt;0x100&lt;/td&gt;
&lt;td colspan="1" headers="d19014343e549" rowspan="1" valign="top" width="60%"&gt;
&lt;p&gt;CTS is activated (set low). Clear To Send.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="1" headers="d19014343e543" rowspan="1" valign="top" width="15%"&gt;EVENTS_NCTS&lt;/td&gt;
&lt;td colspan="1" headers="d19014343e546" rowspan="1" valign="top" width="15%"&gt;0x104&lt;/td&gt;
&lt;td colspan="1" headers="d19014343e549" rowspan="1" valign="top" width="60%"&gt;
&lt;p&gt;CTS is deactivated (set high). Not Clear To Send.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="1" headers="d19014343e543" rowspan="1" valign="top" width="15%"&gt;EVENTS_RXDRDY&lt;/td&gt;
&lt;td colspan="1" headers="d19014343e546" rowspan="1" valign="top" width="15%"&gt;0x108&lt;/td&gt;
&lt;td colspan="1" headers="d19014343e549" rowspan="1" valign="top" width="60%"&gt;
&lt;p&gt;Data received in RXD&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="1" headers="d19014343e543" rowspan="1" valign="top" width="15%"&gt;EVENTS_TXDRDY&lt;/td&gt;
&lt;td colspan="1" headers="d19014343e546" rowspan="1" valign="top" width="15%"&gt;0x11C&lt;/td&gt;
&lt;td colspan="1" headers="d19014343e549" rowspan="1" valign="top" width="60%"&gt;
&lt;p&gt;Data sent from TXD&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="1" headers="d19014343e543" rowspan="1" valign="top" width="15%"&gt;EVENTS_ERROR&lt;/td&gt;
&lt;td colspan="1" headers="d19014343e546" rowspan="1" valign="top" width="15%"&gt;0x124&lt;/td&gt;
&lt;td colspan="1" headers="d19014343e549" rowspan="1" valign="top" width="60%"&gt;
&lt;p&gt;Error detected&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="1" headers="d19014343e543" rowspan="1" valign="top" width="15%"&gt;EVENTS_RXTO&lt;/td&gt;
&lt;td colspan="1" headers="d19014343e546" rowspan="1" valign="top" width="15%"&gt;0x144&lt;/td&gt;
&lt;td colspan="1" headers="d19014343e549" rowspan="1" valign="top" width="60%"&gt;
&lt;p&gt;Receiver timeout&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;If any of these registers are set to 1, i.e. there is a pending event, then&amp;nbsp;&lt;span&gt;sd_app_evt_wait will return immediatly.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Bjørn&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Current consumption ble</title><link>https://devzone.nordicsemi.com/thread/209176?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2019 12:49:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c07e38e1-7d55-4191-b99b-c78e77625c7a</guid><dc:creator>lydie</dc:creator><description>&lt;p&gt;No I&amp;rsquo;m not using Log API. What do you mean by EVENTS_xxxx&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Current consumption ble</title><link>https://devzone.nordicsemi.com/thread/209173?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2019 12:40:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42849ea2-bd7a-4026-901b-21d77c5a5056</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Ok, so when you print you&amp;#39;re not using the nRF_LOG API? Or do you mean that you tested bot with log enabled and with logging disabled?&lt;/p&gt;
&lt;p&gt;If none of the event handlers below are called then I would check the peripherals that you are using in your application, i.e. see if any of the EVENTS_xxxx registers are set to 1 prior to calling&amp;nbsp;sd_app_evt_wait().&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Bjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Current consumption ble</title><link>https://devzone.nordicsemi.com/thread/209140?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2019 11:04:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3cee3a16-9480-46c3-9e43-4a56f70463a3</guid><dc:creator>lydie</dc:creator><description>&lt;p&gt;Yes&amp;nbsp;that&amp;rsquo;s right. When idle_state_handle() is called, an&amp;nbsp;event arrives and immediately wakes up the device, so the current has&amp;nbsp;not time to decrease. I print something in the &lt;span&gt;idle_state_handle() function, and it is print a lot of time like it&amp;nbsp;was trying to sleep but it couldn&amp;rsquo;t.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Yes I disabled Log.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Current consumption ble</title><link>https://devzone.nordicsemi.com/thread/209137?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2019 10:51:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ee750dc-31fc-4e4c-a591-2069c7af22fb</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;OK, so the nRF device is acting as the BLE central and the phone is the BLE peripheral?&lt;/p&gt;
[quote user="lydie"]I print something in all event handler function (which represents all services I use)&lt;br /&gt;like&amp;nbsp;on_hts_evt(),&amp;nbsp;on_cts_c_evt,&amp;nbsp;fds_evt_handler,&amp;nbsp;pm_evt_handler,&amp;nbsp;saadc_event_handler,&amp;nbsp;db_disc_handler,&amp;nbsp;gatt_evt_handler,&amp;nbsp;on_adv_evt,&amp;nbsp;nus_data_handler,&amp;nbsp;on_ias_evt,&amp;nbsp;on_lls_evt,&amp;nbsp;on_ias_c_evt,&amp;nbsp;ble_evt_handler,&amp;nbsp;bsp_event_handler&lt;br /&gt;No events appear in these functions. So how can I know what event is keeping my cpu from sleeping?&amp;nbsp;&amp;nbsp;[/quote]
&lt;p&gt;&amp;nbsp;Ok, then we need to check if&amp;nbsp;&lt;span&gt;idle_state_handle() is returning immediatly or not.&lt;/span&gt;&amp;nbsp;Do you have the possiblity to&amp;nbsp;&lt;span&gt;&amp;nbsp;toggle a GPIO after calling idle_state_handle() and then monitoring the GPIO using a logic analyzer or oscilloscope?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Note that having logging enabled will increase the current consumption so it should be disabled when measuring the current consumption. Thats why I usually toggle a GPIO instead of printing log statements.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Bjørn&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Current consumption ble</title><link>https://devzone.nordicsemi.com/thread/209123?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2019 09:52:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4807790d-869a-424e-9a41-5ebb45293e1b</guid><dc:creator>lydie</dc:creator><description>&lt;p&gt;No in mA, otherwise it doesn&amp;#39;t work. When I&amp;#39;m connected, I do that:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;case BLE_GAP_EVT_CONNECTED: {
    NRF_LOG_INFO(&amp;quot;Connected.&amp;quot;);
    printf(&amp;quot;Connected.\n&amp;quot;);
    err_code = bsp_indication_set(BSP_INDICATE_USER_STATE_OFF);
    APP_ERROR_CHECK(err_code);
    // Assign connection handle to the Queued Write module.
    m_conn_handle = p_ble_evt-&amp;gt;evt.gap_evt.conn_handle;
    err_code = nrf_ble_qwr_conn_handle_assign(&amp;amp;m_qwr, m_conn_handle);
    APP_ERROR_CHECK(err_code);
     
    memset(&amp;amp;m_ble_db_discovery,0,sizeof(m_ble_db_discovery));
    // Discover peer&amp;#39;s services.
    err_code = ble_db_discovery_start(&amp;amp;m_ble_db_discovery,
        p_ble_evt-&amp;gt;evt.gap_evt.conn_handle);
    APP_ERROR_CHECK(err_code);

    // Used to track connections state
    isConnected = true;

   // sd_ble_gap_rssi_start(p_ble_evt-&amp;gt;evt.gap_evt.conn_handle, 3, 0);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;When I&amp;#39;m not connected, I&amp;#39;m advertising because I call&amp;nbsp;advertising_start() in the main function. The advertising interval is :&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define APP_ADV_INTERVAL 40&lt;/pre&gt; So it is less than 100ms.&lt;/p&gt;
&lt;p&gt;I print something in all event handler function (which represents all services I use)&lt;br /&gt;like&amp;nbsp;on_hts_evt(),&amp;nbsp;on_cts_c_evt,&amp;nbsp;fds_evt_handler,&amp;nbsp;pm_evt_handler,&amp;nbsp;saadc_event_handler,&amp;nbsp;db_disc_handler,&amp;nbsp;gatt_evt_handler,&amp;nbsp;on_adv_evt,&amp;nbsp;nus_data_handler,&amp;nbsp;on_ias_evt,&amp;nbsp;on_lls_evt,&amp;nbsp;on_ias_c_evt,&amp;nbsp;ble_evt_handler,&amp;nbsp;bsp_event_handler&lt;br /&gt;No events appear in these functions. So how can I know what event is keeping my cpu from sleeping?&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Current consumption ble</title><link>https://devzone.nordicsemi.com/thread/209115?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2019 09:14:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69eb7071-a956-419d-ac39-4858dd816c6d</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;OK, the resolution of the&amp;nbsp;Fluke 87 V is 0,01 µA. The Fluke meter is set to uA when you&amp;#39;re measuring the System On current right? I just want to make sure that the measurement HW is accurate enough, otherwise the current measurements can be way off, showing higher average current consumption because either the resolution or sampling rate isnt high enough.&amp;nbsp; We see a lot of measurements done with HW that is not accurate enough and the average current consumption numbers will then be all over the place.&amp;nbsp;&lt;/p&gt;
[quote user="lydie"]But as I said, the mean of measuring the current is not the problem because I can see the current variation when it goes to sleep (system ON) and when it is not connected.[/quote]
&lt;p&gt;&amp;nbsp;Are you initializing any peripherals when you get the connected event? Are you advertising when you&amp;#39;re not connected? If so which advertisment interval? If you&amp;#39;re expecting the nRF to sleep in between the advertising events, then you can toggle a GPIO after calling idle_state_handle(). If the nRF is only waking up from the advertisment events, then you should see the GPIO toggle at the same interval.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If it toggles at a higher interval, then I would start putting log statements or toggeling GPIOs in event handlers to figure which event thats waking up the nRF.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Bjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Current consumption ble</title><link>https://devzone.nordicsemi.com/thread/209093?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2019 08:11:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d3fc896-5578-4df2-a36a-d581fe959fd6</guid><dc:creator>lydie</dc:creator><description>&lt;h1 class="col-xs-12 main-page-header"&gt;&lt;/h1&gt;
&lt;p&gt;Fluke 87 Handheld Digital Multimeter, 10A ac 1000V ac 10A dc 1000V dc. But as I said, the mean of measuring the current is not the problem because I can see the current variation when it goes to sleep (system ON) and when it is not connected.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Current consumption ble</title><link>https://devzone.nordicsemi.com/thread/209084?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2019 07:46:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f44773e-d599-427f-b5a8-fc2fb9df92fb</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;What is the brand and model of the muitmeter? Usually a regular multimeters do not have the dynamic range to accurately measure the current consumption of the nRF52 family ICs.&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/hardware-and-layout/posts/current-measurement-guide-introduction"&gt;https://devzone.nordicsemi.com/nordic/short-range-guides/b/hardware-and-layout/posts/current-measurement-guide-introduction&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/hardware-and-layout/posts/current-measurement-guide-measuring-current-with-p"&gt;https://devzone.nordicsemi.com/nordic/short-range-guides/b/hardware-and-layout/posts/current-measurement-guide-measuring-current-with-p&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;An ampere-meter will measure average current drawn by the nRF52832 if:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The nRF52832 is in a state which draws a constant current, or, the activity on the device changing load current, like BLE connection events, is repeated continuously and has a short cycle time (less than 100ms) so the ampere-meter will average whole load cycles and not parts of the cycle.&lt;/li&gt;
&lt;li&gt;The dynamic range of the ampere-meter is wide enough to give accurate measurements from a microamp to 15 milliamps.&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Current consumption ble</title><link>https://devzone.nordicsemi.com/thread/209076?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2019 07:19:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66bcf87e-f711-414b-8718-6bb3364510b3</guid><dc:creator>lydie</dc:creator><description>&lt;p&gt;I don&amp;#39;t know, it is a multimeter. But I can see the current which decreases when my phone is not connected by Bluetooth so the problem is not the amperemeter. I disabled all timers, so if they are no advertising (on_adv_evt&amp;nbsp;not called), after 10 sec (APP_ADV_DURATION&amp;nbsp; 1000), sleep_enter_mode must be called, but it&amp;#39;s not the case.&amp;nbsp;I don&amp;#39;t see what type of event can prevent sleep mode from being activated.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Current consumption ble</title><link>https://devzone.nordicsemi.com/thread/209072?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2019 07:02:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39a5bfed-a225-43f6-8fee-3517ceaaa072</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Which specific amperemeter? What is the resolution of the amperemter? It needs to&amp;nbsp;have a dynamic range&amp;nbsp;able to accurately measure currents from nA to mA.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Current consumption ble</title><link>https://devzone.nordicsemi.com/thread/209060?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2019 06:08:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4ec26ac-f1a8-4c76-9747-d3b189af46f0</guid><dc:creator>lydie</dc:creator><description>&lt;p&gt;I&amp;#39;m using a serial amperemeter. + is connected to my gbf, and the com VDD of my device. Yes CTS example and I haven&amp;#39;t made any changes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Current consumption ble</title><link>https://devzone.nordicsemi.com/thread/209058?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2019 05:55:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27163794-c585-49f4-8469-037853a5c3d5</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;How are you measuring the current consumption, i.e. setup? What type of measurement hardware are you using?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="lydie"] I tried with cts example, but the current neved decreases when I&amp;#39;m connected.[/quote]
&lt;p&gt;&amp;nbsp;The default CTS example, i.e. nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_cts_c ? No changes made?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Current consumption ble</title><link>https://devzone.nordicsemi.com/thread/209000?ContentTypeID=1</link><pubDate>Tue, 10 Sep 2019 14:23:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14130f9e-f609-43a9-afee-aa49a3155bab</guid><dc:creator>lydie</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using sdk15.3. Ok I understand, so to decrease the current, I have to find which event or advertisement prevent the CPU from sleeping. But I haven&amp;#39;t found any events. I tried with cts example, but the current neved decreases when I&amp;#39;m connected.&lt;/p&gt;
&lt;p&gt;Thanks for your reply.&lt;/p&gt;
&lt;p&gt;Lydie&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Current consumption ble</title><link>https://devzone.nordicsemi.com/thread/208879?ContentTypeID=1</link><pubDate>Tue, 10 Sep 2019 11:11:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d68328c8-e493-40b2-80cb-a53784e40266</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hi Lydie,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;which S132 version and SDK version are you using?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;All the BLE examples in our nRF5 SDK will go to sleep when the CPU is idling, i.e. in between connection events and advertisment events. Our SoftDevice is 100% event driven so, whenever the nRF is in the main for() loop it will call&amp;nbsp;idle_state_handle(), which in turn calls&amp;nbsp;nrf_pwr_mgmt_run(), which in turn calls&amp;nbsp;sd_app_evt_wait() or __WFE(). These functions will make the CPU sleep until there is an interrupt or event that wakes up the chip, i.e. a timer expiring or a BLE event like advertisment or a connection event. So as long as you&amp;#39;re calling&amp;nbsp;&lt;span&gt;idle_state_handle() in the main for loop, the nRF should go to sleep in between connection events.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void nrf_pwr_mgmt_run(void)
{
    PWR_MGMT_FPU_SLEEP_PREPARE();
    PWR_MGMT_SLEEP_LOCK_ACQUIRE();
    PWR_MGMT_CPU_USAGE_MONITOR_SECTION_ENTER();
    PWR_MGMT_DEBUG_PIN_SET();

    // Wait for an event.
#ifdef SOFTDEVICE_PRESENT
    if (nrf_sdh_is_enabled())
    {
        ret_code_t ret_code = sd_app_evt_wait();
        ASSERT((ret_code == NRF_SUCCESS) || (ret_code == NRF_ERROR_SOFTDEVICE_NOT_ENABLED));
        UNUSED_VARIABLE(ret_code);
    }
    else
#endif // SOFTDEVICE_PRESENT
    {
        // Wait for an event.
        __WFE();
        // Clear the internal event register.
        __SEV();
        __WFE();
    }

    PWR_MGMT_DEBUG_PIN_CLEAR();
    PWR_MGMT_CPU_USAGE_MONITOR_SECTION_EXIT();
    PWR_MGMT_SLEEP_LOCK_RELEASE();
}

static void idle_state_handle(void)
{
    if (NRF_LOG_PROCESS() == false)
    {
        nrf_pwr_mgmt_run();
    }
}


/**@brief Function for application main entry.
 */
int main(void)
{
    // Initialize.
    log_init();
    leds_init();
    timers_init();
    buttons_init();
    power_management_init();
    ble_stack_init();
    gap_params_init();
    gatt_init();
    services_init();
    advertising_init();
    conn_params_init();

    // Start execution.
    NRF_LOG_INFO(&amp;quot;Blinky example started.&amp;quot;);
    advertising_start();

    // Enter main loop.
    for (;;)
    {
        idle_state_handle();
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If its not going to sleep, then there must be a pending event/interrupt that keeps the CPU from sleeping, i.e. causes&amp;nbsp;&lt;span&gt;sd_app_evt_wait() or __WFE() to return immediately.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user=""]On online power profiler,&amp;nbsp;the power consumes when there is a connection but the device is asleep is not indicated, so I don&amp;#39;t know if it is normal or not.&amp;nbsp;[/quote]
&lt;p&gt;&amp;nbsp;The online power profiler will calculate the average current consumption with the assumption that the CPU goes to sleep inbetween connection and/or advertisment events.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Bjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Current consumption ble</title><link>https://devzone.nordicsemi.com/thread/208780?ContentTypeID=1</link><pubDate>Tue, 10 Sep 2019 04:41:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51378ffa-13e4-470e-ad3e-ec46d2228893</guid><dc:creator>lydie</dc:creator><description>&lt;p&gt;I think when my phone is connected to my device, it can&amp;#39;t enter in a sleeping mode, that&amp;#39;s why the current is always around 1.5mA. So my question is how enter the device I sleeping mode when my phone is connected?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>