• Timer not working in stm32f401re

    i want to setup timer in STM32F401RE and i already have this code:


    int main(void) {
    TIM1_init();

    while (1) {}
    }


    /// initialize TIM1
    /// timer TIM1 channel 2 is configed to generate PWM at 1kHz. the output of the
    void TIM1_init(void) {
    RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN;…