Skip to main content
nichtgedacht
Associate III
March 6, 2017
Question

CubeMX STM32L433CC ETR2 Input bug?

  • March 6, 2017
  • 4 replies
  • 1207 views
Posted on March 06, 2017 at 17:48

Hi

When TIM2 of this device is configured according to the screenshot, the following code will be generated:

void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* tim_baseHandle)
{
 GPIO_InitTypeDef GPIO_InitStruct;
 if(tim_baseHandle->Instance==TIM1)
 {
 /* USER CODE BEGIN TIM1_MspInit 0 */
 /* USER CODE END TIM1_MspInit 0 */
 /* Peripheral clock enable */
 __HAL_RCC_TIM1_CLK_ENABLE();
 /* USER CODE BEGIN TIM1_MspInit 1 */
 /* USER CODE END TIM1_MspInit 1 */
 }
 else if(tim_baseHandle->Instance==TIM2)
 {
 /* USER CODE BEGIN TIM2_MspInit 0 */
 /* USER CODE END TIM2_MspInit 0 */
 /* Peripheral clock enable */
 __HAL_RCC_TIM2_CLK_ENABLE();
 
 /**TIM2 GPIO Configuration 
 PA0 ------> 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;
 // This line is missing:
 GPIO_InitStruct.Alternate = GPIO_AF14_TIM2;
 HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
 /* USER CODE BEGIN TIM2_MspInit 1 */
 /* USER CODE END TIM2_MspInit 1 */
 }
}
�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?

The line marked as missing becomes not generated leaving the pin as output.

Besides this error the wording within the Configuration of TIM2 -> GPIO is also missleading, telling the user

that this is an output pin. 'Maximum Output Speed: ...'

CubeMX 4.19

STM32Cube_FW_L4_V1.6.0.

Dieter

    This topic has been closed for replies.

    4 replies

    Nesrine M_O
    Associate
    March 7, 2017
    Posted on March 07, 2017 at 12:19

    Hi

    Br_ggemann.Dieter

    ,

    I will check this issue with our MX team & come back to you.Sorry for the inconvenience it may bring.

    -Nesrine-

    Jeanne Joly
    Associate
    May 9, 2017
    Posted on May 09, 2017 at 10:16

    Hello

    Br_ggemann.Dieter

    .

    Thanks to highlight this issue. It will be delivered in CubeMX4.21 that will come very soon!

    Please, upgrade your CubeMX release as soon as it is available.

    BR. Eric

    Maciej Musia?
    Associate
    February 11, 2018
    Posted on February 11, 2018 at 20:09

    Hi.

    I would like you to know this issue is still present in CubeMX 4.24 for STM32F207 (look at my post here:

    https://community.st.com/0D50X00009XkWjbSAF

    )

    Jeanne Joly
    Associate
    February 12, 2018
    Posted on February 12, 2018 at 10:18

    Hi

    xt1

    ,

    This thread was posted some time ago and has been solved. Maybe, something else happens in CubeMX4. So let's discussthe issue you just reported on the thread you created

    https://community.st.com/0D50X00009XkWjbSAF

    .

    BR. Jeanne