STM32F051R8: PWM timers don't work?
In your part the port C pins 8 and 9 have an alternate functions as a Timer3 channel, but you are trying to use them with Timer2, which will not work of course. See the page 34 in the datasheet. In addition, I don't see anything related to PC8 in the code, but you are saying it has a LED connected to it.