cancel
Showing results for 
Search instead for 
Did you mean: 

Porting function HIWARE to Cosmic: help!

marcosarti29
Associate II
Posted on February 16, 2007 at 10:06

Porting function HIWARE to Cosmic: help!

5 REPLIES 5
marcosarti29
Associate II
Posted on February 14, 2007 at 11:31

Hi,

I have old project in Hiware C.

I want traslate it in Cosmic C.

I have same problem with this function defined in Hiware:

void Rampa (volatile unsigned int *PWM);

and used in main:

Rampa(&DCR0);

The problem is that in Hiware DCR0 is:

#define DCR0 (*(volatile unsigned int *)(0x17))

and in Cosmic is:

volatile int DCR0 @0x17;

Cosmic show this error in Rampa(&DCR0):

#error cpst7 interrupt_vector.c:227(12+4) incompatible argument type

Thanks for your help!

luca239955_st
Associate III
Posted on February 15, 2007 at 06:24

change

void Rampa (volatile unsigned int *PWM);

to

void Rampa (volatile int *PWM);

and it should work fine.

Of course you can also do it the other way around (add unsigned into DCR0 definition)

Regards,

Luca (Cosmic)

PS: in case you have not seen it yet,

http://www.cosmicsoftware.com/pdf/Cosmic_vs_MW_ST7.pdf

might be useful for you.

[ This message was edited by: _luca on 15-02-2007 10:57 ]

marcosarti29
Associate II
Posted on February 15, 2007 at 11:01

Thanks for your help!

Now the compiler show:

#error clnk Debug\new3.lkf:1 symbol c_xlcmp not defined (Debug\interrupt_vector.o )

I can post my interrupt code if it's necessary!

Thanks

luca239955_st
Associate III
Posted on February 16, 2007 at 04:46

my guess here would be you are not linking the right libraries: check in the manual what libraries correspond to the memory model you are using.

Regards,

Luca

marcosarti29
Associate II
Posted on February 16, 2007 at 10:06

Thanks for your help! :)

I use small memory model, my micro is ST7LITE19

In Project-->Setting-->Linker-->

I have try to insert:

\COSMIC\CXST7_16K\Lib\libm.st7

and default crtsx.st7

but I have alwais the same error:

Running ST7 linker

clnk -lD:\Programmi\COSMIC\CXST7_16K\Lib -o Debug\new3.st7 -mDebug\new3.map Debug\new3.lkf

#error clnk Debug\new3.lkf:1 symbol c_xlcmp not defined (Debug\interrupt_vector.o )

#error clnk Debug\new3.lkf:1 symbol c_lreg not defined (Debug\interrupt_vector.o )

#error clnk Debug\new3.lkf:1 symbol c_uitol not defined (Debug\interrupt_vector.o )

The command: ''clnk -lD:\Programmi\COSMIC\CXST7_16K\Lib -o Debug\new3.st7 -mDebug\new3.map Debug\new3.lkf '' has failed, the returned value is: 1

exit code=1. :o :|

Thanks

[ This message was edited by: marcomarco on 20-02-2007 10:15 ]