cancel
Showing results for 
Search instead for 
Did you mean: 

STM32l1 and current consumption after STLink connected

adam23
Associate II
Posted on August 25, 2014 at 10:55

I am using STM32L100 MCU with STLink v2 for debug and flash/eeprom programming thru SWD. This is a device with soldered battery - i.e. it is permanently supplied. If I want to reprogram e.g. EEPROM I connect STLink and with STLink utility reprogram the Eeprom with ''connect under reset'' setting. However from that time on, the device is consuming ~240uA even thou the STLink is disconnected. The only way to avoid it is to disconnect and reconnect the battery.

It looks like some programming/debug logic is activated by STLink, but is not shut down when external nRST is pulled. How should one avoid this? Is there any code to execute at devices restart to disable this logic consumption. I do only ''disable'' the SWD pins byt switching them to GPIO atm.

#stm32l1 #stlink
1 REPLY 1
adam23
Associate II
Posted on August 29, 2014 at 14:23

This is due to DBGMCU beeing active. Disable it by:

  DBGMCU->CR = 0;

  DBGMCU->APB1FZ = 0;

  DBGMCU->APB2FZ = 0;

i.e. Enable debug low power modes in STlink should not be checked, but may not help under some STlink utility version or something. This in the code makes sure, it is disabled.