STM32 gotchas
292. In Up-Down (Center-Aligned) mode, Update event occurs sooner than in plain Up or Down mode

The STM32 Timer, in the default up-counting mode, generates an Update event upon overflow, i.e. when the counter rolls over from ARR to 0. More precisely, the Update event occurs during the first input clock period of the state when TIMx_CNT = 0.

Similarly, when set as down-counter, the Update event occurs at underflow, i.e. when counter rolls over from 0 to ARR. Again, the Update occurs during the first input clock period of the state when TIMx_CNT = ARR.

However, in the up-down (center-aligned) mode, while Update occurs both at overflow and underflow, the exact moments when the Update event occurs in relationship to the counter's content is different: the overflow Update (i.e. the Update at the end of up-counting half-period) occurs during the first clock period of the state when TIMx_CNT = ARR, i.e. one prescaled-clock cycle before the actual overflow from ARR to 0; and the underflow Update (i.e. the Update at the end of down-counting half-period) occurs when TIMx_CNT = 0, again, one prescaled-clock cycle before the actual underflow from 0 to ARR.

While most of the applications don't use explicitly the TIMx_CNT value, so this detail is not important, there are applications, where this difference may cause a surprise.