Skip to main content
Visitor II
January 24, 2018
Question

Error during compiling

  • January 24, 2018
  • 1 reply
  • 1677 views
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.

    This topic has been closed for replies.

    1 reply

    Graduate II
    January 24, 2018
    Posted on January 24, 2018 at 09:44

    Would suggest your project is missing the GPIO source files.

    Visitor II
    January 24, 2018
    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.

    Visitor II
    January 24, 2018
    Posted on January 24, 2018 at 12:02

    I got the output with another program.

    Thanks & Regards,

    Prasad.