STM32F4 get timer to work >2MHz
The ISR assembly list (below). Counted instructions execution time based on arm M4 instruction set and found about (37) cycles. Note that it is just toggling a pin.
With 84MHz, (37) instructions * 12ns = 444ns.
And it is true, you can not achieve &gt;2MHz (or worse) timer rate. I think the idea of using timer with higher rate is to use it with other services such as DMA.
70          if(__HAL_TIM_GET_FLAG(&amp;hTimSlice, TIM_FLAG_UPDATE) != RESET) {
      TIM4_IRQHandler:
08000f80:   ldr     r3, [pc, #40]   ; (0x8000fac &lt;TIM4_IRQHandler+44&gt;)
08000f82:   ldr     r3, [r3, #0]
08000f84:   ldr     r2, [r3, #16]
08000f86:   lsls    r0, r2, #31
08000f88:   bpl.n   0x8000f96 &lt;TIM4_IRQHandler+22&gt;
71              if(__HAL_TIM_GET_IT_SOURCE(&amp;hTimSlice, TIM_IT_UPDATE) !=RESET) {
08000f8a:   ldr     r2, [r3, #12]
08000f8c:   lsls    r1, r2, #31
72                  __HAL_TIM_CLEAR_IT(&amp;hTimSlice, TIM_IT_UPDATE);
08000f8e:   itt     mi
08000f90:   mvnmi.w r2, #1
08000f94:   strmi   r2, [r3, #16]
75          DBG_TOGL(GPIO_PIN_8);
08000f96:   ldr     r3, [pc, #24]   ; (0x8000fb0 &lt;TIM4_IRQHandler+48&gt;)
08000f98:   ldr     r2, [r3, #20]
08000f9a:   lsls    r2, r2, #23
08000f9c:   ite     mi
08000f9e:   movmi.w r2, #16777216   ; 0x1000000
08000fa2:   movpl.w r2, #256        ; 0x100
08000fa6:   str     r2, [r3, #24]
76        }
08000fa8:   bx      lr
08000faa:   nop     
08000fac:   lsls    r4, r3, #17
08000fae:   movs    r0, #0
08000fb0:   lsrs    r0, r0, #32
08000fb2:   ands    r2, r0