EmbDev.net

Forum: µC & Digital Electronics Transistor Tester Compiling Error


Author: Ronnie Tabanao (ronnie_t) Flattr this
Posted on:

Rate this post
0 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..

Author: Boregard (Guest)
Posted on:

Rate this post
0 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....

Author: Ronnie Tabanao (ronnie_t) Flattr this
Posted on:

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

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



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


Did I missed something?


BR

Author: Boregard (Guest)
Posted on:

Rate this post
0 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

Author: Ronnie Tabanao (ronnie_t) Flattr this
Posted on:

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

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


Here is my MAKEFILE:
###############################################################################
# Makefile for the project TransistorTestNew
###############################################################################

## General Flags
PROJECT = TransistorTestNew
# available languages are: LANG_ENGLISH, LANG_GERMAN, LANG_POLISH, LANG_CZECH, LANG_SLOWAK
UI_LANGUAGE = LANG_ENGLISH
MCU = atmega8
TARGET = TransistorTestNew.elf
CC = avr-gcc

# programmer type
PROGRAMMER=jtag2isp
PORT=usb

CPP = avr-g++

## Options common to compile, link and assembly rules
COMMON = -mmcu=$(MCU)

## Compile options common for all C compilation units.
CFLAGS = $(COMMON)
CFLAGS += -Wall -gdwarf-2 -std=gnu99 -DF_CPU=1000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d

## Assembly specific flags
ASMFLAGS = $(COMMON)
ASMFLAGS += $(CFLAGS)
ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2

## Linker flags
LDFLAGS = $(COMMON)
LDFLAGS +=  -Wl,-Map=TransistorTestNew.map


## Intel Hex file production flags
HEX_FLASH_FLAGS = -R .eeprom -R .fuse -R .lock -R .signature

HEX_EEPROM_FLAGS = -j .eeprom
HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load"
HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0 --no-change-warnings


## Objects that must be built in order to link
OBJECTS = main.o lcd-routines.o swuart.o

## Objects explicitly added by the user
LINKONLYOBJECTS = 

## Build
all: $(TARGET) TransistorTestNew.hex TransistorTestNew.eep TransistorTestNew.lss size

## Compile
main.o: ./main.c
  $(CC) $(INCLUDES) $(CFLAGS) -D$(UI_LANGUAGE) -c  $<

lcd-routines.o: ./lcd-routines.c
  $(CC) $(INCLUDES) $(CFLAGS) -c  $<
  
swuart.o: ./swuart.S
  $(CC) $(INCLUDES) $(CFLAGS) -c  $<

##Link
$(TARGET): $(OBJECTS)
   $(CC) $(LDFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET)

%.hex: $(TARGET)
  avr-objcopy -O ihex $(HEX_FLASH_FLAGS)  $< $@

%.eep: $(TARGET)
  -avr-objcopy $(HEX_EEPROM_FLAGS) -O ihex $< $@ || exit 0

%.lss: $(TARGET)
  avr-objdump -h -S $< > $@

size: ${TARGET}
  @echo
  @avr-size -C --mcu=${MCU} ${TARGET}

## Clean target
.PHONY: clean
clean:
  -rm -rf $(OBJECTS) TransistorTestNew.elf dep/* TransistorTestNew.hex TransistorTestNew.eep TransistorTestNew.lss TransistorTestNew.map


## Other dependencies
-include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*)

# device programming
fuses-m8:
  avrdude -c $(PROGRAMMER) -B 10.0 -p m8 -P $(PORT) -F -U lfuse:w:0x01:m -U hfuse:w:0xd9:m

fuses-m48:
  avrdude -c $(PROGRAMMER) -B 10.0 -p m8 -P $(PORT) -F -U lfuse:w:0x42:m -U hfuse:w:0xdc:m

upload:
  avrdude -c $(PROGRAMMER) -B 10.0 -p m8 -P $(PORT) -F -U flash:w:./TransistorTestNew.hex:a \
  -U eeprom:w:./TransistorTestNew.eep:a

Author: Boregard (Guest)
Posted on:

Rate this post
0 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:
## Objects that must be built in order to link
OBJECTS = main.o lcd-routines.o swuart.o
and swuart.o is build with rule:
swuart.o: ./swuart.S
  $(CC) $(INCLUDES) $(CFLAGS) -c  $<

Regards,
Boregard

Author: Ronnie Tabanao (ronnie_t) Flattr this
Posted on:

Rate this post
0 useful
not useful
Thanks!

I'll update later..:-)

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.