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

  • After powering the dongle over the VDD OUT pin instead of VBUS the power draw did drop to ~2.5 uA using the wait for event loop right after the board starts Slight smile

    For some reason I only observe a drop to around 15 uA during idle using the "full" firmware. I will have to investigate a bit further to see what part of the code is the main reason for this.

  • I figured out what the issue was with the "full" firmware:

    The after triggering the start task of the radio in tx mode my code waited for the END task instead of the PHYEND task. I guess the PHYEND task is triggered slightly later than the END task and the following code failed to correctly turn off some of the peripherals.

    Waiting for the PHYEND task instead gives a rough power draw of 3uA at ~3.3V Slight smile

Related