AnsweredAssumed Answered

CubeMX bug report: error in generated stm32f2xx_hal_msp.c

Question asked by Maciej Musiał on Feb 4, 2018
Latest reply on Feb 12, 2018 by Jeanne Joly



  I found a problem with initialization code generated for TIM2 when you select Clock source as ETR2. The bug is with pin initialization for alternate function: GPIO_InitStruct.Alternate is not set to any value (let alone the desired one):


Inside function HAL_TIM_Base_MspInit:


/**TIM2 GPIO Configuration    
    PA0-WKUP     ------> TIM2_ETR

    GPIO_InitStruct.Pin = GPIO_PIN_0;
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
    GPIO_InitStruct.Pull = GPIO_NOPULL;
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
    HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);


The version of CubeMX is 4.24.0


The problem is only with TIM2, all other timers generate proper code.