Skip to main content
AColl.7
Associate
November 14, 2022
Solved

LPTIM1 in stop mode 2

 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

This topic has been closed for replies.
AColl.7
AColl.7Best answer
Associate
November 17, 2022

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!

1 reply

AColl.7
AColl.7AuthorBest answer
Associate
November 17, 2022

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!