Forum : ST7/STM8
Post Information | Post |
---|---|
March 15, 2011 - 5:31am
|
I am trying out the new STM8S TSL v2.3.1 and it fail to compile the library code and halted. It fail on all the TSL v2.3.1 source files (error message as per below). What can I do to resolve the issue? Using STVD 4.2 with Raisonance toolseet. P/S: sample project with the problem: Error message: *** ERROR C001 IN LINE 84 OF ..\libraries\stm8_touchsensing_driver\inc/stm8_tsl_rc_acquisition.h : 'extern' specifier not allowed in the context *** ERROR C074 IN LINE 83 OF ..\libraries\stm8_touchsensing_driver\inc/stm8_tsl_rc_acquisition.h : Invalid declaration syntax *** ERROR C131 IN LINE 84 OF ..\libraries\stm8_touchsensing_driver\inc/stm8_tsl_rc_acquisition.h : unbalanced #if-endif controls RCSTM8 COMPILATION COMPLETE. 0 WARNING, 3 ERRORS The command: "rcstm8 ..\libraries\stm8_touchsensing_driver\src\stm8_tsl_api.c OBJECT(Debug\stm8_tsl_api.o) PIN("C:\Program Files\Raisonance\Ride\inc\ST7") PIN("C:\Program Files\Raisonance\Ride\inc") WRV(0) STM8(SMALL) DEBUG DGC(page0) AUTO OT(0) PR(Debug\stm8_tsl_api.lst) CD CO SB LAOB PIN(..\libraries\stm8s_stdperiph_driver\inc) PIN(..\libraries\stm8_touchsensing_driver\inc) PIN(source) DF(STM8S105)" has failed, the returned value is: 2 |
It seems nobody is interested...
Anyway more info for those interested:
stm8_tsl_api.I contents (last few lines of the file)
0<----
typedef struct {
GPIO_TypeDef * PORT_ADDR ;
u8 AcqMask ;
u8 DriveMask ;
u16 * Measurement ;
u8 * RejectedNb ;
IOTYPE_T Type ;
}
TOUCH_PORT_Info_T ;
extern TOUCH_PORT_Info_T page0 sTouchIO ;
at ( 0x5328 ) hreg16 TIMACQ_CNTR ;
extern __CONST u8 Table_SCKEY_BITS [ ] ;
extern __CONST u8 Table_MCKEY_BITS [ ]
O<----
It seems that the preprocessor somehow stop there!
Anybody can help???
Hi,
Sorry for the late reply.
The problem comes from the __CONST macro which is not defined in your project.
It should be defined as follows for the RCSTM8 compiler:
#define __CONST code
Feel free to come back to us if you still have some problems.
Best Regards,
Defining the __CONST as code makes the code working!
Thanks!
I can't find any information about __CONST anywhere in the TSL user manual. Can you point out where in the documents contain this reference?
Regards,
KF
Further investigation found that the problem lies in the Standard Peripheral Library (FWLIB) that I was using!
The FWLIB I was using is v2.0.0 (2011-02-25), while the Touch Sensing Library was using v1.1.2 (2010-09-15).
In stm8s.h file of v1.1.2, the __CONST is defined as code, while in v2.0.0, CONST is defined as code! Note the missing double underscore in front!
The v2.0.0 should have a __CONST defined for compatibility reasons.
HTH.
Can someone Put this fileĀ
hxxp://dl.dropbox.com/u/21119576/STM8S_Discovery_Test.zip
andĀ
ftp://www.raisonance.com/pub/STM8/STM8S-Discovery_FULL.zip