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?

Parents
  • 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.

Reply
  • 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.

Children
Related