2 years, 6 months ago.

What's causing this power spike?

Hi there,

I'm using an STM32L073RZ on a bare board with just the CPU and necessary power electronics. I'm powering the board straight from an Otii Arc and measuring current consumption. When I call the sleep() function the CPU goes into a low power mode, with an occasional 5mA spike in current consumption approximately every second, see the image below:


What is the cause of this? I'm attempting to place the CPU into STOP mode with an RTC running - this should draw, according to the datasheet, 1µA current.

Further to this, how can I tell which low power mode the sleep() function has chosen?

Thanks, Adam

I believe its one of the rtos/thead tickers. If you can find away to turn these functions off it may stop. I use OS2 and do not have the problem.

posted by Paul Staron 15 Mar 2019

1 Answer

2 years, 6 months ago.

Hi Adam,

This looks very similar to an issue recently reported on GitHub (although for a different ST device):

Could you try using the work-around mentioned by ST? For this target it appears that the default configuration uses the RTC for wakeup so you will also need to set the lpticker_lptim value to 1. Here is a snippet of that port of the targets.json file:

            "lpticker_lptim": {
                "help": "This target supports LPTIM. Set value 1 to use LPTIM for LPTICKER, or 0 to use RTC wakeup timer",
                "value": 0


Ralph, Team Mbed