cancel
Showing results for 
Search instead for 
Did you mean: 

Error during compiling

penchala prasad reddy
Associate II
Posted on January 24, 2018 at 08:07

I am getting an error while compiling the file.Can any one please help me out.

sdcc -lstm8 -mstm8 --out-fmt-ihx delay.c

?ASlink-Warning-Undefined Global '_GPIO_Init' referenced by module 'delay'

?ASlink-Warning-Undefined Global '_GPIO_WriteLow' referenced by module 'delay'

?ASlink-Warning-Undefined Global '_GPIO_DeInit' referenced by module 'delay'

?ASlink-Warning-Undefined Global '_GPIO_WriteHigh' referenced by module 'delay'

Makefile:16: recipe for target 'delay.ihx' failed

make: *** [delay.ihx] Error 1

Thanks & Regards,

Prasad.

5 REPLIES 5
Posted on January 24, 2018 at 09:44

Would suggest your project is missing the GPIO source files.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on January 24, 2018 at 10:37

 ,

 ,

Thanks for your reply clive !

But i have included GPIO header file too. I have written a program for an led to be in on state for a long and to be in off state for a short period. I am newer to this controller and the code i have written is below.

♯ include 'stm8s.h'

 ,

♯ include 'stm8s_gpio.h'

volatile void delay(volatile uint32_t t)

 ,

{

 ,

while(t--),

 ,

}

void main( void )

 ,

{

GPIO_DeInit(GPIOB),

 ,

GPIO_Init(GPIOB, GPIO_PIN_5, GPIO_MODE_OUT_PP_LOW_FAST),

 ,

GPIO_WriteHigh(GPIOB, GPIO_PIN_5),

 ,

delay(2000),

 ,

GPIO_WriteLow(GPIOB, GPIO_PIN_5),

 ,

delay(20000),

 ,

}

Can i know what is wrong in this program. Can you please help me out.

Posted on January 24, 2018 at 12:02

I got the output with another program.

Thanks & Regards,

Prasad.

Posted on January 24, 2018 at 18:01

Include files provide prototypes, not function code.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on January 25, 2018 at 08:18

Thanks for your reply, I know that it's basic thing. I have tried program in different manner so i ignored the previous program issues ad errors.