Measure pulse width generated in one pulse mode using HAL
There is an example in the STM32F446xx Reference Manual in section 18.3.6.  It uses one timer to capture the time of the rising edge and another to capture the time of the falling edge.  This mode is typically used to decode a PWM encoded input.