Topic : Undefined 'TIM6' -- Ride/RKit not definining 'STM8S903'??

Forum : ST7/STM8

Original Post
Post Information Post
November 30, 2010 - 3:59am
Guest

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.

Replies
Post Information Post
+1
0
-1
November 30, 2010 - 9:10am
Raisonance Support Team

Hi,

You just need to uncomment the following line from your stm8_conf.h:
/* #define _TIM6 (1) */

I hope this helps,

+1
0
-1
November 30, 2010 - 5:23pm
Guest

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:

/* Uncomment the line below according to the target STM8S device used in your
   application. 
   Tip: To avoid modifying this file each time you need to switch between these
        devices, you can define the device in your toolchain compiler preprocessor. */
#if !defined (STM8S208) && !defined (STM8S207) && !defined (STM8S105) && !defined (STM8S103) && !defined (STM8S903)
 /* #define STM8S208 */
 /* #define STM8S207 */
 /* #define STM8S105 */
 /* #define STM8S103 */
  #define STM8S903 
#endif
and it is working now.
+1
0
-1
December 1, 2010 - 9:41am
Raisonance Support Team

Great news!