Hi, I am using the below function to enter low power mode in STM32L152, but yet the current consumption of MCU is about 4 mA. is there other configurations?
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR,ENABLE); PWR_EnterLowPowerRunMode(ENABLE);
What current are you measuring where?
On the L1-DISCO board you should be most interested in the JP1 jumper, at that point you've partitioned the chip from the ST-LINK and other circuitry. Measuring the current drawn on the 5V rail on the backside of the regulator is probably not going to provide useful numbers.
You should probably more selective in your GPIO configuration so as not to break the debugger connection. Although having the debugger attached is going to skew the results.
As noted, the low power current should not be measured with any JTAG interface connected.
Next thing is that it's important to select a proper voltage regulator. A normal voltage regulator can have quite high idle current because it's designed to have good load regulation, i.e. very little output voltage variation if you draw 1mA or if you draw 1000mA. A voltage regulator for low-energy battery operation need not have as good load regulation - but must instead have a very, very low idle current so you don't get the majority of the power consumption in the regulator itself.