High current consumption during idle_state

nRF52810, sdk 17.0.2, softdevice s112

I am working on a modified ble_app_uart.c example on a custom board that has a motion sensor.

The task is to start advertising for 15 seconds when a movement occurs. The motion sensor sends an interrupt to the nRF when motion is detected.

I am trying to reduce the current consumption during advertising and hope to get any hints on what to check.

To see what draws power I have disabled ad converter, advertising, spi module so I think the nRF is not doing anything at all.

I am OK with the "sleep mode enter()" which call upon "sd_power_system_off();"  which reduces the consumption to < 20uA and the nRF wakes up if an interrupt from the motion sensor is detected. But I would like the "idle_state_handle();"which calls "nrf_pwr_mgmt_run();" to lower the consumption to less than 0.7mA. Anyway it does something good because if "idle_state_handle(); is not executed the currrent consumption is 4.5mA

So, is there a way to lower the current consumption more calling the idle_state_handle() routine? 

for (;;)
{
    if ((!advertising_is_on) && (!BLE_is_connected))
    {
        sleep_mode_enter(); // Lowers current consumption to less than 20uA
    }
   else
   {
        idle_state_handle(); // This lowers the consumption from about 4.5mA to 0.7mA
   }
}

Parents Reply Children
  • The example is by default setup to forward data between HW UART and "UART" over BLE. So I assume you have commented out for instance uart_init() then?

    Kenneth

  • Is there any way to see what is running/activated  so I can check if something is activated that I don't want to have?

  • Some events may be unexpectedly set and need to be cleared, for example CTS is set even if HW flow control is never enabled; unless bare-metal much of the handling of these is hidden:

    Event:  CLOCK->EVENTS_LFCLKSTARTED      0x40000104 = 1 0x104 (No Enable)
    Event:   EGU0->EVENTS_TRIGGERED[0]      0x40014100 = 1 0x100 (No Enable)
    Event:   PWM0->EVENTS_SEQSTARTED[0]     0x4001C108 = 1 0x108 Enable 0x500=0x1
    Event:   PWM0->EVENTS_SEQEND[0]         0x4001C110 = 1 0x110 Enable 0x500=0x1
    Event:   PWM0->EVENTS_PWMPERIODEND      0x4001C118 = 1 0x118 Enable 0x500=0x1
    Event:   PWM1->EVENTS_STOPPED           0x40021104 = 1 0x104 Enable 0x500=0x1
    Event:   PWM1->EVENTS_SEQSTARTED[0]     0x40021108 = 1 0x108 Enable 0x500=0x1
    Event:   PWM1->EVENTS_SEQEND[0]         0x40021110 = 1 0x110 Enable 0x500=0x1
    Event:   PWM1->EVENTS_PWMPERIODEND      0x40021118 = 1 0x118 Enable 0x500=0x1
    Event:   PWM2->EVENTS_SEQSTARTED[0]     0x40022108 = 1 0x108 Enable 0x500=0x1
    Event:   PWM2->EVENTS_SEQEND[0]         0x40022110 = 1 0x110 Enable 0x500=0x1
    Event:   PWM2->EVENTS_PWMPERIODEND      0x40022118 = 1 0x118 Enable 0x500=0x1
    Event:   PWM3->EVENTS_SEQSTARTED[0]     0x4002D108 = 1 0x108 Enable 0x500=0x1
    Event:   PWM3->EVENTS_SEQEND[0]         0x4002D110 = 1 0x110 Enable 0x500=0x1
    Event:   PWM3->EVENTS_PWMPERIODEND      0x4002D118 = 1 0x118 Enable 0x500=0x1
    Event: UARTE0->EVENTS_CTS               0x40002100 = 1 0x100 Enable 0x500=0x0
    Event: UARTE0->EVENTS_TXDRDY            0x4000211C = 1 0x11C Enable 0x500=0x0

    That list was on nRF52833; another taken on nRF52832:

    Event:  CLOCK->EVENTS_HFCLKSTARTED      0x40000100 = 1 0x100 (No Enable)
    Event:  CLOCK->EVENTS_LFCLKSTARTED      0x40000104 = 1 0x104 (No Enable)
    Event:  POWER->EVENTS_SLEEPENTER        0x40000114 = 1 0x114 (No Enable)
    Event:   PWM1->EVENTS_STOPPED           0x40021104 = 1 0x104 Enable 0x500=0x1
    Event:  UARTE->EVENTS_CTS               0x40002100 = 1 0x100 Enable 0x500=0x0
    Event:  UARTE->EVENTS_TXDRDY            0x4000211C = 1 0x11C Enable 0x500=0x0

  • Lennart Andersson said:
    Is there any way to see what is running/activated  so I can check if something is activated that I don't want to have?

    Not automatically no, so you may need to check various registers. I guess first suggestion would be simply check the ENABLE register for the various peripherals, and if enabled you may need to do more digging, as mentioned I suspect UART and/or HFCLK is enabled here. Could be TIMER running also (since that will keep HFCLK running).

    Kenneth

Related