STM32F103CB Timer update interrupt not working
I figured it out.

NVIC-&gt;ISER[0] |= TIM2_IRQn;


should be 

NVIC-&gt;ISER[0] = 1UL &lt;&lt; TIM2_IRQn;


because to enable the interrupt you want to set bit 28, not write 28 as bit value to the register. Now it works as expected.