Read the 'timer' chapter in the 'STM32 Reference Manual' (available at the ST web site).
Most of the pins named CX_USART_.. are also connectable to an internal timer/counter. Or you can you CX_ADC_TIM too.. (PB0). I don't know what is the max frequency, but very often the pin is sampled at the clock freq. It should be at least several MHz (probably up to 36MHz).