Timer slave configuration is not initialized correct with CubeMX inside STM32CubeIDE
Hello everybody,
I think I have stumbled accross a configuration and initialization error when using STM32CubeIDE and the CubeMX peripheral initialization:
I am using a NUCLEO-L476RG board and want to use TIM2 to trigger TIM3 as a slave and start both timers simultaniously. As for TIM2 I use the following settings:

for TIM3 the following:

I also have acitvated the global interrupt on both timers since I want to use TIM3 to trigger the ADC and convert samples as long as TIM3 runs. TIM2 is the period at which I will send the avareged ADC samples to an external host.
So I normaly thouight that the code generator would uses the
HAL_TIM_SlaveConfigSynchro_IT(&htim3, &sSlaveConfig)function. But instead I get the following initialization which I then manually change in the interrupt driven slave configuration function:
void MX_TIM3_Init(void)
{
TIM_ClockConfigTypeDef sClockSourceConfig = {0};
TIM_SlaveConfigTypeDef sSlaveConfig = {0};
TIM_MasterConfigTypeDef sMasterConfig = {0};
htim3.Instance = TIM3;
htim3.Init.Prescaler = 60000;
htim3.Init.CounterMode = TIM_COUNTERMODE_UP;
htim3.Init.Period = 0;
htim3.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
htim3.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
if (HAL_TIM_Base_Init(&htim3) != HAL_OK)
{
Error_Handler();
}
sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
if (HAL_TIM_ConfigClockSource(&htim3, &sClockSourceConfig) != HAL_OK)
{
Error_Handler();
}
sSlaveConfig.SlaveMode = TIM_SLAVEMODE_COMBINED_RESETTRIGGER;
sSlaveConfig.InputTrigger = TIM_TS_ITR1;
if (HAL_TIM_SlaveConfigSynchro(&htim3, &sSlaveConfig) != HAL_OK)
{
Error_Handler();
}
sMasterConfig.MasterOutputTrigger = TIM_TRGO_UPDATE;
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_ENABLE;
if (HAL_TIMEx_MasterConfigSynchronization(&htim3, &sMasterConfig) != HAL_OK)
{
Error_Handler();
}
}Is this an error with the code generator, or do I misunderstand here something?
best regards
Benjamin
