Timer1 configured but not enabled by CubeMX
I’m just getting started with Cube MX and IDE. (MX: 6.18.1, IDE:2.2.0, Debian Trixie platform)
I have the Nucleo-144 board with STM32F412GTx device. I’ve tried to configure the TIM1 as PWM,and enabled the interrupts in MX. Generated the code, opened in IDE, built and uploaded to the neucleo board with no significant problems.
However, whilst the timer is configured pretty much as specified in MX, the timer is not enabled, none of the interrupts are enabled and the output is not enabled.
I can see that whilst a motor control program would not want either the timer or the timer output enabled at boot, not having the interrupts enabled seems strange. I managed to enable these by looking up in the reference manual and manually setting the registers in the debug mode, but that does not affect the Flashed code. (Modifying CR1, DIER and CCER registers)
I did find one article describing how to enable the timer, and added that code to the timer init function, but so far I’ve not found the commands to either enable the output(s) or the interrupts. I think that it would be better - particularly for new learners- to have these commands AUTOMATICALLY generated by MX, but commented out, so that they can be easily implemented. Please can someone suggest the appropriate commands for enabling the output & interrupts? like
/* USER CODE BEGIN TIM1_Init 2 */
HAL_TIM_Base_Start(&htim1);
/* USER CODE END TIM1_Init 2 */
Thanks.
