Setting up a counter on STM32F405xx
First thing I always check is to make sure that all the clocks I need are turned on. You'll need to make sure that the clocks for APB2 (TIM9) and AHB1 (GPIO) are turned on. Additionally, timer functions are alternate functions, so you'll need to set the GPIOx_MODER bits for the appropriate port and pin you're using, as well as the appropriate GPIOx_AFRy bits. The datasheet and reference manual should have all the info you need, sometimes it just takes some doing to find what you're looking for.