Forum : ST7/STM8
Post Information | Post |
---|---|
November 30, 2010 - 3:59am
|
Recently I started developing an application for an STM8S903K3, but for some reason I get an error compiling the stm8s_tim6.c module (standard firmware library). "C:\Program Files (x86)\Raisonance\Ride\Bin\RCSTM8.EXE" "C:\<...>\stm8s_tim6.c" QUIET GENERATEDEPFILE CODE DB OJ("C:\<...>\stm8s_tim6.obj") PR("C:\<...>\stm8s_tim6.lst") PIN("C:\Program Files (x86)\Raisonance\Ride\Inc;C:\Program Files (x86)\Raisonance\Ride\Inc\ST7") STM8(SMALL) O(0,SPEED) NOINITSTATICVAR SMALLOBJECT ET(INT) *** ERROR C014 IN LINE 48 OF C:\...\stm8s_tim6.c : Undefined 'TIM6'(and there are a number of others like this that follow) In the init.c module where I am configuring this peripheral I have the appropriate include (#include "stm8s_tim6.h"), I believe, and the project settings appear OK. In the underlying stm8.h file I saw the following: #ifdef STM8S903 #define TIM5 ((TIM5_TypeDef *) TIM5_BaseAddress) #define TIM6 ((TIM6_TypeDef *) TIM6_BaseAddress) #endif /* STM8S903 */ So I tried adding "STM8S903" to Project Properties -> Compiler Options -> Additional Options -> Defines... and this caused the error message to go away. Of course, I am sure this is not the correct solution, and there were still other bizarre problems with the build. So I would like to ask your advice: what could be wrong? I am using Ride 7.28.10.0075 with RKit-STM8 2.28.10.0092. I have tried this on two different computers. I have tried recreating the project and adding the source files, but I still encounter problems. Is there some information that I could send you that would help you give me more insight regarding this? Thanks in advance. |
Hi,
You just need to uncomment the following line from your stm8_conf.h:
/* #define _TIM6 (1) */
I hope this helps,
Thanks for your support. I did this but there a number of other small problems too. One of my custom .h files had an unterminated multi-line comment at the end, which caused strange problems. Also the reason I had needed to add that define in the project settings is because stm8s.h had a different default. I changed it to this:
and it is working now.Great news!