This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

low power in advertising

I'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.

Is possible ?

Marco

Parents Reply Children
  • That could be the UART peripheral. As a test, try to not initialize/enable UART in your code. 

    The advertisement events will run in the "background". That is, the softdevice will not wake the application for every advertisement event. 

  • I have already removed the UART, this is my actual main:

    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'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(&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(&p_is_running);
    //    }
     //********************************************
    /*
        // Start execution.
        printf("\r\nUART started.\r\n");
        NRF_LOG_INFO("Debug logging for UART over RTT started.");
        value = 105;
        sprintf(debug_str, "valore di variabile = %d", value);
        NRF_LOG_INFO("%s",(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);
         }
    }
    

    I need that my device wake up from SLEEP (low power) only after a bluetooth connection.

    I need to use only few uA during advertising.

    On the oscilloscope I can see the I/O go up each 500 mS (in advertising),  this means that the micro is not in sleep.

    In the same time with an BPA400 bluetooth protocol analizer I can see the advertising at 1,28 sec:

    Marco

  • Please try to measure the current consumption with this .hex file:

    ble_app_beacon_w_softdevice.hex

    It'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?

  • I 'm using a my custom board. But now I have found the problem.

    I had forgotten to remove a timer that I used to update the battery service into  timers_init();

    Now if the device is in advertising I don't see the change in the I/O port.

    Thanks for your patient.

    Marco

Related