cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L100 LP Mode issue

matteo239955
Associate III
Posted on April 23, 2014 at 11:17

Hi all,

I am trying to use low power modes on STM32L100 MCU.

I've implemented a simple firmware that after setting the MCU to run @32MHz (HSI+PLL using the Clock Configuration Utility excel) waits an EXTI (key pressure) to set the MCU in low power mode, then waits another EXTI key pressure to return to the RUN mode.

I've tryed to implement STOP mode and it works correctly.

I'm now trying to implement LP sleep but, after entering the LP mode (I'm checking the current consumption on PSU to be sure that the LP mode is activated), I am not able to detect the next EXTI pressure then the MCU does not exit from the LPsleep mode.

I'm following the code example of the demostration firmware of STM32L152D-EVAL board.

The configuration of the EXTI pin and line is the same for Stop and LPSleep mode, then I think it is correct... so I think that the issue should be related to the clock but I'm not able to find it... is there any particular configuration to set to use EXTI under LPsleep mode?

Attached are 3 files containing the related code that I'm using.

Thanks you all

#stm32l100-low-power-sleep
2 REPLIES 2
matteo239955
Associate III
Posted on April 23, 2014 at 14:57

I've observed a strange behavior:

if I try to debug my application and puts a breakpoint on the __WFI instruction, everithing seems to work.

If the breakpoint is removed, the execution remains bloked on the WFI instruction ignoring the received interrupt... and sometime the debug is stopped.

Any ideas?

chen
Associate II
Posted on April 23, 2014 at 15:13

Hi

''if I try to debug my application and puts a breakpoint on the __WFI instruction, everithing seems to work.''

Yes, that is because when you debug - the processor is not actually going into Sleep mode - it only simulates it (only sets the status bit but the processor stays active - Sleep mode the processor clock is suppose to be stopped but in order to debug the processor must be clocked)