Hi,
I know that many people ask this question on different posts but I was not able to find the right solution for my case.
I am observing an average current of 4.7uA in System OFF mode instead of 0.3uA from the datasheet.
I’m using the BLE module BL651 from Laird Connectivity which contains a nrf52810.
I started from ble_app_beacon example with SDK 16.0. It uses s112 softdevice if I am not mistaken.
Here is my code:
int main(void) { ret_code_t err_code; /* Initialize gpiote module */ err_code = nrf_drv_gpiote_init(); APP_ERROR_CHECK(err_code); /* Initialize led pin */ nrf_drv_gpiote_out_config_t out_config = GPIOTE_CONFIG_OUT_SIMPLE(false); /*Configure output led*/ err_code = nrf_drv_gpiote_out_init(LED_PIN, &out_config); /*Initialize output led*/ APP_ERROR_CHECK(err_code); /*Check potential error*/ nrf_drv_gpiote_out_clear(LED_PIN); /*Turn on LED to indicate that nRF5x is not in System-off mode*/ nrf_delay_ms(3000U); /*Configure wake-up button*/ nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_LOTOHI(false); /*Configure to generate interrupt and wakeup on pin signal low. "false" means that gpiote will use the PORT event, which is low power, i.e. does not add any noticable current consumption (<<1uA). Setting this to "true" will make the gpiote module use GPIOTE->IN events which add ~8uA for nRF52 and ~1mA for nRF51.*/ in_config.pull = NRF_GPIO_PIN_PULLDOWN; /*Configure pullup for input pin to prevent it from floting. Pin is pulled down when button is pressed on nRF5x-DK boards, see figure two in http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52/dita/nrf52/development/dev_kit_v1.1.0/hw_btns_leds.html?cp=2_0_0_1_4*/ err_code = nrf_drv_gpiote_in_init(ILS_PIN, &in_config, NULL); /*Initialize the wake-up pin*/ APP_ERROR_CHECK(err_code); /*Check error code returned*/ nrf_drv_gpiote_in_event_enable(ILS_PIN, true); /*Enable event and interrupt for the wakeup pin*/ /*Turn off LED to indicate the nRF5x is in System-off mode*/ nrf_drv_gpiote_out_set(LED_PIN); /*Enter System-off*/ NRF_POWER->SYSTEMOFF = 1; while(1) { // Wait for an event. __WFE(); // Clear the internal event register. __SEV(); __WFE(); } }
Here is the setup to measure current :
I supply the BLE651 with 3.0V directly by soldering wires on it. I measure current thanks to a PXI-4065 (National Instrument). On my circuit I have a button (and its pull down resistor) to wake up from system off and an LED (with its serie resistor) to indicate when device is awake. When programming the chip I use “Release” version (and not “debug”) and I disconnect the debugger (physically).
What I have tried:
- Connect a pull down resistor to SWCLK because I read on another post saying that a floating SWCLK could cause the chip to stay in debug mode
- Enable DCDC convertor with sd_power_dcdc_mode_set(NRF_POWER_DCDC_ENABLE );
- Ensure that Constant Latency Mode is disabled by writing sd_power_mode_set(NRF_POWER_MODE_LOWPWR);
- Disconnect the LED in case it sinks power
- Replace NRF_POWER->SYSTEMOFF = 1; by sd_power_system_off();
I have seen on other post that it was important to wake up on GPIOTE PORT event instead of IN event for consumption purpose. I think my problem is not related to this because I use GPIOTE_CONFIG_IN_SENSE_LOTOHI(false) with “false” argument.
I also thought the problem came from the fact that I do not use an external 32kHz crystal but I have read on forums that since no clock source is enabled in power off mode there is no need to have a low power crystal.
Any idea to solve this problem ?