STM32 gotchas
235.Some LPTIM control bits/registers can be written only after LPTIM is enabled - including software-start

Some LPTIM registers (LPTIM_ARR, LPTIM_CMP) and control bits (LPTIM_CR.CNTSTRT, LPTIM_CR.SNGSTRT) must be modified only when LPTIM is enabled (LPTIM_CR.ENABLE=1). In contrast to that, LPTIM_CFGR must be modified only if LPTIM is disabled.

The LPTIM chapter of RM in its Timer enable subchapter says: After setting the ENABLE bit, a delay of two counter clock is needed before the LPTIM is actually enabled.

This would indicate, that after setting LPTIM_CR.ENABLE=1 it is necessary to wait two LPTIM kernel clocks, until e.g. LPTIM_ARR can be successfully written. This is a strange requirement, as there is no direct way to check, whether the two LPTIM clocks have been already elapsed.

Nonetheless, from experiments it appears, that there is no need for such wait, as two consecutive writes - one to LPTIM_CR to set ENABLE, and the other to LPTIM_ARR - do succeed, even if the LPTIM kernel clock (e.g. LSE or LSI) is significantly slower than the APB clock.

The only observed limitation is, that if CNTRST bit is set together with ENABLE within one write to LPTIM_CR, the counter won't start; it is necessary to set ENABLE first, and then CNTRST in a subsequent step.