Index: hal_st_lld.c
===================================================================
--- hal_st_lld.c	(revision 14054)
+++ hal_st_lld.c	(working copy)
@@ -282,6 +282,82 @@
 #define ST_ENABLE_STOP()                    DBGMCU->APB1FZ |= DBGMCU_APB1_FZ_DBG_TIM14_STOP
 #endif
 
+#elif STM32_ST_USE_TIMER == 15
+
+#if !STM32_HAS_TIM15
+#error "TIM15 not present in the selected device"
+#endif
+
+#if (OSAL_ST_RESOLUTION == 32) && !STM32_TIM15_IS_32BITS
+#error "TIM15 is not a 32bits timer"
+#endif
+
+#define ST_HANDLER                          STM32_TIM15_HANDLER
+#define ST_NUMBER                           STM32_TIM15_NUMBER
+#define ST_CLOCK_SRC                        STM32_TIMCLK2
+#define ST_ENABLE_CLOCK()                   rccEnableTIM15(true)
+#if defined(STM32F1XX)
+#define ST_ENABLE_STOP()                    DBGMCU->CR |= DBGMCU_CR_DBG_TIM15_STOP
+#elif defined(STM32L4XX) || defined(STM32L4XXP) || defined(STM32G4XX)
+#define ST_ENABLE_STOP()                    DBGMCU->APB2FZ |= DBGMCU_APB2FZ_DBG_TIM15_STOP
+#elif defined(STM32H7XX)
+#define ST_ENABLE_STOP()                    DBGMCU->APB2FZ1 |= DBGMCU_APB2FZ1_DBG_TIM15
+#else
+#define ST_ENABLE_STOP()                    DBGMCU->APB2FZ |= DBGMCU_APB2_FZ_DBG_TIM15_STOP
+#endif
+
+#elif STM32_ST_USE_TIMER == 16
+
+#if !STM32_HAS_TIM16
+#error "TIM16 not present in the selected device"
+#endif
+
+#if (OSAL_ST_RESOLUTION == 32) && !STM32_TIM16_IS_32BITS
+#error "TIM16 is not a 32bits timer"
+#endif
+
+#define ST_HANDLER                          STM32_TIM16_HANDLER
+#define ST_NUMBER                           STM32_TIM16_NUMBER
+#define ST_CLOCK_SRC                        STM32_TIMCLK2
+#define ST_ENABLE_CLOCK()                   rccEnableTIM16(true)
+#if defined(STM32F1XX)
+#define ST_ENABLE_STOP()                    DBGMCU->CR |= DBGMCU_CR_DBG_TIM16_STOP
+#elif defined(STM32L4XX) || defined(STM32L4XXP) || defined(STM32G4XX)
+#define ST_ENABLE_STOP()                    DBGMCU->APB2FZ |= DBGMCU_APB2FZ_DBG_TIM16_STOP
+#elif defined(STM32WBXX)
+#define ST_ENABLE_STOP()                    DBGMCU->APB2FZR |= DBGMCU_APB2FZR_DBG_TIM16_STOP
+#elif defined(STM32H7XX)
+#define ST_ENABLE_STOP()                    DBGMCU->APB2FZ1 |= DBGMCU_APB2FZ1_DBG_TIM16
+#else
+#define ST_ENABLE_STOP()                    DBGMCU->APB2FZ |= DBGMCU_APB2_FZ_DBG_TIM16_STOP
+#endif
+
+#elif STM32_ST_USE_TIMER == 17
+
+#if !STM32_HAS_TIM17
+#error "TIM17 not present in the selected device"
+#endif
+
+#if (OSAL_ST_RESOLUTION == 32) && !STM32_TIM17_IS_32BITS
+#error "TIM17 is not a 32bits timer"
+#endif
+
+#define ST_HANDLER                          STM32_TIM17_HANDLER
+#define ST_NUMBER                           STM32_TIM17_NUMBER
+#define ST_CLOCK_SRC                        STM32_TIMCLK2
+#define ST_ENABLE_CLOCK()                   rccEnableTIM17(true)
+#if defined(STM32F1XX)
+#define ST_ENABLE_STOP()                    DBGMCU->CR |= DBGMCU_CR_DBG_TIM17_STOP
+#elif defined(STM32L4XX) || defined(STM32L4XXP) || defined(STM32G4XX)
+#define ST_ENABLE_STOP()                    DBGMCU->APB2FZ |= DBGMCU_APB2FZ_DBG_TIM17_STOP
+#elif defined(STM32WBXX)
+#define ST_ENABLE_STOP()                    DBGMCU->APB2FZR |= DBGMCU_APB2FZR_DBG_TIM17_STOP
+#elif defined(STM32H7XX)
+#define ST_ENABLE_STOP()                    DBGMCU->APB2FZ1 |= DBGMCU_APB2FZ1_DBG_TIM17
+#else
+#define ST_ENABLE_STOP()                    DBGMCU->APB2FZ |= DBGMCU_APB2_FZ_DBG_TIM17_STOP
+#endif
+
 #elif STM32_ST_USE_TIMER == 21
 
 #if !STM32_HAS_TIM21
@@ -465,7 +541,7 @@
 #if OSAL_ST_MODE == OSAL_ST_MODE_FREERUNNING
 #if ST_LLD_NUM_ALARMS > 1
   if ((sr & TIM_SR_CC2IF) != 0U) {
-    if (st_callbacks[2] != NULL) {
+    if (st_callbacks[0] != NULL) {
       st_callbacks[0](1U);
     }
   }
@@ -472,7 +548,7 @@
 #endif
 #if ST_LLD_NUM_ALARMS > 2
   if ((sr & TIM_SR_CC3IF) != 0U) {
-    if (st_callbacks[2] != NULL) {
+    if (st_callbacks[1] != NULL) {
       st_callbacks[1](2U);
     }
   }
Index: hal_st_lld.h
===================================================================
--- hal_st_lld.h	(revision 14054)
+++ hal_st_lld.h	(working copy)
@@ -31,9 +31,6 @@
 /* Driver constants.                                                         */
 /*===========================================================================*/
 
-/* Feature currently disabled.*/
-#define STM32_ST_ENFORCE_ALARMS 1
-
 /*===========================================================================*/
 /* Driver pre-compile time settings.                                         */
 /*===========================================================================*/
@@ -53,11 +50,26 @@
  * @brief   TIMx unit (by number) to be used for free running operations.
  * @note    You must select a 32 bits timer if a 32 bits @p systick_t type
  *          is required.
- * @note    Timers 2, 3, 4, 5, 21 and 22 are supported.
+ * @note    Timers 2, 3, 4, 5, 9, 10, 11, 12, 13, 14, 15, 16, 17,
+ *          21 and 22 are supported.
  */
 #if !defined(STM32_ST_USE_TIMER) || defined(__DOXYGEN__)
 #define STM32_ST_USE_TIMER                  2
 #endif
+
+/**
+ * @brief   Overrides the number of supported alarms.
+ * @note    The default number of alarms is equal to the number of
+ *          comparators in the timer, overriding it to one makes
+ *          the driver a little faster and smaller. The kernel itself
+ *          only needs one alarm, additional features could need more.
+ * @note    Zero means do not override.
+ * @note    This setting is only meaningful in free running mode, in
+ *          tick mode there are no alarms.
+ */
+#if !defined(STM32_ST_OVERRIDE_ALARMS) || defined(__DOXYGEN__)
+#define STM32_ST_OVERRIDE_ALARMS            1
+#endif
 /** @} */
 
 /*===========================================================================*/
@@ -103,9 +115,21 @@
 #endif
 
 #if !defined(STM32_HAS_TIM14)
-#define STM32_HAS_TIM14                      FALSE
+#define STM32_HAS_TIM14                     FALSE
 #endif
 
+#if !defined(STM32_HAS_TIM15)
+#define STM32_HAS_TIM15                     FALSE
+#endif
+
+#if !defined(STM32_HAS_TIM16)
+#define STM32_HAS_TIM16                     FALSE
+#endif
+
+#if !defined(STM32_HAS_TIM17)
+#define STM32_HAS_TIM17                     FALSE
+#endif
+
 #if !defined(STM32_HAS_TIM21)
 #define STM32_HAS_TIM21                     FALSE
 #endif
@@ -142,6 +166,9 @@
 #define STM32_ST_USE_TIM12                  FALSE
 #define STM32_ST_USE_TIM13                  FALSE
 #define STM32_ST_USE_TIM14                  FALSE
+#define STM32_ST_USE_TIM15                  FALSE
+#define STM32_ST_USE_TIM16                  FALSE
+#define STM32_ST_USE_TIM17                  FALSE
 #define STM32_ST_USE_TIM21                  FALSE
 #define STM32_ST_USE_TIM22                  FALSE
 
@@ -170,6 +197,9 @@
 #define STM32_ST_USE_TIM12                  FALSE
 #define STM32_ST_USE_TIM13                  FALSE
 #define STM32_ST_USE_TIM14                  FALSE
+#define STM32_ST_USE_TIM15                  FALSE
+#define STM32_ST_USE_TIM16                  FALSE
+#define STM32_ST_USE_TIM17                  FALSE
 #define STM32_ST_USE_TIM21                  FALSE
 #define STM32_ST_USE_TIM22                  FALSE
 
@@ -198,6 +228,9 @@
 #define STM32_ST_USE_TIM12                  FALSE
 #define STM32_ST_USE_TIM13                  FALSE
 #define STM32_ST_USE_TIM14                  FALSE
+#define STM32_ST_USE_TIM15                  FALSE
+#define STM32_ST_USE_TIM16                  FALSE
+#define STM32_ST_USE_TIM17                  FALSE
 #define STM32_ST_USE_TIM21                  FALSE
 #define STM32_ST_USE_TIM22                  FALSE
 
@@ -226,6 +259,9 @@
 #define STM32_ST_USE_TIM12                  FALSE
 #define STM32_ST_USE_TIM13                  FALSE
 #define STM32_ST_USE_TIM14                  FALSE
+#define STM32_ST_USE_TIM15                  FALSE
+#define STM32_ST_USE_TIM16                  FALSE
+#define STM32_ST_USE_TIM17                  FALSE
 #define STM32_ST_USE_TIM21                  FALSE
 #define STM32_ST_USE_TIM22                  FALSE
 
@@ -254,6 +290,9 @@
 #define STM32_ST_USE_TIM12                  FALSE
 #define STM32_ST_USE_TIM13                  FALSE
 #define STM32_ST_USE_TIM14                  FALSE
+#define STM32_ST_USE_TIM15                  FALSE
+#define STM32_ST_USE_TIM16                  FALSE
+#define STM32_ST_USE_TIM17                  FALSE
 #define STM32_ST_USE_TIM21                  FALSE
 #define STM32_ST_USE_TIM22                  FALSE
 
@@ -282,6 +321,9 @@
 #define STM32_ST_USE_TIM12                  FALSE
 #define STM32_ST_USE_TIM13                  FALSE
 #define STM32_ST_USE_TIM14                  FALSE
+#define STM32_ST_USE_TIM15                  FALSE
+#define STM32_ST_USE_TIM16                  FALSE
+#define STM32_ST_USE_TIM17                  FALSE
 #define STM32_ST_USE_TIM21                  FALSE
 #define STM32_ST_USE_TIM22                  FALSE
 
@@ -310,6 +352,9 @@
 #define STM32_ST_USE_TIM12                  FALSE
 #define STM32_ST_USE_TIM13                  FALSE
 #define STM32_ST_USE_TIM14                  FALSE
+#define STM32_ST_USE_TIM15                  FALSE
+#define STM32_ST_USE_TIM16                  FALSE
+#define STM32_ST_USE_TIM17                  FALSE
 #define STM32_ST_USE_TIM21                  FALSE
 #define STM32_ST_USE_TIM22                  FALSE
 
@@ -338,6 +383,9 @@
 #define STM32_ST_USE_TIM12                  TRUE
 #define STM32_ST_USE_TIM13                  FALSE
 #define STM32_ST_USE_TIM14                  FALSE
+#define STM32_ST_USE_TIM15                  FALSE
+#define STM32_ST_USE_TIM16                  FALSE
+#define STM32_ST_USE_TIM17                  FALSE
 #define STM32_ST_USE_TIM21                  FALSE
 #define STM32_ST_USE_TIM22                  FALSE
 
@@ -366,6 +414,9 @@
 #define STM32_ST_USE_TIM12                  FALSE
 #define STM32_ST_USE_TIM13                  TRUE
 #define STM32_ST_USE_TIM14                  FALSE
+#define STM32_ST_USE_TIM15                  FALSE
+#define STM32_ST_USE_TIM16                  FALSE
+#define STM32_ST_USE_TIM17                  FALSE
 #define STM32_ST_USE_TIM21                  FALSE
 #define STM32_ST_USE_TIM22                  FALSE
 
@@ -394,9 +445,104 @@
 #define STM32_ST_USE_TIM12                  FALSE
 #define STM32_ST_USE_TIM13                  FALSE
 #define STM32_ST_USE_TIM14                  TRUE
+#define STM32_ST_USE_TIM15                  FALSE
+#define STM32_ST_USE_TIM16                  FALSE
+#define STM32_ST_USE_TIM17                  FALSE
 #define STM32_ST_USE_TIM21                  FALSE
 #define STM32_ST_USE_TIM22                  FALSE
 
+#elif STM32_ST_USE_TIMER == 15
+
+#if defined(STM32_TIM15_IS_USED)
+#error "ST requires TIM15 but the timer is already used"
+#else
+#define STM32_TIM15_IS_USED
+#endif
+
+#if defined(STM32_TIM15_SUPPRESS_ISR)
+#define STM32_SYSTICK_SUPPRESS_ISR
+#endif
+
+#define STM32_ST_TIM                        STM32_TIM15
+#define ST_LLD_NUM_ALARMS                   STM32_TIM15_CHANNELS
+#define STM32_ST_USE_SYSTICK                FALSE
+#define STM32_ST_USE_TIM2                   FALSE
+#define STM32_ST_USE_TIM3                   FALSE
+#define STM32_ST_USE_TIM4                   FALSE
+#define STM32_ST_USE_TIM5                   FALSE
+#define STM32_ST_USE_TIM9                   FALSE
+#define STM32_ST_USE_TIM10                  FALSE
+#define STM32_ST_USE_TIM11                  FALSE
+#define STM32_ST_USE_TIM12                  FALSE
+#define STM32_ST_USE_TIM13                  FALSE
+#define STM32_ST_USE_TIM14                  FALSE
+#define STM32_ST_USE_TIM15                  TRUE
+#define STM32_ST_USE_TIM16                  FALSE
+#define STM32_ST_USE_TIM17                  FALSE
+#define STM32_ST_USE_TIM21                  FALSE
+#define STM32_ST_USE_TIM22                  FALSE
+
+#elif STM32_ST_USE_TIMER == 16
+
+#if defined(STM32_TIM16_IS_USED)
+#error "ST requires TIM16 but the timer is already used"
+#else
+#define STM32_TIM16_IS_USED
+#endif
+
+#if defined(STM32_TIM16_SUPPRESS_ISR)
+#define STM32_SYSTICK_SUPPRESS_ISR
+#endif
+
+#define STM32_ST_TIM                        STM32_TIM16
+#define ST_LLD_NUM_ALARMS                   STM32_TIM16_CHANNELS
+#define STM32_ST_USE_SYSTICK                FALSE
+#define STM32_ST_USE_TIM2                   FALSE
+#define STM32_ST_USE_TIM3                   FALSE
+#define STM32_ST_USE_TIM4                   FALSE
+#define STM32_ST_USE_TIM5                   FALSE
+#define STM32_ST_USE_TIM9                   FALSE
+#define STM32_ST_USE_TIM10                  FALSE
+#define STM32_ST_USE_TIM11                  FALSE
+#define STM32_ST_USE_TIM12                  FALSE
+#define STM32_ST_USE_TIM13                  FALSE
+#define STM32_ST_USE_TIM14                  FALSE
+#define STM32_ST_USE_TIM15                  FALSE
+#define STM32_ST_USE_TIM16                  TRUE
+#define STM32_ST_USE_TIM17                  FALSE
+#define STM32_ST_USE_TIM21                  FALSE
+#define STM32_ST_USE_TIM22                  FALSE
+
+#elif STM32_ST_USE_TIMER == 17
+
+#if defined(STM32_TIM17_IS_USED)
+#error "ST requires TIM17 but the timer is already used"
+#else
+#define STM32_TIM17_IS_USED
+#endif
+
+#if defined(STM32_TIM17_SUPPRESS_ISR)
+#define STM32_SYSTICK_SUPPRESS_ISR
+#endif
+
+#define STM32_ST_TIM                        STM32_TIM17
+#define ST_LLD_NUM_ALARMS                   STM32_TIM17_CHANNELS
+#define STM32_ST_USE_SYSTICK                FALSE
+#define STM32_ST_USE_TIM2                   FALSE
+#define STM32_ST_USE_TIM3                   FALSE
+#define STM32_ST_USE_TIM4                   FALSE
+#define STM32_ST_USE_TIM5                   FALSE
+#define STM32_ST_USE_TIM9                   FALSE
+#define STM32_ST_USE_TIM10                  FALSE
+#define STM32_ST_USE_TIM11                  FALSE
+#define STM32_ST_USE_TIM12                  FALSE
+#define STM32_ST_USE_TIM13                  FALSE
+#define STM32_ST_USE_TIM14                  FALSE
+#define STM32_ST_USE_TIM15                  FALSE
+#define STM32_ST_USE_TIM16                  FALSE
+#define STM32_ST_USE_TIM17                  TRUE
+#define STM32_ST_USE_TIM21                  FALSE
+#define STM32_ST_USE_TIM22                  FALSE
 #elif STM32_ST_USE_TIMER == 21
 
 #if defined(STM32_TIM21_IS_USED)
@@ -422,6 +568,9 @@
 #define STM32_ST_USE_TIM12                  FALSE
 #define STM32_ST_USE_TIM13                  FALSE
 #define STM32_ST_USE_TIM14                  FALSE
+#define STM32_ST_USE_TIM15                  FALSE
+#define STM32_ST_USE_TIM16                  FALSE
+#define STM32_ST_USE_TIM17                  FALSE
 #define STM32_ST_USE_TIM21                  TRUE
 #define STM32_ST_USE_TIM22                  FALSE
 
@@ -450,6 +599,9 @@
 #define STM32_ST_USE_TIM12                  FALSE
 #define STM32_ST_USE_TIM13                  FALSE
 #define STM32_ST_USE_TIM14                  FALSE
+#define STM32_ST_USE_TIM15                  FALSE
+#define STM32_ST_USE_TIM16                  FALSE
+#define STM32_ST_USE_TIM17                  FALSE
 #define STM32_ST_USE_TIM21                  FALSE
 #define STM32_ST_USE_TIM22                  TRUE
 
@@ -457,17 +609,17 @@
 #error "STM32_ST_USE_TIMER specifies an unsupported timer"
 #endif
 
-#if defined(STM32_ST_ENFORCE_ALARMS)
-
-#if (STM32_ST_ENFORCE_ALARMS < 1) || (STM32_ST_ENFORCE_ALARMS > ST_LLD_NUM_ALARMS)
-#error "invalid STM32_ST_ENFORCE_ALARMS value"
+#if (STM32_ST_OVERRIDE_ALARMS < 0) ||                                       \
+    (STM32_ST_OVERRIDE_ALARMS > ST_LLD_NUM_ALARMS)
+#error "invalid STM32_ST_OVERRIDE_ALARMS value"
 #endif
 
+#if STM32_ST_OVERRIDE_ALARMS > 0
 #undef ST_LLD_NUM_ALARMS
-#define ST_LLD_NUM_ALARMS                   STM32_ST_ENFORCE_ALARMS
+#define ST_LLD_NUM_ALARMS                   STM32_ST_OVERRIDE_ALARMS
 #endif
 
-#elif OSAL_ST_MODE == OSAL_ST_MODE_PERIODIC
+#elif OSAL_ST_MODE == OSAL_ST_MODE_FREERUNNING
 
 #define STM32_ST_USE_SYSTICK                TRUE
 #define STM32_ST_USE_TIM2                   FALSE
@@ -480,6 +632,9 @@
 #define STM32_ST_USE_TIM12                  FALSE
 #define STM32_ST_USE_TIM13                  FALSE
 #define STM32_ST_USE_TIM14                  FALSE
+#define STM32_ST_USE_TIM15                  FALSE
+#define STM32_ST_USE_TIM16                  FALSE
+#define STM32_ST_USE_TIM17                  FALSE
 #define STM32_ST_USE_TIM21                  FALSE
 #define STM32_ST_USE_TIM22                  FALSE
 
@@ -496,6 +651,9 @@
 #define STM32_ST_USE_TIM12                  FALSE
 #define STM32_ST_USE_TIM13                  FALSE
 #define STM32_ST_USE_TIM14                  FALSE
+#define STM32_ST_USE_TIM15                  FALSE
+#define STM32_ST_USE_TIM16                  FALSE
+#define STM32_ST_USE_TIM17                  FALSE
 #define STM32_ST_USE_TIM21                  FALSE
 #define STM32_ST_USE_TIM22                  FALSE
 
