Problem with interrupt-based timer on STM32F411
Looks like the UIE bit in TIM2-&gt;DIER is not enabled. There must be some HAL function to do it, I don't know. I would not recommend using HAL for timing stuff anyway, there are issues with its accuracy.

Starting a timer is just a few lines of code.

void InitializeTimer(void) {
    __TIM2_CLK_ENABLE();
    TIM2-&gt;PSC = 160;             /* Set prescaler value */
    TIM2-&gt;EGR = TIM_EGR_UG;      /* Update prescaler */
    TIM2-&gt;ARR = 100;             /* Set timer period */
    TIM2-&gt;DIER = TIM_DIER_UIE;   /* Enable interrupt generation on timer overflow */
    TIM2-&gt;CR1 = TIM_CR1_CEN;     /* Start counting */
}

void TIM2_IRQHandler()
{
    /* Clear interrupt flag first. It cannot be the last instruction in an interrupt handler. */
    TIM2-&gt;SR = 0;
    LD2_GPIO_Port-&gt;ODR ^= LD2_Pin;
}