<?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>low power in advertising</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/38545/low-power-in-advertising</link><description>I&amp;#39;m using ble_app_uart example. 
 The board go in low power mode, but after 3 minutes (#define APP_ADV_DURATION 18000 ) go OFF. I need that remain in advertsing mode always. 
 Only with a bluetooth connection my board must resume and go in IDLE mode.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 14 Sep 2018 14:12:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/38545/low-power-in-advertising" /><item><title>RE: low power in advertising</title><link>https://devzone.nordicsemi.com/thread/148847?ContentTypeID=1</link><pubDate>Fri, 14 Sep 2018 14:12:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b826af37-e589-4b45-87e4-7a965d6a580e</guid><dc:creator>Marco Pennacchietti</dc:creator><description>&lt;p&gt;I &amp;#39;m using a my custom board. But now I have found the problem.&lt;/p&gt;
&lt;p&gt;&lt;span class="" id="result_box" lang="en"&gt;&lt;span class=""&gt;I had forgotten to remove a timer that I used to update the battery service&lt;/span&gt;&lt;/span&gt; into &amp;nbsp;timers_init();&lt;/p&gt;
&lt;p&gt;Now if the device is in advertising I don&amp;#39;t see the change in the I/O port.&lt;/p&gt;
&lt;p&gt;Thanks for your patient.&lt;/p&gt;
&lt;p&gt;Marco&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power in advertising</title><link>https://devzone.nordicsemi.com/thread/148845?ContentTypeID=1</link><pubDate>Fri, 14 Sep 2018 14:00:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36ac94f7-4ed3-4550-b7e8-3626294c2136</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Please try to measure the current consumption with this .hex file:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-fb87f1120eb642058482d4427a3d5b0c/ble_5F00_app_5F00_beacon_5F00_w_5F00_softdevice.hex"&gt;devzone.nordicsemi.com/.../ble_5F00_app_5F00_beacon_5F00_w_5F00_softdevice.hex&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It&amp;#39;s based on the ble_app_beacon example with adv. interval changed to 1280ms. Are you measuring this on a Nordic development kit or a custom board?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power in advertising</title><link>https://devzone.nordicsemi.com/thread/148840?ContentTypeID=1</link><pubDate>Fri, 14 Sep 2018 13:40:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05adca55-054c-4ba3-9669-82d98d844c72</guid><dc:creator>Marco Pennacchietti</dc:creator><description>&lt;p&gt;I&lt;span class="short_text" id="result_box" lang="en"&gt;&lt;span class=""&gt; have already removed the UART, this is my actual main:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="short_text" lang="en"&gt;&lt;span class=""&gt;&lt;pre class="ui-code" data-mode="text"&gt;int main(void)
{
    bool erase_bonds;
    char debug_str[80] = {0};
    int value;
    unsigned char break_point;
    uint32_t p_is_running;

    // Initialize.
   // uart_init();
    
    log_init(); 
    timers_init();

    nrf_gpio_cfg_output(OUT_COMP);  // pin per visualizzare l&amp;#39;uscita digitale
    nrf_gpio_cfg(OUT_COMP, NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_DISCONNECT, NRF_GPIO_PIN_PULLDOWN/*NRF_GPIO_PIN_NOPULL*/, NRF_GPIO_PIN_H0H1, NRF_GPIO_PIN_NOSENSE);
    
 
    flag_connected = 0;

    //buttons_leds_init(&amp;amp;erase_bonds);
    power_management_init();
    ble_stack_init();
    gap_params_init();
    gatt_init();
    services_init();
    advertising_init();
    conn_params_init();

//********************************************
//    sd_clock_hfclk_request();
//    p_is_running = 0;
//    while (!p_is_running)
//    {
//        sd_clock_hfclk_is_running(&amp;amp;p_is_running);
//    }
 //********************************************
/*
    // Start execution.
    printf(&amp;quot;\r\nUART started.\r\n&amp;quot;);
    NRF_LOG_INFO(&amp;quot;Debug logging for UART over RTT started.&amp;quot;);
    value = 105;
    sprintf(debug_str, &amp;quot;valore di variabile = %d&amp;quot;, value);
    NRF_LOG_INFO(&amp;quot;%s&amp;quot;,(uint32_t)debug_str);
*/

    advertising_start();

    // Enter main loop.
    for (;;)
    {
        nrf_gpio_pin_clear(OUT_COMP);
        nrf_delay_ms(2);
        
         idle_state_handle();
        
        nrf_gpio_pin_set(OUT_COMP);
     
         nrf_delay_ms(2);
        //nrf_gpio_pin_toggle(OUT_COMP);
     }
}
&lt;/pre&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="short_text" lang="en"&gt;&lt;span class=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="short_text" lang="en"&gt;&lt;span class=""&gt;I need that my device wake up from SLEEP (low power) only after a bluetooth connection.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="short_text" lang="en"&gt;&lt;span class=""&gt;I need to use only few uA during advertising.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="short_text" lang="en"&gt;&lt;span class=""&gt;On the oscilloscope I can see the I/O go up each 500 mS (in advertising),&amp;nbsp; this means that the micro is not in sleep.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="short_text" lang="en"&gt;&lt;span class=""&gt;In the same time with an BPA400 bluetooth protocol analizer I can see the advertising at 1,28 sec:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="short_text" lang="en"&gt;&lt;span class=""&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/1040x499/__key/communityserver-discussions-components-files/4/2128527.capture.png" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="short_text" lang="en"&gt;&lt;span class=""&gt;Marco&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="short_text" lang="en"&gt;&lt;span class=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power in advertising</title><link>https://devzone.nordicsemi.com/thread/148832?ContentTypeID=1</link><pubDate>Fri, 14 Sep 2018 13:01:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f6cfd45-11a3-490d-acac-271904dd78ad</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;That&amp;nbsp;could be the UART peripheral. As a test, try to not initialize/enable UART in your code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The advertisement events will run in the &amp;quot;background&amp;quot;. That is, the softdevice will not wake the application for every advertisement event.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power in advertising</title><link>https://devzone.nordicsemi.com/thread/148825?ContentTypeID=1</link><pubDate>Fri, 14 Sep 2018 12:29:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ebaf447-8be6-49f6-b699-741b741c10fa</guid><dc:creator>Marco Pennacchietti</dc:creator><description>&lt;p&gt;when the application go in idle_state_handle(); is in low power ?&lt;/p&gt;
&lt;p&gt;I measure 1,9 mA.&lt;/p&gt;
&lt;p&gt;From your power management power example (&lt;a href="https://devzone.nordicsemi.com/power/"&gt;https://devzone.nordicsemi.com/power/)&lt;/a&gt; with&lt;/p&gt;
&lt;p&gt;3V, 1280 mS of advertising time, 31 bytes of payload and 0 dBm I&amp;#39;m aspected 13 uA.&lt;/p&gt;
&lt;p&gt;#define APP_ADV_INTERVAL&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; 1280&lt;/p&gt;
&lt;p&gt;The time 0,5 sec related with idle_state_handle() seem not connected with 1,28 sec of my advertising time.&lt;/p&gt;
&lt;p&gt;If an event arrive after 0,5 secod from last advertisment I&amp;#39;m aspected that the micro remain il low power and after 1,28 sec check the external event.&lt;/p&gt;
&lt;p&gt;Marco&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power in advertising</title><link>https://devzone.nordicsemi.com/thread/148810?ContentTypeID=1</link><pubDate>Fri, 14 Sep 2018 12:06:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55b1804c-0e3e-488f-b8e3-202fe60bd24b</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;The application is not going to receive any events if you only advertise so the application is going to stay in the&amp;nbsp;idle_state_handle() until you receive a connection event,etc.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power in advertising</title><link>https://devzone.nordicsemi.com/thread/148807?ContentTypeID=1</link><pubDate>Fri, 14 Sep 2018 11:58:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6c0f84a-dcde-46bb-8226-8a03bb5de56e</guid><dc:creator>Marco Pennacchietti</dc:creator><description>&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;in the main loop:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;pre class="ui-code" data-mode="text"&gt;    for (;;)
    {
        nrf_gpio_pin_clear(OUT_COMP);
        nrf_delay_ms(2);
        
          idle_state_handle();
        
        nrf_gpio_pin_set(OUT_COMP);
        nrf_delay_ms(2);
    }
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I have insert this code to test the difference when the device is connect or not.&lt;/p&gt;
&lt;p&gt;&lt;span class="" id="result_box" lang="en"&gt;&lt;span class=""&gt;When not connected I expected to see the port change at every interval time but there is no difference between CONNECTED or NOT CONNECTED.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="" id="result_box" lang="en"&gt;&lt;span class=""&gt;the routine &amp;nbsp;idle_state_handle(); always takes 0.5 seconds.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="" lang="en"&gt;&lt;span class=""&gt;The &amp;nbsp;idle_state_handle(); work only in relese mode ?&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="" lang="en"&gt;&lt;span class=""&gt;Marco&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="" lang="en"&gt;&lt;span class=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="" lang="en"&gt;&lt;span class=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="" lang="en"&gt;&lt;span class=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: low power in advertising</title><link>https://devzone.nordicsemi.com/thread/148801?ContentTypeID=1</link><pubDate>Fri, 14 Sep 2018 11:47:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cdcfb010-9d67-45e8-8d5e-22f3ff25a97a</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi Marco,&lt;/p&gt;
&lt;p&gt;You can disable advertisement timeout by setting&amp;nbsp;&lt;span&gt;APP_ADV_DURATION to 0 and&amp;nbsp;use the&amp;nbsp;BLE_GAP_ADV_FLAGS_LE_ONLY&lt;strong&gt;_GENERAL_&lt;/strong&gt;DISC_MODE flag in advertising_init().&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>