2016-12-06 04:59 AM
We are working on a project based on timer in which we keep facing an error : symbol _TIM1_SetCounter not defined. We have included the header files as well. Thanks in advance.
Solved! Go to Solution.
2016-12-06 05:19 AM
Hi
,/** * @brief Sets the TIMx Counter Register value * @param TIMx: where x can be 1 to 14 to select the TIM peripheral. * @param Counter: specifies the Counter register new value. * @retval None */void TIM_SetCounter(TIM_TypeDef* TIMx, uint32_t Counter){ /* Check the parameters */ assert_param(IS_TIM_ALL_PERIPH(TIMx)); /* Set the Counter Register value */ TIMx->CNT = Counter;}�?�?�?�?�?�?�?�?�?�?�?�?�?�?
TIM_SetCounter(TIM1, 100);
-Nesrine M-
2016-12-06 05:19 AM
Hi
,/** * @brief Sets the TIMx Counter Register value * @param TIMx: where x can be 1 to 14 to select the TIM peripheral. * @param Counter: specifies the Counter register new value. * @retval None */void TIM_SetCounter(TIM_TypeDef* TIMx, uint32_t Counter){ /* Check the parameters */ assert_param(IS_TIM_ALL_PERIPH(TIMx)); /* Set the Counter Register value */ TIMx->CNT = Counter;}�?�?�?�?�?�?�?�?�?�?�?�?�?�?
TIM_SetCounter(TIM1, 100);
-Nesrine M-
2016-12-06 07:53 AM
Header files describe interfaces they don't add code for those interfaces. You need to add the stm32fxx_tim.c type files to the project so the code you are calling actually gets into the linker.
2016-12-07 12:24 AM
Thank all, but we are still receiving a few errors. We are working on stm8s controller. So is there a different .c file that we have to add?
2016-12-07 01:32 AM
Hi
BUCH.NISHAD
,Your question will be redirected to
https://community.st.com/community/stm8-mcus
forum.-Nesrine-
Ifmy suggestanswers your question, please mark it as correct.
2016-12-07 01:34 AM
Thanks and sorry for inconvenience. I was unaware of the stm8 forum.