2018-02-04 08:15 PM
I am using STM32L031 by power of battery, so I wish to save power consumption.
Now the current consumption is about 200uA at stop mode.
May I change SWDIO and SWCLK to analogue GPIO after initialization?
May I further save power consumption by this way?
If OK, could you give some sample code to change
SWDIO and SWCLK to analogue GPIO?
Thanks.
Solved! Go to Solution.
2018-02-04 11:48 PM
Hello Jianxuan He,
Analog input is a recomended mode for all GPIOs, which are not used in the application. This solution reduces the current consumption of MCU.
I confirm, that you can change confuguration of the SWDIO and SWCLK pins to analog inputs. During the reset state of MCU these pins will be automatically reconfigured back to their original functions in order to act as a debug interface.
In addition I would recomend to switch off all clocks for GPIOs before entering STOP mode. This can also reduce the current consumption a little bit.
Regards
Szymon
2018-02-04 11:48 PM
Hello Jianxuan He,
Analog input is a recomended mode for all GPIOs, which are not used in the application. This solution reduces the current consumption of MCU.
I confirm, that you can change confuguration of the SWDIO and SWCLK pins to analog inputs. During the reset state of MCU these pins will be automatically reconfigured back to their original functions in order to act as a debug interface.
In addition I would recomend to switch off all clocks for GPIOs before entering STOP mode. This can also reduce the current consumption a little bit.
Regards
Szymon
2018-02-05 12:56 AM
Dear
Szymon,
Thanks for your timely support!
I would try to further save power consumption.
Thanks!