2014-08-25 01:55 AM
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 #stlink2014-08-29 05:23 AM
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.