2013-02-05 11:46 AM
I cannot get stop mode current below 1.1 mA in the IAR STM32L152VB eval board. This is the code to prep and then go to stop mode:
lowPowerConfigGPIO(); (this configures all GPIO pins as ADC inputs)
PWR_FastWakeUpCmd(DISABLE);PWR_PVDCmd(DISABLE);PWR_UltraLowPowerCmd(ENABLE);RCC->AHBENR = 0;RCC->AHBLPENR = 0; RCC->APB1ENR = RCC_APB1ENR_PWREN;RCC->APB2ENR = 0;SysTick->CTRL = 0;PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI);while(1){ __no_operation();}The code is based on the STM32L Discovery firmware in STM32L_Discovery_Firmware_Pack_V1.0.2Stop mode on the STM32L Discovery board is about 47 uA. But on the IAR board it does not go below 1.1 mA.Any help seeing what I am doing wrong is much appreciated!Terry2013-02-05 01:01 PM
It could be whatever else is powered, are you looking at a board level current, or chip level current?
Also I'd sleep in a loop lest it leave via interrupt or whatever.while(1)
{
PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI);
}
A WFI in a loop would be preferable to a NOP
2013-02-05 05:11 PM
I am sure the measurement I am doing is processor current, not board current. The IAR board is set up to make it easy to measure processor current. You just remove a 2-pin jumper and read the current across the pins. There is another location to measure board current.
Thanks for the idea about the WFI loop. I will give it a shot.Terry2013-02-06 08:52 AM
Turns out it is my fault. Having the J-Link loader/debugger connected to the board makes the micro consume right around 1 mA. Not sure why this happens. But when the J-Link is disconnected, processor current drops to under 100 uA. That can be improved, but the big issue was the J-Link.
Thanks for the help.