Nrf52840 custom firmware high idle power consumption

Hello everyone,

I'm currently developing a custom firmware for the Nrf52840 usb dongle (https://www.mouser.de/new/nordic-semiconductor/nordic-nrf52840-usb-dongle).
The custom firmware is written completely from scratch in Rust, if needed I can provide all the code.

I am currently trying to optimize the power consumption when the board should be idle.
Information regarding the setup:

  • The board is powered using the vbus and ground connectors using a 5V power source (battery based)
  • I am measuring the current using a Multimeter, according to my tests (using the 5V power source and some high resistance resistors) it is sufficiently precise
  • Except GND and VBUS no other pin is connected to the nrf52840 usb dongle.

When I started measuring the idle (power on, full ram powered, rtc running on lfclk, dcdc enabled) power consumption I was surprised to see about 25 uA, which is not terrible, but according to the documentation something in the range of 2 - 3 uA should be possible.

To rule out enabling any peripherals by accident I went ahead and placed the following code at the start of the firmware (rust, but I'm sure everyone here will understand it):

    loop {
        unsafe {
            core::arch::asm! {
                "wfe"
            }
        };
    }

With this my understanding is, that:

  • Immediatly after reset the cpu will enter idle mode
  • No peripherals are ever accessed
  • If I didn't miss anything in the documentation no peripheral should by default be enabled

Sadly the high power consumption of about 25 uA still remains.

Is there anything I actively have to disable to achieve a lower power consumption?

Any help is much appreciated Slight smile

Edit:
I also found this post (https://devzone.nordicsemi.com/f/nordic-q-a/1657/how-to-minimize-current-consumption-for-ble-application-on-nrf51822#reply-5187), but I don't think any of the troubleshooting steps apply in my scenario?

  • Given the following answer (https://devzone.nordicsemi.com/f/nordic-q-a/26030/how-to-reach-nrf52840-uarte-current-supply-specification/102605#102605) I assume that there are some registers that are not documented in the documentation.
    At least the register modified in the answer is not part of the uarte documentation.
    I assume that the address is a POWER register, similar to the (documented) one of the radio peripheral?

    I tried setting the (not documented) register to zero, without success.
    I also tried extrapolating from this answer: maybe some other peripherals have undocumented POWER registers I need to disable?
    According to this idea I wrote 0 to each <peripheral_base + 0xFFC> (except for GPIO P1, which seems to trigger an interrupt).

    This also did not help.

  • Hi,

    The workaround in the post you linked to is not relevant here. Some drivers include it, and this is for not keeping the HW clock active when not needed. If that was the case, you would see a current consumption of several hundred micro amps. As you are seeing only 25 uA, the issue is something else. Just based on this number I wonder if you have a GPIOTE input enabled? That would match this level.

  • Correct me if I'm wrong, but shouldn't the GPIOTE input be disabled by default after a complete power cycle (physically removing all connections to the dongle)?

    In any case, which registers exactly do I have to overwrite to disable all GPIOTE inputs? Would writing zeros to all the GPIOTE->CONFIG[n] registers be sufficient?

  • raidwas said:
    Correct me if I'm wrong, but shouldn't the GPIOTE input be disabled by default after a complete power cycle (physically removing all connections to the dongle)?

    Yes, that is correct. If you do not configure a GPIOTE input that is not the issue.

    raidwas said:
    In any case, which registers exactly do I have to overwrite to disable all GPIOTE inputs? Would writing zeros to all the GPIOTE->CONFIG[n] registers be sufficient?

    That would do it, yes. But 0 is also the reset value, so if you never enable any GPIOTE input, that is not it.

    If the main loop you shows in the snippet in the original post is the only thing that runs (nothing before it other than the startup code), then you need to look elsewhere for an explanation of the current consumption. How are you supplying the dongle, and how are you measuring the current consumption? This thread may be relevant in that regard.

  • I am currently powering the board similar to the post you reference (VBUS). I will try powering it over VDD OUT after cutting and soldering the corresponding pads.

    As for my power setup:

    I am currently using a 5.5V1F condensator charged to 5V.

    The current consumption is measure using a multimeter that should be sufficiently precise (tested with some batteries and various resistors).

Related