cancel
Showing results for 
Search instead for 
Did you mean: 

LPTIM1 in stop mode 2

AColl.7
Associate II

 Hi everyone,

i'm trying to use the LPTIM1 in the STM32WB55 on STOP2 mode.

I have a STM32WB5MM-DK and I want to generate a PWM on the pc1 output.

I configured on the ioc file:

LPTIM1

- counts internal clock event

- checked waveform generation

-parameter:

prescaler div1

update immediate

trigger software

output polarity high

CLOCK CONFIGURATION

LPTIM1 clock mux on LSE (I tried the LSI with same result)

CODE

 DBG_PRINTF( "*________START PWM______\n\r" );

 if (HAL_LPTIM_PWM_Start(&hlptim1, PeriodValue, PulseValue) != HAL_OK)

 {

  Error_Handler();

 }

 DBG_PRINTF( "*________START DELAY______\n\r" );

 HAL_Delay(20000);

 /* ### Enter in Stop mode ########################################### */

 DBG_PRINTF( "*________START LP______\n\r" );

 HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);

 DBG_PRINTF( "*________EXIT LP______\n\r" );

So, start the pwm at the right frequency

then wait for 20s

but when the system enter in stop mode, I no longer have the PWM.

Can you help me?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
AColl.7
Associate II

Seem it works now!

To do the tests, I compiled the code, than program the board on the stmcubeprogrammer and restart the board pressing the reset.

Now I disconnect the board from the USB and reconnetted it and it works!

View solution in original post

1 REPLY 1
AColl.7
Associate II

Seem it works now!

To do the tests, I compiled the code, than program the board on the stmcubeprogrammer and restart the board pressing the reset.

Now I disconnect the board from the USB and reconnetted it and it works!