TIM2 PWM Output goes to zero unexpectedly
I am using the STM32F207ZG MCU, and I started a new project in STM32CubeIDE. I wrote the following code, which changes the state of TIM2 PWM output CH1:
/* USER CODE BEGIN 2 */
HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_1);
HAL_TIM_PWM_Start(&htim3, TIM_CHANNEL_1);
TIM2->ARR = 48000;
TIM2->CCR1 = 16000;
HAL_Delay(3000);
TIM2->CCR1 = 3200;
HAL_Delay(3000);
TIM2->ARR = 8000;
/* USER CODE END 2 */
I expected the last line (TIM2->ARR = 8000) affect the period of the PWM output but not change the pulse width. However, after the last line executes, the PWM output goes to zero on my oscilloscope. Is this expected behavior?
If I use TIM3, the behavior is as I would expect.
Below are some screenshots of my configuration in the .ioc file:


