2009-12-23 13:29:44     CM-BF548 compile error on gpio sample

Document created by Aaronwu Employee on Aug 20, 2013
Version 1Show Document
  • View in full screen mode

2009-12-23 13:29:44     CM-BF548 compile error on gpio sample

Tom Wimmer (GERMANY)

Message: 83892   

 

Hello, this time i try to compile the sample code from   docs.blackfin.uclinux.org/doku.php?id=gpio

 

branch 2.6.28.10-ADI-2009R1 and  uClinux-dist-2009R1-RC6

 

i only added the include for linux/module.h and the printk msgs

 

<p>

 

#include <asm/gpio.h>

#include <linux/module.h>

 

static __init int sample_module_init(void)

{

    int ret;

    printk("loading\n");

     ret = gpio_request(GPIO_PG8, "Sample Driver");

    if (ret) {

    printk(KERN_WARNING "sample_driver: unable to request GPIO_PG8\n");

    return ret;

    }

  

    return 0;

}

 

static __exit void sample_module_exit(void)

{

        gpio_free(GPIO_PG8);

 

        printk("unloading\n");

}

 

module_init(sample_module_init);

module_exit(sample_module_exit);

 

</p>

 

simple Makefile:

 

<p>

 

obj-m:=kgpioin.o

default:

    make  -C /home/tom/devel/2bf548/uclinux/uClinux-dist/linux-2.6.x/ M=`pwd`

 

</p>

 

here compiler msg:

 

<p>

 

cd '/home/tom/devel/2bf548/code/kgpioin' && LC_MESSAGES="C" LC_CTYPE="C" make -k

make -C /home/tom/devel/2bf548/uclinux/uClinux-dist/linux-2.6.x/ M=`pwd`

CC [M] /home/tom/devel/2bf548/code/kgpioin/kgpioin.o

In file included from /home/tom/devel/2bf548/uclinux/uClinux-dist/linux-2.6.x/arch/blackfin/mach-bf548/include/mach/cdefBF548.h:43,

from /home/tom/devel/2bf548/uclinux/uClinux-dist/linux-2.6.x/arch/blackfin/mach-bf548/include/mach/blackfin.h:70,

from /home/tom/devel/2bf548/uclinux/uClinux-dist/linux-2.6.x/arch/blackfin/include/asm/blackfin.h:89,

from /home/tom/devel/2bf548/uclinux/uClinux-dist/linux-2.6.x/arch/blackfin/include/asm/processor.h:10,

from /home/tom/devel/2bf548/uclinux/uClinux-dist/linux-2.6.x/arch/blackfin/include/asm/irq.h:23,

from /home/tom/devel/2bf548/uclinux/uClinux-dist/linux-2.6.x/arch/blackfin/include/asm/gpio.h:302,

from /home/tom/devel/2bf548/code/kgpioin/kgpioin.c:1:

/home/tom/devel/2bf548/uclinux/uClinux-dist/linux-2.6.x/arch/blackfin/mach-bf548/include/mach/cdefBF54x_base.h: In function 'bfin_write_PLL_CTL':

/home/tom/devel/2bf548/uclinux/uClinux-dist/linux-2.6.x/arch/blackfin/mach-bf548/include/mach/cdefBF54x_base.h:2708: error: implicit declaration of function 'local_irq_save'

/home/tom/devel/2bf548/uclinux/uClinux-dist/linux-2.6.x/arch/blackfin/mach-bf548/include/mach/cdefBF54x_base.h:2725: error: implicit declaration of function 'local_irq_restore'

make[2]: *** [/home/tom/devel/2bf548/code/kgpioin/kgpioin.o] Error 1

make[2]: Target `__build' not remade because of errors.

make[1]: *** [_module_/home/tom/devel/2bf548/code/kgpioin] Error 2

make[1]: Target `_all' not remade because of errors.

make: *** [default] Error 2

*** Exited with status: 2 ***

</p>

 

Thanks for your time! :-)

QuoteReplyEditDelete

 

 

2009-12-23 13:43:22     Re: CM-BF548 compile error on gpio sample

Mike Frysinger (UNITED STATES)

Message: 83893   

 

this is probably already fixed in trunk.  simply re-arrange the include order in your code to make it work.

QuoteReplyEditDelete

 

 

2009-12-23 13:45:29     Re: CM-BF548 compile error on gpio sample

Tom Wimmer (GERMANY)

Message: 83895   

 

Thank you Mike! I never thought about this...

Attachments

    Outcomes