Problem while enabling TIM2 in STM32G041J6M6
Hello,
I am using the TIM2 with the STM32G041J6M6 and I am finding problems while enabling TIM2 using registers
With some code I have initiated the timer as reported below (TIM2 clock is enabled)
While debugging I can edit some timer registers (ARR,PSC,CCR,SMCR...) directly in the SFRs tab of STM32IDE but not the CR1 and CR2 registers.
If I put this line in my code
TIM2-> CR1|= (1<<0);
At the end the TIM2 is not enabled and a mess appears on the corresponding output pin,the GPIOA MODER and RCC IOPAEN are affected and cannot be modified on-the-fly in the SFRs tab anymore.
All this behaviour sounds weird to me....
Any idea why this can happen?
Regards
