Is lowest power consumption of 1.2uA possible using nrf52832 & SYSTEM_ON (s132, SDK17) for GATTS - Central

Hi nRF community,

I have a question regarding the lowest power consumption ever possible with nRF52832 chip.

I'm experimenting with power consumption using nRF52832 DK (PCA10040 1.2.1), talking to another nRF52832DK.

I run a central (based on GATTS example) scanning for my peripheral, I use SDK17.1 + S132.

The SDK is configured to have no logs and external interfaces, and most of the peripherals are disabled + I use DCDC.

After the BLE initialization is complete I set up the interrupt event for GPIOTE.

The entire thing is configured and run's properly for the BLE piece but I want it to have a smaller consumption while I'm in idle state (during __WFE()).

Before entering the main loop I call "  sd_power_mode_set(NRF_POWER_MODE_LOWPWR) " function and basicly wait for an event on the interrupt to start scanning.

Currently according to nRF PPK2 I'm consuming around 18 microamps, but the question is can I get it 10 times smaller, like 1.2 ~ 2 uA (microamps)?

What other peripherals I can disable if I use SoftDevice and BLE ? 

Regards, 

Dmytro.

Parents
  • Hello,

    So when you measure the current and you get 18 µA, what is your application doing at that point? Advertising? Scanning? in a connection? Is the SoftDevice enabled? 

    Did you see any numbers indicating that the current consumption should be around 1.2-2µA at this stage?

    Best regards,

    Edvin

  • Hi Edvin,

    Regarding your quetion's : 

    I have most of application modules enabled (the code I execute is listed below)

    int main(void)
    {
        // Initialize.
        external_interrupt_init();     // Enable external event on rising pulse edge (lo-to-hi)
        power_management_init();     // Init power manager
        ble_stack_init();     // Init the BLE stack
        gatt_init();     // Init GATT's
        services_init();     // Init BLE services + characteristic
        scan_init();     // Init BLE Scan module
        sd_power_mode_set(NRF_POWER_MODE_LOWPWR);     // Configre power manager to keep LP mode

        // Enter main loop.
        for (;;) {
            my_state_machine(); // State machine that starts scan on interrupt event
            APP_ERROR_CHECK(sd_app_evt_wait()); // Power mamnger __WFE
       }
    }

    When I have SoftDevice enabled + GATT + Service + scan init + GPIOTE - I have 18 uA consumption.

    I need to get the lowest consumption for the SYSTEM_ON mode described in nRF52832 1.8 PS

    https://infocenter.nordicsemi.com/pdf/nRF52832_PS_v1.8.pdf - page 80.

    It is stated that SYSTEM_ON full ram retention [no ram retention] is 1.5 uA [1.2 uA] only, how can I get my system to consume that little power?

  • dmytro.m said:
     If variable is set to "1" I start scanning. Initially the variable is set to 0.

    Can you please show me some snippets on how it is set, and how it is checked?

    The SoftDevice shouldn't use more power if you are not using it for anything. That being said, it is possible to disable the softdevice. Please check out the declaration of sd_softdevice_disable() in nrf_sdm.h.

    Do you see a different current consumption if you do not enable the SoftDevice in the first place?

    BR,
    Edvin

  • Hi Edvin, sure I can share my code, I applied some additional efforts to get you the way to reproduce it.

    Not to deal with my messy experimental code I did some basic changes in the nRF SDK17 example for GATT's central that initially was used ( I took it from here "nRF5_SDK_17.1.0_ddde560\examples\ble_central\ble_app_gatts") and got pretty same result of ~22 uA. I also have added the snippet for state machine that does the scanning, added my interrupt pin init function and handler to trigger the state machine, added couple of variables and definitions and comented out couple of lines (attaching "main.c" in .zip). The most changes were made in the "sdk_config.h", they are the following (attaching my "sdk_config.h" file in .zip):

    BSP_BTN_BLE_ENABLED 0

    NRFX_POWER_ENABLED 1

    NRFX_UARTE_ENABLED 0

    NRFX_UART_ENABLED 0

    POWER_ENABLED 1

    POWER_CONFIG_DEFAULT_DCDCEN 1

    UART_ENABLED 0

    UART0_ENABLED 0

    APP_TIMER_ENABLED 0

    BUTTON_ENABLED 0

    NRF_LOG_BACKEND_UART_ENABLED 0

    NRF_LOG_ENABLED 0

    NRF_SDH_BLE_LOG_ENABLED 0

    NRF_SDH_LOG_ENABLED 0

    NRF_SDH_SOC_LOG_ENABLED 0

    PM_LOG_ENABLED 0

    To trigger the interrupt event - Dupont wire need to be applied from P0.27 to a VDD pin.

    To build the entire thing I use IAR IDE ( EWB 4 ARM 8.32.2 )

    So the question is - what else need to be done with the sdk.config or what ever in the code to make it consume 1.2 uA ?

    I did a quick test on my project and used "sd_softdevice_disable()" but have not noticed any change in the consumption, so the question is still open.

    Kind regards, Dmytro.

    ble_app_gatts.zip

  • Hello,

    Sorry for the late reply. I have not tested this yet, but I just wanted to let you know that this ticket is not forgotten. I will look into it as soon as I can.

    Sorry for the inconvenience.

    BR,

    Edvin

  • Hey Edvin, sure, take your time, I'm also doing some more of the research on the SoftDevice consumption optimization. Let me know if you have any ideas on that one.

    Regards,

    Dmytro.

  • Hello,

    Can you please zip and send the project folder that you are using? Please test it by unzipping it in an unmodified SDK to check that I will be able to compile it. 

    Regarding SoftDevice and power consumption, as long as you do not use any of it's features (advertising, scanning or being in a connection), it should not draw any extra current.

    Only having the two files that you provided, I will have to include all the extra files that are required to build it. While it is possible, I would need to do changes, and when doing those changes, I don't know if I end up with the same application that you are using.

    These are the initial build errors that I see:

    Try unzipping a completely unmodified SDK, and replace the main.c and sdk_config.h with the ones that you sent, and see what other changes that you did to make these errors go away.

    BR,

    Edvin

Reply
  • Hello,

    Can you please zip and send the project folder that you are using? Please test it by unzipping it in an unmodified SDK to check that I will be able to compile it. 

    Regarding SoftDevice and power consumption, as long as you do not use any of it's features (advertising, scanning or being in a connection), it should not draw any extra current.

    Only having the two files that you provided, I will have to include all the extra files that are required to build it. While it is possible, I would need to do changes, and when doing those changes, I don't know if I end up with the same application that you are using.

    These are the initial build errors that I see:

    Try unzipping a completely unmodified SDK, and replace the main.c and sdk_config.h with the ones that you sent, and see what other changes that you did to make these errors go away.

    BR,

    Edvin

Children
  • Hi Edvin, 

    Done. I have packed the entire project folder, and was able to get it compiling, flashing and working with no errors after unpacking prepared archive, attaching it here. I will also add my .hex just for the test on your end to chec the current consumption level for my build.

    Kind regards,

    Dmytro.

    ble_app_gatts_pca10040_s132_LP.hex

    hex
    3175.ble_app_gatts.zip

    zip

    iar build

  • What does your nrfx_uarte.c file look like? The reason I ask is that I don't have IAR installed, but when I try to compile using the SES project, I am not able to, because of the lacking definitions that I showed in a screenshot in my previous reply. 

    I can fix it by changing a few of the sdk_config.h definitions, but I suspect that you have just removed the line:

    #if NRFX_CHECK(NRFX_UART_ENABLED)

    in nrfx_uart.c.

    If that is the case, did you change anything else in the SDK files? Did you try to unzip it in a pristine (unmodified) SDK?

    Either way, the UART in this project is only used for logging, which is disabled, so I don't think this should matter for the current consumption, but if you did changes like these, perhaps you did other changes that could affect the current consumption as well, which is why I am keep nagging about this. 

    Either way, I decided to just do the fixes to make it compile, and I initially saw about the same current consumption as you see. I set the samples per second in the PPK FW to maximum, which gives a higher resolution(but the same average numbers). 

    I then started looking into the application. I saw that commenting out external_interrupt_init(); reduced the current consumption to about 7µA. I then saw that you used:

    nrfx_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_LOTOHI(true);

    where the "true" means high accuracy mode. While this is more accurate, it also requires more current. If you only need it for a simple button push, you can use the low accuracy mode. To test it properly on a DK, I changed the EXT_EVT_INT_PIN to 13 (Button 1), and set the in_config like this:

    nrfx_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_HITOLO(false);
    in_config.pull = NRF_GPIO_PIN_PULLUP;

    to match the HW in the buttons. 

    Also, adding a switch to turn off scanning, to see that the current consumption goes down again. I only did changes to sdk_config.h and main.c in the attached project. Other than those, it is identical to what you sent me. The changes in sdk_config.h was just to be able to compile, so if you already changed nrfx_uarte.c, you probably don't need those changes in sdk_config.h. Only main.c.

    4606.ble_app_gatts.zip

    So the main takeaway is to set the in_config to low_accuracy, using GPIOTE_CONFIG_IN_SENSE_LOTOHI(false);

    Best regards,

    Edvin

  • Hi Edvin, thanks, I will give it a try to see if there any significant change in the consumption.

  • Hi Edvin.

    I have conducted the test with GPIOTE_CONFIG_IN_SENSE_LOTOHI(false) and got some consumption reduction but it was still at around 15 micro amps.

    I intended to get the better current readings for my nRF52832 DK as those were to noisy and attached my DUT to a LiPo battery to see if any difference and I was amazed seeing the 1.9 uA consumption. So it turns out when nRF DK runs on a micro USB cable it consumes significantly more, compared to a battery powered version.

    I didn't got my 1.2 uA, but I'm pretty happy with 1.9 uA consumption, it fits my needs, thanks for the clue with the GPIOTE low accuracy config, it did worked, it have increased the interrupt processing time slightly but still fit my timing requirements, so it is solved. The ticket can be closed. Thank You !!!

    Regards, Dmytro.

Related