PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : UART+FIFO - fertiges Beispiel aus m-c-net läuft nicht



oberallgeier
06.12.2012, 10:39
Hallo Alle,

ich weiß, dass Software kein Playmobil ist
dass ich s..schlecht in C bin
dass paste&copy bei Software problematisch ist.
Derzeit versuche ich in UART mit FIFO einzusteigen und arbeite verschiedene Beispiele durch.

Ein Beispiel macht Probleme, die mir leider unverständlich sind (PDannegger, mikrocontroller-net). (http://www.mikrocontroller.net/topic/101472) Die nackte 1:1-Kopie wirft Fehler aus. Target mega8, xtal 14.756e6, -Os, AVRSTudio 4.18 Build 700, WinXPpro.


Build started 6.12.2012 at 11:33:57
avr-gcc -mmcu=atmega8 -Wall -gdwarf-2 -Os -std=gnu99 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT main.o -MF dep/main.o.d -c ../main.c
avr-gcc -mmcu=atmega8 -Wl,-Map=main.map main.o -o main.elf
main.o: In function `main':
D:\D_pro-fils\compu+MC\C3\main\default/../main.c:22: undefined reference to `init_uart0'
D:\D_pro-fils\compu+MC\C3\main\default/../main.c:25: undefined reference to `uputs0_'
D:\D_pro-fils\compu+MC\C3\main\default/../main.c:26: undefined reference to `uputs0_'
D:\D_pro-fils\compu+MC\C3\main\default/../main.c:29: undefined reference to `ukbhit0'
D:\D_pro-fils\compu+MC\C3\main\default/../main.c:35: undefined reference to `ugetchar0'
D:\D_pro-fils\compu+MC\C3\main\default/../main.c:35: undefined reference to `uputchar0'
D:\D_pro-fils\compu+MC\C3\main\default/../main.c:36: undefined reference to `utx0_ready'
D:\D_pro-fils\compu+MC\C3\main\default/../main.c:37: undefined reference to `ukbhit0'
D:\D_pro-fils\compu+MC\C3\main\default/../main.c:40: undefined reference to `uputchar0'
D:\D_pro-fils\compu+MC\C3\main\default/../main.c:42: undefined reference to `ugetchar0'
D:\D_pro-fils\compu+MC\C3\main\default/../main.c:42: undefined reference to `uputchar0'
D:\D_pro-fils\compu+MC\C3\main\default/../main.c:43: undefined reference to `ukbhit0'
D:\D_pro-fils\compu+MC\C3\main\default/../main.c:45: undefined reference to `ukbhit0'
D:\D_pro-fils\compu+MC\C3\main\default/../main.c:46: undefined reference to `uputchar0'
D:\D_pro-fils\compu+MC\C3\main\default/../main.c:47: undefined reference to `uputchar0'
make: *** [main.elf] Error 1
Build failed with 15 errors and 0 warnings...

Es sind aber die beanstandeten references doch im Subdirectory, includiert . . . ich blicks einfach wieder mal nicht. Das aktueller directory enthält:
main.c
uart0.c
uart0.h
main.h
mydefs.h

Würde mir bitte jemand helfen?

sast
06.12.2012, 13:24
Ich rate mal, im makefile fehlt uarth0.c

sast

oberallgeier
06.12.2012, 17:02
Ich rate mal, im makefile fehlt uarth0.c ...Richtig geraten! Bahhhh - trotzdem ist das fies: a) vermutlich stehts beim Autor im Makefile. b) Ich arbeite mit dem Studio4 (s.o.) - das sich seinen "eigenen" Makefile macht. c) Normalerweise weiß ich, dass ich bei solchen Störungen bei Copyware ein *.c nachtragen muss - wegen b). d) ich habs einfach vergessen/übersehen/gedankenlos ... egal.

Es läuft! Danke sehr, sast.