2024-10-23 10:18 PM
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?
please confirm.
Thanks
2024-10-23 10:32 PM
Hello,
Check the generated code. Is there something weird in it?
2024-10-24 01:30 AM
hello, @SofLit
I have changed chip to STM32G030C8T6, because STM32G030F6P6 cannot use HSE.
but for STM32G030C8T6, the cubeMX is also something strange.
tim1, channel2 is a PWM output, but the GPIO setting, just like a input capture.
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.
2024-11-04 01:19 AM
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.
2024-11-04 01:46 AM
Thanks!
How about the GDB step over issue?
where can I see the other thread?
Regards,
2024-11-04 01:47 AM
@dqsh06 wrote:
How about the GDB step over issue?
where can I see the other thread?
Regards,