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

Peak current when the nRF52 is in the SYSTEM ON mode

Hello,

I have done some consumption measurement but I have a strange behaviour while the nRF52840 is in the SYSTEM ON mode.

For the measurement, I send advertising packet each 1 second and then I put the nRF52840 in the SYSTEM ON mode. When the system is in SYSTEM ON mode I measure peak, but I don't know why. Are there any internal process in SYSTEM ON mode that generate these peaks ?

Plot of the measurement:

Test setup :

  - Segger Embedded Studio - SDK V14.2 SoftDevices 5
  - Windows
  - PCA10056 - nRF52840-PDK

Parents Reply Children
  • Sigurd,

    I know how the System ON mode and how the advertising work. You don't answer my question. Maybe it was not clear. So, my question is about the peak that occur when my mcu is in System On mode. So, I talk about the peaks after the data transmission. In resume, why I measure peaks between 31.5 and 31.88 s and also 32.2 and 32.5 (MCU is in System On mode between these intervals).

  • Ok, I understand. These other peaks at around 3-4 mA could be some interrupt that is triggered, the CPU will then wake up, and then go back to idle mode again after the interrupt has been served.

    What example in the SDK are you testing?

  • I use my own code.

    I simply configure the Advertising and then advertise each second. On infinite loop side I use the power_manage(); function to manage the power. That's all.

    Is it possible that when the MCU is in System On mode it performs a refresh memory ?

  • It looks like spikes casued by interrupts. 

    Are you able to connect to the device with a BLE central?

    I use my own code.

     Do you see the same spikes with the BLE SDK examples?

  • This is a broadcaster so there're no connection.

    Yes, same result with beacon example. In fact, I use the same principle ...

    Here's the basic test code : 

    static void advertising_init(void){
        uint32_t      err_code;
        int8_t tx_power = 0;
        ble_gap_conn_sec_mode_t sec_mode;
        
        ble_advdata_manuf_data_t manuf_specific_data;
        ble_advdata_t advdata;
        
        BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);
        err_code = sd_ble_gap_device_name_set(&sec_mode,
                                              (const uint8_t *) DEVICE_NAME,
                                              strlen(DEVICE_NAME));
        APP_ERROR_CHECK(err_code);
    
        err_code = sd_ble_gap_tx_power_set(tx_power);//Set the radio's transmit power in dBm.
            
        sd_power_dcdc_mode_set(1);
        
        manuf_specific_data.company_identifier = APP_COMPANY_IDENTIFIER;
        manuf_specific_data.data.p_data = (uint8_t *) BLE_data;
        manuf_specific_data.data.size   = sizeof(BLE_data);
    
        // Build and set advertising data.
        memset(&advdata, 0, sizeof(advdata));
    
        advdata.name_type             = BLE_ADVDATA_FULL_NAME;
        //advdata.short_name_len        = strlen(DEVICE_NAME)-3;
        advdata.flags                 = BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED;
        advdata.p_manuf_specific_data = &manuf_specific_data;
    
        err_code = ble_advdata_set(&advdata, NULL);
        APP_ERROR_CHECK(err_code);
        // Initialize advertising parameters (used when starting advertising).
        memset(&m_adv_params, 0, sizeof(m_adv_params));
    
        m_adv_params.type            = BLE_GAP_ADV_TYPE_ADV_NONCONN_IND;//BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED;//
        m_adv_params.p_peer_addr     = NULL;    // Undirected advertisement.
        m_adv_params.fp              = BLE_GAP_ADV_FP_ANY;
        m_adv_params.interval        = NON_CONNECTABLE_ADV_INTERVAL;
        m_adv_params.timeout         = 0;       // Never time out.
    }
    
    /**@brief Function for initializing the BLE stack.
     *
     * @details Initializes the SoftDevice and the BLE event interrupt.
     */
    static void ble_stack_init(void){
    
        ret_code_t err_code;
    
        err_code = nrf_sdh_enable_request();
        APP_ERROR_CHECK(err_code);
    
        // Configure the BLE stack using the default settings.
        // Fetch the start address of the application RAM.
        uint32_t ram_start = 0;
        err_code = nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &ram_start);
        APP_ERROR_CHECK(err_code);
    
        // Enable BLE stack.
        err_code = nrf_sdh_ble_enable(&ram_start);
        APP_ERROR_CHECK(err_code);
    }
    
    static void advertising_start(void){
        ret_code_t err_code;
    
        err_code = sd_ble_gap_adv_start(&m_adv_params, APP_BLE_CONN_CFG_TAG);
        APP_ERROR_CHECK(err_code);
    }
    
    int main(void)
    {    
      
      ble_stack_init();
      advertising_init();
      advertising_start();
    
    while (1){
        
                power_manage();
        }
    }

Related