cancel
Showing results for 
Search instead for 
Did you mean: 

stm32cubeMX bug???

dqsh06
Associate III

Hello,

I am now using STM32CubeMX to config STM32G030F6P6, I want to use TIM14 to capture pulse, so I configged to Input Capture direct mode, which is obviously input port, but GPIO setting becomes GPIO output Low. is this a stm32cubeMX bug?

dqsh06_0-1729747045042.png

please confirm.

Thanks

@GMA 

 

5 REPLIES 5
SofLit
ST Employee

Hello,

Check the generated code. Is there something weird in it?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

hello, @SofLit 

I have changed chip to STM32G030C8T6, because STM32G030F6P6 cannot use HSE.

but for STM32G030C8T6, the cubeMX is also something strange. 

dqsh06_0-1729755233025.png

tim1, channel2 is a PWM output, but the GPIO setting, just like a input capture.

dqsh06_1-1729755359288.png

tim3, channel3 is a input capture, but GPIO setting like a PWM output.

I think it is a bug of cubeMX, I have generated the code. from code, I cant see it is correct or not.

only output pins have GPIO configs.

you can config your cubeMX and see the result.

thanks.

 

Hello, 

I've moved your second question in a separated thread.

Now regarding your main issue, I've already suggested you to check if the generated code is wrong, and I think you didn't it. I did it from my side, and the generated code is correct for TIM14:

void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base)
{
  GPIO_InitTypeDef GPIO_InitStruct = {0};
  if(htim_base->Instance==TIM14)
  {
  /* USER CODE BEGIN TIM14_MspInit 0 */

  /* USER CODE END TIM14_MspInit 0 */
    /* Peripheral clock enable */
    __HAL_RCC_TIM14_CLK_ENABLE();

    __HAL_RCC_GPIOF_CLK_ENABLE();
    /**TIM14 GPIO Configuration
    PF0-OSC_IN (PF0)     ------> TIM14_CH1
    */
    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;
    GPIO_InitStruct.Alternate = GPIO_AF2_TIM14;
    HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);

  /* USER CODE BEGIN TIM14_MspInit 1 */

  /* USER CODE END TIM14_MspInit 1 */

  }

}

So PF0 is configured as Alternate function for Timer input.

I think the issue is in the GUI not in the code generation: internal ticket Internal ticket 195604 for follow-up.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Thanks!

How about the GDB step over issue? 

where can I see the other thread?

Regards,

 


@dqsh06 wrote:

How about the GDB step over issue? 

where can I see the other thread?

Regards,

 


https://community.st.com/t5/stm32cubemx-mcus/having-a-st-link-gdb-issue-i-and-i-m-using-vs-code/td-p/738536

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.