Topic : problems with stm8s_it.c

Forum : ST7/STM8

Original Post
Post Information Post
April 7, 2011 - 9:18am
Guest

hello,
I am a chinese student ,when i make the file stm8s_it.c there are always some problems as follows:

*** ERROR C007 IN LINE 762 OF E:\liwu\gongcheng\wuxianyaokong\ride7\LFRF_demo\project\stm8s_it.c : Invalid type in 'TIM4_FLAG_UPDATE' definition
*** ERROR C162 IN LINE 763 OF E:\liwu\gongcheng\wuxianyaokong\ride7\LFRF_demo\project\stm8s_it.c : Syntax error near 'if'
*** ERROR C074 IN LINE 743 OF E:\liwu\gongcheng\wuxianyaokong\ride7\LFRF_demo\project\stm8s_it.c : Invalid declaration syntax
*** ERROR C131 IN LINE 763 OF E:\liwu\gongcheng\wuxianyaokong\ride7\LFRF_demo\project\stm8s_it.c : unbalanced #if-endif controls

i had change it for weeks but can not solve it ,can anybody help me?

Best Regards

David li

Replies
Post Information Post
+1
0
-1
April 7, 2011 - 9:21am
Guest

hello,
can anybody give me the right file 'stm8s_it.c 'on stm8s series?
thankyou verymuch!

Best Regards!

+1
0
-1
April 7, 2011 - 9:24am
Guest

hello,
Can anybody give me the right file 'stm8s_it.c 'on stm8s series?
thankyou very much! my email is

Best Regards!

+1
0
-1
April 7, 2011 - 9:35am
Raisonance Support Team

Hi,

The stm8s_it.c is a user-modifiable file. This means that there is no "standard" for it, as it contains some application-specific code.

Please browse through the ST Library examples, there are plenty of working examples using interrupts.

Best Regards,

+1
0
-1
April 7, 2011 - 2:35pm
Guest

Dear sir,

I am a chinese student and just know a little about ST, so i do not know where the ST Library examples is .i really want to get help from you ,please help me.i have send the file stm8s_it.c to your email named 'support@raisonance.com 'please check it and give me some suggestion.Thank you very much!

Best Regards,

david li

+1
0
-1
April 7, 2011 - 3:29pm
Raisonance Support Team

Hi David,

I received your code by email.
From what I understand your filing line is
TIM4_ClearFlag(TIM4_FLAG_UPDATE);

The TIM4_FLAG_UPDATE preprocessor macro is defined in stm8s_tim4.h, so you must have a configuration problem:
- Open your stm8s_conf.h file
- Look for the "#define _TIM4 (1)" line
- Ensure that it is not commented out

That should fix your issue.
Best Regards,

+1
0
-1
April 8, 2011 - 1:04am
Guest

Hi Bruno,

I follow your suggestion and find out where the "#define _TIM4 (1)" is, It is appears as follows:

/************************************* TIM4 ***********************************/
#if defined(STM8S208) ||defined(STM8S207) ||defined(STM8S103) ||defined(STM8S105)
#define _TIM4 (1)
#endif /* (STM8S208) ||(STM8S207) || (STM8S103) || (STM8S105) */

It means that it is not commented out ,i think the main problem may be the last errors" unbalanced #if-endif controls "but i can not find it out,I Need your help,thank you!

Best Regards!
david li

+1
0
-1
April 8, 2011 - 7:57am
Guest

Hi Bruno?

I Changed the code and maked it again it comes the errors as follows:

"E:\liwu\gongcheng\wuxianyaokong\ride7\LFRF_demo\project\stm8s_it.c" QUIET GENERATEDEPFILE DB OJ("E:\liwu\gongcheng\wuxianyaokong\ride7\LFRF_demo\project\RIDE\Debug\stm8s_it.obj") PR("E:\liwu\gongcheng\wuxianyaokong\ride7\LFRF_demo\project\RIDE\Debug\stm8s_it.lst") PIN("E:\liwu\gongcheng\wuxianyaokong\ride7\LFRF_demo\project\RIDE\..\..\examples\Common;E:\liwu\gongcheng\wuxianyaokong\ride7\LFRF_demo\project\RIDE\..\..\library\inc;C:\Program Files\Raisonance\Ride\Inc;C:\Program Files\Raisonance\Ride\Inc\ST7;.;.\..;.\..\..") STM8(SMALL) O(3,SIZE) NOPRINT INITSTATICVAR SMALLOBJECT ET(INT)
*** ERROR C256 IN LINE 774 OF E:\liwu\gongcheng\wuxianyaokong\ride7\LFRF_demo\project\stm8s_it.c : Improper use of typedef 'u8'
*** ERROR C256 IN LINE 775 OF E:\liwu\gongcheng\wuxianyaokong\ride7\LFRF_demo\project\stm8s_it.c : Improper use of typedef 'u8'
*** ERROR C014 IN LINE 801 OF E:\liwu\gongcheng\wuxianyaokong\ride7\LFRF_demo\project\stm8s_it.c : Undefined 'sample_pointer'
*** ERROR C014 IN LINE 802 OF E:\liwu\gongcheng\wuxianyaokong\ride7\LFRF_demo\project\stm8s_it.c : Undefined 'sample_pointer'
*** ERROR C103 IN LINE 804 OF E:\liwu\gongcheng\wuxianyaokong\ride7\LFRF_demo\project\stm8s_it.c : Misplaced 'case'
*** ERROR C000 IN LINE 746 OF E:\liwu\gongcheng\wuxianyaokong\ride7\LFRF_demo\project\stm8s_it.c : Character '}' missing
*** ERROR C131 IN LINE 804 OF E:\liwu\gongcheng\wuxianyaokong\ride7\LFRF_demo\project\stm8s_it.c : unbalanced #if-endif controls

I had try it but can not solve it.give me some suggestions please?thank you very much!

best Regards!
david li

+1
0
-1
April 8, 2011 - 10:24am
Guest

hi Stephan?

I think there maight be some mistake between you and me .i also operated on ride7 and RKit-STM8 .when i make the files i faced some problems i can not solve it .i just want to get help from the administrators.

best regards
david li

+1
0
-1
April 8, 2011 - 11:44am
Guest

Hi David,

thank you for posting your question again under another topic. I did not mean to be offensive and if you understood my post that way I sincerely apologize.

My only intent was to point out, that the board stays much easier to navigate for everybody if there is only one topic per thread.

Since your problem concerns a software issue and mine concerns an issue regarding the usability of an older version of a programming adapter with a newer microcontroller and those issues are not really related, a separate thread in the board for each of those issues just makes sense in my opinion.

Regards,
Stephan

+1
0
-1
April 9, 2011 - 12:43am
Guest

Hi stephan,

It is my fault to interrupt your questions,i am so sorry to interrupt you. excuse me!

Best Regards!
David li

+1
0
-1
April 9, 2011 - 1:16am
Guest

Hi stephan,

I know you are good at sofware and can you send me a file of stm8s_it.c.? I owned one but it's full of mistake.my email address is' ' I am looking forward to hearing from you. thank you very much!

Best Regards!
David li

+1
0
-1
April 11, 2011 - 11:25am
Guest

dear administrator,

I am so sorry to interrupt you.when i make the file the problems appears as follows:

*** ERROR C256 IN LINE 774 OF E:\liwu\gongcheng\wuxianyaokong\ride7\LFRF_demo\project\stm8s_it.c : Improper use of typedef 'u8'
*** ERROR C256 IN LINE 775 OF E:\liwu\gongcheng\wuxianyaokong\ride7\LFRF_demo\project\stm8s_it.c : Improper use of typedef 'u8'
*** ERROR C014 IN LINE 801 OF E:\liwu\gongcheng\wuxianyaokong\ride7\LFRF_demo\project\stm8s_it.c : Undefined 'sample_pointer'
*** ERROR C014 IN LINE 802 OF E:\liwu\gongcheng\wuxianyaokong\ride7\LFRF_demo\project\stm8s_it.c : Undefined 'sample_pointer'
*** ERROR C103 IN LINE 804 OF E:\liwu\gongcheng\wuxianyaokong\ride7\LFRF_demo\project\stm8s_it.c : Misplaced 'case'
*** ERROR C000 IN LINE 746 OF E:\liwu\gongcheng\wuxianyaokong\ride7\LFRF_demo\project\stm8s_it.c : Character '}' missing
*** ERROR C131 IN LINE 804 OF E:\liwu\gongcheng\wuxianyaokong\ride7\LFRF_demo\project\stm8s_it.c : unbalanced #if-endif controls

I can not solve it,can you help me? I am just a student and so weak.thank you very much!

best regards!

+1
0
-1
April 12, 2011 - 9:00am
Raisonance Support Team

Hi David,

I received your project by email.
The problem comes from the fact that "data" is a reserved keyword. It indicates that a given variable is placed in long-range RAM. And it should NOT be used as a variable identifier.

The fix is just to rename all "data" occurrences in your code by "data_in", and you're done.

Please refer to the Compiler Manual for detail.

Best Regards,

+1
0
-1
April 12, 2011 - 9:20am
Guest

Hi Bruno,

Thanks for your quick reply,i have tried it but still appers the same errors,what about the 'u8'?it suggests 'Improper use of typedef 'u8' thanks very much.

Best Regards!

David li