Skip to main content
Graduate II
April 8, 2024
Solved

Power Consumption Measurement

  • April 8, 2024
  • 3 replies
  • 6288 views

Hello everyone,

I need to get some information about the power consumption of the STM32 Nucleo-64 with STM32F401RE MCU.
The board is powered from the computer's USB port.

The board has a IDD jumper (JP6) for MCU current measurement so I attached a Parkside multimeter to get the current.

I created a project in which the main while loop is empty and all peripherals are disabled. In this case, the current shown on the display of the multimeter is fixed.

If I modify the project and I use the timer interrupts to acquire data from the sensors, the current shown is fixed. 

If I create another project without interrupts but acquiring data from the sensors in the main while loop, the current shown is fixed. If I add some "printf" (using USART2 and PuTTY) to show these data, the current is variable. 

If I create a project in which I execute some inferences of a neural network, the current is variable.
Why do I have a fixed value of the current on the display in some cases and a variable value in other cases?

 

Could anyone please help me?

    This topic has been closed for replies.
    Best answer by Andrew Neil

    the trouble with a multimeter is you have no control over when it samples, or how it "averages" - so you will get this fluctuating reading.

    An actual mechanical meter would probably be better for an "average" reading...

    3 replies

    Super User
    April 8, 2024

    @thetectivestm wrote:

     a Parkside multimeter


    You mean something like this:

    AndrewNeil_0-1712597687475.jpeg

     

    You won't get a meaningful measurement of dynamic current consumption with a multimeter (any multimeter) - you will need something like the X-NUCLEO-LPM01A or STLINK-V3PWR (and associated software) to get a meaningful view of the current with time

    https://www.st.com/en/evaluation-tools/x-nucleo-lpm01a.html

    https://www.st.com/en/development-tools/stlink-v3pwr.html

     

    Graduate II
    April 8, 2024

    Hi @Andrew Neil .

    I just want an average value of the current consumption, not necessarily the instantaneous value.

    Super User
    April 8, 2024

    the trouble with a multimeter is you have no control over when it samples, or how it "averages" - so you will get this fluctuating reading.

    An actual mechanical meter would probably be better for an "average" reading...

    Super User
    April 8, 2024

    Hi,

    as long as you let the cpu (more or less) doing some program (loops or whatever) at a constant clock, 

    it will draw about constant current for this.

    But if you use some ports (uart or LED etc. ...other) with lines, that need some current to drive, you see this added current - or not if not driving an output.

    You can check this a bit in Cube , with the "tools" , to see some average, if using peripherals, or not :

    AScha3_0-1712598774767.png

    What you "pull" extra current out of some pins you switch, you have to add yourself.

    Graduate II
    April 8, 2024

    Hi @AScha.3 .

    If I create a project without interrupts but acquiring data from the sensors in the main while loop, the current shown is fixed at 1.91 mA. If I add some "printf" (using USART2 and PuTTY) to show these data, the current shown on the display of the multimeter is variable up to 1.71 mA. Shouldn't it have a higher value?
    Moreover, when I execute the inference of the NN, I don't use LEDs or any peripherals (adc, timers, etc.). I just use a default input tensor and run the inference with the "ai_mynetwork_run" function. 

    ---

    About the PCC (Power Consumption Calculator), it's not useful for me because I use a HCLK frequency of 4 MHz (from SYSCLK of 16 MHz with HSI source mux) and in the step parameters of the tool you must use a minimum frequency of 30 MHz. Moreover, all the run-mode current consumption measurements given in that tool are performed with a reduced code that gives a consumption equivalent to CoreMark code; that values are higher than the values shown on the multimeter.

    Super User
    April 8, 2024

    At so clock and low power, you will see "everything" - e.g the uart line needs 0.2mA when idle and 0 when active...

    And, as Andrew mentioned, a DMM is not showing real time values, but just some "average" at 1/3 sec timing or so.

    And whats so important, the cpu needs 1.9 or 1.7 mA ? If you want really low power and set it to sleep mode, then consuming 1 mA instead of 12 uA would be something to think about - but just 20% deviation --- come on.

    Super User
    April 10, 2024

    Another good way to save power is to choose sensors which can acquire data autonomously, and buffer it.

    Thus the processor doesn't have to wake up for every single measurement - it only has to read out a "burst" of data from the buffer when it needs it (once every 2s, in your case).