Cut and paste this URL to share the unmodified register and value:
https://regviz.com/r/stm32/stm32g0/STM32G051/TIM2/CNT_ALTERNATE5#0x0
counter
Most significant part counter value (TIM2) nullLeast significant part of counter value
UIF Copy This bit is a read-only copy of the UIF bit of the TIMx_ISR register
https://github.com/modm-io/cmsis-svd-stm32