EmbDev.net

Forum: µC & Digital Electronics Transistor Tester Compiling Error


von Ronnie T. (ronnie_t) Flattr this


Rate this post
useful
not useful
Hi,

I tried compiling the source code for Transistor Tester which I found 
here:

http://www.mikrocontroller.net/articles/AVR-Transistortester

And got this error on AVR Studio.

"lcd-routines.c:114: undefined reference to `uart_putc'"



any suggestion will be appreciated..

von Boregard (Guest)


Rate this post
useful
not useful
which sources?

There are the old ones, which do not have UART at all, and you can 
download pre-configured for HW UART or Soft UART. In these the error 
should appear earlier than line 114, if at all.

So it does not help, you have to post your source here....

von Ronnie T. (ronnie_t) Flattr this


Rate this post
useful
not useful
The code I found here: 
http://viewvc.coremelt.net/viewvc/avr/semiconductor_tester/firmware/

Sorry but I can't attached the code directly here..too long..:(



when I try to compile I got this error:
1
Build started 8.2.2012 at 14:49:50
2
avr-gcc -mmcu=atmega8 -Wl,-Map=TransistorTestNew.map main.o lcd-routines.o     -o TransistorTestNew.elf
3
lcd-routines.o: In function `uart_newline':
4
D:\Desktop\tester\semiconductor_tester\firmware\default/../../../Latest/Sourcecode/lcd-routines.c:114: undefined reference to `uart_putc'
5
D:\Desktop\tester\semiconductor_tester\firmware\default/../../../Latest/Sourcecode/lcd-routines.c:115: undefined reference to `uart_putc'
6
lcd-routines.o: In function `lcd_data':
7
D:\Desktop\tester\semiconductor_tester\firmware\default/../../../Latest/Sourcecode/lcd-routines.c:32: undefined reference to `uart_putc'
8
make: *** [TransistorTestNew.elf] Error 1
9
Build failed with 3 errors and 0 warnings...


Did I missed something?


BR

von Boregard (Guest)


Rate this post
useful
not useful
Hi,

I do not use and know AVR-Studio...

But it does not use the Makefile, does it?
Because you do not link swuart.o, therefore it does not know the 
soft-uart functions.

Regards,
Boregard

von Ronnie T. (ronnie_t) Flattr this


Rate this post
useful
not useful
I found the MAKEFILE in the folder...

How did you compile yours? and what's the command?


Here is my MAKEFILE:
1
###############################################################################
2
# Makefile for the project TransistorTestNew
3
###############################################################################
4
5
## General Flags
6
PROJECT = TransistorTestNew
7
# available languages are: LANG_ENGLISH, LANG_GERMAN, LANG_POLISH, LANG_CZECH, LANG_SLOWAK
8
UI_LANGUAGE = LANG_ENGLISH
9
MCU = atmega8
10
TARGET = TransistorTestNew.elf
11
CC = avr-gcc
12
13
# programmer type
14
PROGRAMMER=jtag2isp
15
PORT=usb
16
17
CPP = avr-g++
18
19
## Options common to compile, link and assembly rules
20
COMMON = -mmcu=$(MCU)
21
22
## Compile options common for all C compilation units.
23
CFLAGS = $(COMMON)
24
CFLAGS += -Wall -gdwarf-2 -std=gnu99 -DF_CPU=1000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
25
CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d
26
27
## Assembly specific flags
28
ASMFLAGS = $(COMMON)
29
ASMFLAGS += $(CFLAGS)
30
ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2
31
32
## Linker flags
33
LDFLAGS = $(COMMON)
34
LDFLAGS +=  -Wl,-Map=TransistorTestNew.map
35
36
37
## Intel Hex file production flags
38
HEX_FLASH_FLAGS = -R .eeprom -R .fuse -R .lock -R .signature
39
40
HEX_EEPROM_FLAGS = -j .eeprom
41
HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load"
42
HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0 --no-change-warnings
43
44
45
## Objects that must be built in order to link
46
OBJECTS = main.o lcd-routines.o swuart.o
47
48
## Objects explicitly added by the user
49
LINKONLYOBJECTS = 
50
51
## Build
52
all: $(TARGET) TransistorTestNew.hex TransistorTestNew.eep TransistorTestNew.lss size
53
54
## Compile
55
main.o: ./main.c
56
  $(CC) $(INCLUDES) $(CFLAGS) -D$(UI_LANGUAGE) -c  $<
57
58
lcd-routines.o: ./lcd-routines.c
59
  $(CC) $(INCLUDES) $(CFLAGS) -c  $<
60
  
61
swuart.o: ./swuart.S
62
  $(CC) $(INCLUDES) $(CFLAGS) -c  $<
63
64
##Link
65
$(TARGET): $(OBJECTS)
66
   $(CC) $(LDFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET)
67
68
%.hex: $(TARGET)
69
  avr-objcopy -O ihex $(HEX_FLASH_FLAGS)  $< $@
70
71
%.eep: $(TARGET)
72
  -avr-objcopy $(HEX_EEPROM_FLAGS) -O ihex $< $@ || exit 0
73
74
%.lss: $(TARGET)
75
  avr-objdump -h -S $< > $@
76
77
size: ${TARGET}
78
  @echo
79
  @avr-size -C --mcu=${MCU} ${TARGET}
80
81
## Clean target
82
.PHONY: clean
83
clean:
84
  -rm -rf $(OBJECTS) TransistorTestNew.elf dep/* TransistorTestNew.hex TransistorTestNew.eep TransistorTestNew.lss TransistorTestNew.map
85
86
87
## Other dependencies
88
-include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*)
89
90
# device programming
91
fuses-m8:
92
  avrdude -c $(PROGRAMMER) -B 10.0 -p m8 -P $(PORT) -F -U lfuse:w:0x01:m -U hfuse:w:0xd9:m
93
94
fuses-m48:
95
  avrdude -c $(PROGRAMMER) -B 10.0 -p m8 -P $(PORT) -F -U lfuse:w:0x42:m -U hfuse:w:0xdc:m
96
97
upload:
98
  avrdude -c $(PROGRAMMER) -B 10.0 -p m8 -P $(PORT) -F -U flash:w:./TransistorTestNew.hex:a \
99
  -U eeprom:w:./TransistorTestNew.eep:a

von Boregard (Guest)


Rate this post
useful
not useful
Hi,

I am using Linux, and compile with the avr-gcc toolchain just running 
"make all".
But I build it ~ 2 years ago, with the "old" sources without UART.

But according to the Makefile it should still work with "make all" with 
the UART. Do not know ho to do that from AVR-Studio, since it does not 
run on Linux.

In the Makefile, $(TARGET) depends on $(OBJECTS), and $(OBJECTS) is:
1
## Objects that must be built in order to link
2
OBJECTS = main.o lcd-routines.o swuart.o
and swuart.o is build with rule:
1
swuart.o: ./swuart.S
2
  $(CC) $(INCLUDES) $(CFLAGS) -c  $<

Regards,
Boregard

von Ronnie T. (ronnie_t) Flattr this


Rate this post
useful
not useful
Thanks!

I'll update later..:-)

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.