Basic timer that doesn't work STM32L4
HAL_TIM_PeriodElapsedCallback() is never called because there is no code to call it. It is supposed to be called from TIM2_IRQHandler().

Here is a basic timer setup with interrupts every minute, assuming the APB1 clock is 80 MHz.

volatile int start_processing;
void TIM2_IRQHandler(void) {
    if(TIM2-&gt;SR &amp; TIM_SR_UIF) {    // check status
        start_processing = 1;
        TIM2-&gt;SR &amp;= ~TIM_SR_UIF;   // clear status
    }
}

void InitializeTimer(void) {
    RCC-&gt;APB1ENR1 |= RCC_APB1ENR1_TIM2EN;
    RCC-&gt;APB1ENR1;
    TIM2-&gt;PSC = 9999;           // 80 MHz clock is prescaled to 8 kHz
    TIM2-&gt;EGR = TIM_EGR_UG;     // required to take over the ARR value
    TIM2-&gt;ARR = 479999;         // 8000 * 60 - 1
    TIM2-&gt;DIER = TIM_DIER_UIE;  // enable update (timer overflow) interrupt
    TIM2-&gt;CR1 = TIM_CR1_CEN;    // start timer
    NVIC_SetPriority(TIM2_IRQn, 0);
    NVIC_EnableIRQ(TIM2_IRQn);
}