[En-Nut-Discussion] Nut/OS LCD Device Driver / GCC problem

Grahame M. Kelly grahame at wildpossum.com
Wed Jun 1 15:27:11 CEST 2005


Hi All.

I am running  Nut/OS Version 3.9.6 with gcc 3.3.5 20050117 (SUSE Linux 9.3) on 
2.6.11.4-20a-default kernel.

Taking the original LCD code from NutPiper, i.e.:  lcd20.[ch]
I simply added:

/*
 * Main
 */
int main(void)
{
    NutRegisterDevice(&devLcd20, 0, 0);
    return 0;
}

On make I get the following gcc errors:

avr-gcc -c -mmcu=atmega128 -Os -Wall -Wstrict-prototypes -Wa,-ahlms=lcd20.lst 
-D__HARVARD_ARCH__  -I../../include  lcd20.c -o lcd20.o

lcd20.c:206: warning: initialization from incompatible pointer type

[line 206 is:]
TERMDCB dcb_term = {
    LcdInit;  <<<-----------------  This Line -----***

make then further degenerates into loader "multiple definition" errors:

avr-gcc lcd20.o .o -mmcu=atmega128 -Wl,--defsym=main=0,-Map=lcd20.map,--cref 
-L/AVR/GMK/AVR/EtherNUT/ethernut-3.9/nut/lib/  
/AVR/GMK/AVR/EtherNUT/ethernut-3.9/nut/lib//nutinit.o  -lnutnet -lnutpro 
-lnutfs -lnutos -lnutdev -lnutnet -lnutcrt -o lcd20.elf
.o(.text+0xb6): In function `__bad_interrupt':

../../../crt1/gcrt1.S:99: multiple definition of `__bad_interrupt'
/AVR/GMK/Developments/AVR/cdk4avr/bin/../lib/gcc-lib/avr/3.3.2/../../../../ \
avr/lib/avr5/crtm128.o(.text+0x0):../../../crt1/gcrt1.S:99: first defined here
.o(.text+0x0): In function `__vectors':
../../../crt1/gcrt1.S:44: multiple definition of `__vectors'

/AVR/GMK/Developments/AVR/cdk4avr/bin/../lib/gcc-lib/avr/3.3.2/../../../../ \
avr/lib/avr5/crtm128.o(.vectors+0x0):../../../crt1/gcrt1.S:99: first defined 
here
.o(.text+0x98): In function `__vectors':
../../../crt1/gcrt1.S:83: multiple definition of `__do_copy_data'
/AVR/GMK/Developments/AVR/cdk4avr/bin/../lib/gcc-lib/avr/3.3.2/../../../../ \
avr/lib/avr5/crtm128.o(.init4+0x0):../../../crt1/gcrt1.S:99: first defined 
here
make: *** [lcd20.elf] Error 1


Can anyone advise me on what I am doing wrong or have left'd out to fix this 
problem. I am ultimately trying to build up Nut/OS device drivers to keep 
each project source standardise.  I have the feeling this will probably lead 
me to generation a "HOWTO:  Develop & Use: Nut/OS Device Drivers" if
I am not carefull.


Thanks
----------------------------------------
Cheers. Grahame



More information about the En-Nut-Discussion mailing list