View previous topic :: View next topic |
Author |
Message |
eramosipn
Joined: 02 Apr 2012 Posts: 1
|
Posted: Tue Apr 03, 2012 4:52 am Post subject: Compile error - Undefined symbol -- |
|
|
Hello, I have some troubles to compile the example helloworld, I got this error:
u8 PROGMEM t_Foo_en[] = "Hello World!";
void action_menu (void *data)
{
display_text_raw (t_Foo_en, Q_DISPLAY_TEXT_USER_CLEAR);
}
void turbo_handler (u8 action, void *data)
{
switch (action)
{
case ACTION_INSERT_MENU:
insert_menu (t_Foo_en);
break;
case ACTION_MENU_SELECTION:
stk_thread (action_menu, data);
break;
default:
break;
}
}
root@ubuntu:~/Bladox/turboprog/examples/helloworld2# make
avr-objdump --turbo-manifest "Version: 1.0.0 Vendor: ECOPROTEC" --turbo helloworld2.elf
Undefined symbol insert_menu
[color=red]Undefined symbol stk_thread
[color=red]Undefined symbol display_text_raw
[color=red]make: *** [helloworld2.trb] Error 1[/b]
I tried put the libs into the path, I reinstall everything binutils, gcc and i have the same results.
I don't know whats is the error, but if I compile the example helloword provide in the turbo-prog files I got succes compile:
u8 PROGMEM hello[] = "helloworld!";
void turbo_handler (u8 action, USB_Data * data)
{
switch (action)
{
case 0x80:
usb_send (NO_ERROR, sizeof (hello), hello);
default:
break;
}
}
Sucess compile
avr-objdump --turbo-manifest "Version: 2.0.0 Vendor: ECOPROTEC" --turbo helloworld.elf
Size PROGMEM: 32 RAM: 0
Eramos/ Ubuntu 11.10 |
|
Back to top |
|
|
pz
Joined: 12 Mar 2004 Posts: 1161
|
Posted: Wed Apr 04, 2012 12:20 pm Post subject: |
|
|
Why it's called helloworld2? Have you just copied the helloworld dir or have you done any changes?
All you need to change in the Makefile is the TURBO_DIR = ../somewhere/turbo-devel. What is this value and where do you have turbo-devel package installed? |
|
Back to top |
|
|
mA
Joined: 20 Apr 2013 Posts: 2
|
Posted: Sat Apr 20, 2013 11:52 am Post subject: |
|
|
I have exactly the same problem, but I named the file helloworld and replaced that with the helloworld which is in examples folder in turbo-prog. I set the TURBO_DIR := ../../../turbo-devel . Can anyone help me please! |
|
Back to top |
|
|
pz
Joined: 12 Mar 2004 Posts: 1161
|
Posted: Wed Apr 24, 2013 7:03 am Post subject: |
|
|
Are you trying to compile the helloworld example for Turbo SIM (TL2,...) or Turbo Programmer 2? Anyway just setting the right TURBO_DIR in the Makefile to point to the turbo-devel directory is/should be/must be enough. All the symbols are in the files located in this dir. How does your whole "make" output looks like? |
|
Back to top |
|
|
mA
Joined: 20 Apr 2013 Posts: 2
|
Posted: Wed Apr 24, 2013 5:31 pm Post subject: |
|
|
I have extracted turbo-prog-utils-3.2.3 and turbo-devel-1.5.16 in the same folder and have renamed that to turbo-devel.
My helleworld.c is in turbo-prog-utils3.2.3/examples/helloworld/hellowworld.c
and my Makefile:
Code: |
ifndef TPROG_DIR
TPROG_DIR = ../../
endif
ifndef TURBO_DIR
TURBO_DIR := ../../../turbo-devel
endif
TURBO_TAG = #--turbo-manifest "Version: 2.0.0 Vendor: BLADOX" #--turbo-verbose
INCDIR = -I$(TURBO_DIR)/include -I$(TPROG_DIR)/include -I.
LIBDIR = -L$(TURBO_DIR)/lib
CC = avr-gcc
LD = avr-ld
RM = rm -f
TRG = helloworld
SRC = helloworld.c
LIB =
CFLAGS = -std=gnu99 -mmcu=atmega128 -fno-jump-tables -Wimplicit-function-declaration -Os -fno-builtin
LDFLAGS = -L$(LIBDIR) -T $(TPROG_DIR)/lib/turbo.lds -d -r --emit-relocs -R $(TPROG_DIR)/lib/public_calls $(LIB) `avr-gcc -print-libgcc-file-name`
OBJ = $(SRC:.c=.o)
all: $(TRG).trb
include $(SRC:.c=.d)
%.o : %.c
$(CC) -c $(CFLAGS) $(INCDIR) $< -o $@
%.d: %.c
$(CC) -M $(CFLAGS) $(INCDIR) $< | sed 's/$*.o/& $@/g' >$@
$(TRG).elf: $(OBJ)
$(LD) -o $@ $(OBJ) $(LDFLAGS)
$(TRG).trb: $(TRG).elf
avr-objdump $(TURBO_TAG) --turbo $(TRG).elf
dis: $(TRG).elf
avr-objdump -D --architecture=avr:5 $(TRG).elf >$(TRG).dis
indent:
for X in $(SRC); do \
indent -npsl -sob -bad -bli0 -cli2 $$X; \
done
install: all
# cp $(TRG).trb ../../modules
clean:
$(RM) *.o
$(RM) *.d
$(RM) *~
$(RM) $(TRG).dis
$(RM) $(TRG).elf
$(RM) $(TRG).trb
|
and I got those errors which were mentioned. But then I changed my Makefile as below:
new Makefile:
Code: |
ifndef TURBO_DIR
TURBO_DIR = ../../../turbo-devel
endif
TURBO_TAG = --turbo-manifest "Version: 1.2.3 Vendor: BLADOX" #--turbo-verbose
INCDIR = -I$(TURBO_DIR)/include -I.
LIBDIR = $(TURBO_DIR)/lib
CC = avr-gcc
LD = avr-ld
RM = rm -f
TRG = helloworld
SRC = helloworld.c
LIB =
CFLAGS = -std=gnu99 -mmcu=atmega128 -fno-jump-tables -Wimplicit-function-declaration -Os -fno-builtin
LDFLAGS = -L$(LIBDIR) -T turbo.lds -d -r --emit-relocs -R $(LIBDIR)/public_calls $(LIB) -lm -lc `avr-gcc -print-libgcc-file-name`
OBJ = $(SRC:.c=.o)
all: $(TRG).trb
include $(SRC:.c=.d)
%.o : %.c
$(CC) -c $(CFLAGS) $(INCDIR) $< -o $@
%.d: %.c
$(CC) -M $(CFLAGS) $(INCDIR) $< | sed 's/$*.o/& $@/g' >$@
$(TRG).elf: $(OBJ)
$(LD) -o $@ $(OBJ) $(LDFLAGS)
$(TRG).trb: $(TRG).elf
avr-objdump $(TURBO_TAG) --turbo $(TRG).elf
dis: $(TRG).elf
avr-objdump -D --architecture=avr:5 $(TRG).elf >$(TRG).dis
install: all
cp $(TRG).trb ../bin
indent:
for X in *.[ch]; do \
indent -npsl -sob -bad -bli0 -cli2 $$X; \
done
clean:
$(RM) *.o
$(RM) *.d
$(RM) *.i
$(RM) *.s
$(RM) *~
$(RM) $(TRG).dis
$(RM) $(TRG).elf
$(RM) $(TRG).trb
|
and I could successfully produce helloworld.trb file. But at the end of making process, I found these two lines:
BFD: BFD 2.14 20030612 assertion fail elf32-avr.c:394
BFD: BFD 2.14 20030612 assertion fail elf32-avr.c:394
Size PROGMEM: 54 RAM: 0
Are these errors?
I uploaded helloworld.trb file on the Turbo Programmer with cemu in turbo-prog-utils , but when I insert Turbo Lite in my phone and I select the menu 'Hello World!;, sim resets and nothing will be displayed. |
|
Back to top |
|
|
|