cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE error?

SMj.1
Associate II

0693W00000GXHqsQAH.png0693W00000GXHrHQAX.png0693W00000GXHpRQAX.pngUse TIM3 PWM --> GPIO_AF0_TIM3

but #define GPIO_AF1_TIM3

Error??

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @SMj.1​ ,

Thank you for bringing this point to our attention and thanks @Imen DAHMEN​ for the tag.

Actually you're right, the build problem occurs when remapping TIM3_CH3 function to a pin other than PB0 pin (PC8) .

In fact, backing to the STM32F051 Data Sheet, TIM3_CH3 is AF1:TIM3 Alternate Function selected through GPIOB_AFR registers for port B:

0693W00000GY4tMQAT.pngWith this being said, this problem is reported internally to be fixed. I'll keep you posted with updates.

Internal ticket number: 117811 (This is an internal tracking number and is not accessible or usable by customers).

Sorry for any inconvenience that this may cause.

Even though this reply doesn’t directly solve the issue, I’m marking it as Best, since it will help clarify the current situation for other customers with the same question. I will post an update here once the issue has been fixed.

Khouloud.

View solution in original post

7 REPLIES 7
Imen.D
ST Employee

Hello @SMj.1​ and welcome to the Community :)

This issue is fixed with the latest release of STM32CubeMX-6.3.0.

So, please make sure to use this release, then keep me informed about your update.

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
SMj.1
Associate II

So, why does the error occur when I generate the code in STM32CubeIDE 1.7.0?

So, why does the error occur when I generate the code in STM32CubeIDE 1.7.0? 2021년 11월 12�?� (금) 오후 10:04, ST Community 님�?� 작성:

The CubeIDE is integrated CubeMX. So you generate your project through cubeMx.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
STM32F051R8T6 PC6 ------> TIM3_CH1 PC7 ------> TIM3_CH2 PC8 ------> TIM3_CH3 PC9 ------> TIM3_CH4 ../Core/Src/stm32f0xx_hal_msp.c: In function 'HAL_TIM_MspPostInit': ../Core/Src/stm32f0xx_hal_msp.c:131:33: error: 'GPIO_AF0_TIM3' undeclared (first use in this function); did you mean 'GPIO_AF1_TIM3'? 131 | GPIO_InitStruct.Alternate = GPIO_AF0_TIM3; | ^~~~~~~~~~~~~ | GPIO_AF1_TIM3 ../Core/Src/stm32f0xx_hal_msp.c:131:33: note: each undeclared identifier is reported only once for each function it appears in 2021년 11월 16�?� (화) 오후 11:57, ST Community 님�?� 작성:
Imen.D
ST Employee

Hi @SMj.1​ ,

You are right, I reproduced the same issue with CubeMx 6.3.

I will escalate this issue internally to CubeMx team for fix.

Hello @Khouloud OTHMAN​ , @Khouloud ZEMMELI​ ,

Can you please review this issue?

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

Hello @SMj.1​ ,

Thank you for bringing this point to our attention and thanks @Imen DAHMEN​ for the tag.

Actually you're right, the build problem occurs when remapping TIM3_CH3 function to a pin other than PB0 pin (PC8) .

In fact, backing to the STM32F051 Data Sheet, TIM3_CH3 is AF1:TIM3 Alternate Function selected through GPIOB_AFR registers for port B:

0693W00000GY4tMQAT.pngWith this being said, this problem is reported internally to be fixed. I'll keep you posted with updates.

Internal ticket number: 117811 (This is an internal tracking number and is not accessible or usable by customers).

Sorry for any inconvenience that this may cause.

Even though this reply doesn’t directly solve the issue, I’m marking it as Best, since it will help clarify the current situation for other customers with the same question. I will post an update here once the issue has been fixed.

Khouloud.