2022-11-14 03:28 AM
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
Solved! Go to Solution.
2022-11-17 05:28 AM
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!
2022-11-17 05:28 AM
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!