2016-11-24 12:51 AM
When generating code for MDK-ARM v5 with STM32CubeMX v4.17.0 for TIM3 Ch3 you get:''GPIO_InitStruct.Alternate = GPIO_AF0_TIM3;''
in ''void HAL_TIM_MspPostInit(TIM_HandleTypeDef* htim)'' (stm32f0xx_hal_msp.c) The correct code would be: ... = GPIO_AF1_TIM3; Have not tested generating for other IDEs. Not a big deal, you get an error when compiling and easy to correct.2016-11-24 02:41 AM
Dear User,
I have checked from my sidewith STM32F030K6T, I have the correct code:
GPIO_InitStruct.Alternate = GPIO_AF1_TIM3;
Could you please precise with which device you have found this issue ? So, we can verify it and you can share your .ioc to check with you this case.
Best Regards
STMforum2016-11-24 03:43 AM
Hi,
I used the STM32F051R8Tx. Just tried again, with same result. Kindly, Jan ________________ Attachments : STM32F051R8Tx.ioc : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Htpe&d=%2Fa%2F0X0000000aXS%2F9IQki.xDUHbv5JMTiVp2hmYKr1sR7dPjKo42L.lCXXE&asPdf=false2016-11-24 04:56 AM
Dear frisk.jan,
Referring to the datasheet for STM32F051x4, STM32F051x6 and STM32F051x8 : TIM3 is configured as AF1 Alternate Function. The specific alternate function assignments for each pin are detailed in the device : Table 15. Alternate functions selected through GPIOB_AFR registers for port B Best Regards STM32.forum2016-11-24 06:09 AM
Dear,
in my case the TIM3_CH3 is on PC8, on a 64-pin STM32F051R8Tx. The blue LED is sitting on that pin on the STM32F0-Discovery. The code below is generated by CubeMX with the MCU alone chosen, i.e. not the Discovery-board. /**TIM3 GPIO Configuration PC8 ------> TIM3_CH3 */ GPIO_InitStruct.Pin = GPIO_PIN_8; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; GPIO_InitStruct.Alternate = GPIO_AF0_TIM3; HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); Best Regards, Jan2016-11-24 06:24 AM
Dear Jan,
I will report this issue to our CUBEMX team for checking, thank you for highlighting it. Best Regards STM32.forum2017-01-06 05:26 AM
Hello frisk.jan,
Your issue is corrected and delivered in CubeMX4.19.
BR.
Eric Dampierre
2017-01-06 05:53 AM
Just for your information, CubeMX4.19 will be available soon.
BR. Eric