EmbDev.net

Forum: ARM programming with GCC/GNU tools Eclipse problem


von Borut K. (bkastel1)


Rate this post
useful
not useful
Hello to all,

I have a question. I'm trying to use Eclipse for developing SW for
LPC2148 and I downloaded IDE from Yagarto web site. I also downloaded
example for LPC2148 and followed the How-to in Yagarto web site. When I
tried to build the project I get the following error:

fatal error: opening dependency file .dep/main.o.d: No such file or
directory  LPC2148Test/src  main.c  line 85  1188912961343  3

Can anyone help me?

Thank you all.

von Martin T. (mthomas) (Moderator)


Rate this post
useful
not useful
Borut Kastelic wrote:
> I have a question. I'm trying to use Eclipse for developing SW for
> LPC2148 and I downloaded IDE from Yagarto web site. I also downloaded
> example for LPC2148 and followed the How-to in Yagarto web site. When I
> tried to build the project I get the following error:
>
> fatal error: opening dependency file .dep/main.o.d: No such file or
> directory  LPC2148Test/src  main.c  line 85  1188912961343  3

Is a makefile included in the example? Does the error show up if you
build outside eclipse (make all from command-shell)? If this does not
work either please paste the makefile here.

Martin Thomas

von Borut K. (bkastel1)


Rate this post
useful
not useful
I have a makefile included - below is the list of it. I haven't tried to
build up the project outside eclipse because i thought it should work
from eclipse and also I haven't worked with GNU tools a lot and I'm
still learning.

Thank you for your time.

######################################################################## 
######################
#
#       !!!! Do NOT edit this makefile with an editor which replace tabs
by spaces !!!!
#
######################################################################## 
######################
#
# On command line:
#
# make all = Create project
#
# make clean = Clean project files.
#
# To rebuild project do "make clean" and "make all".
#

######################################################################## 
######################
# Start of default section
#

TRGT = arm-elf-
CC   = $(TRGT)gcc
CP   = $(TRGT)objcopy
AS   = $(TRGT)gcc -x assembler-with-cpp
BIN  = $(CP) -O ihex

MCU  = arm7tdmi

# List all default C defines here, like -D_DEBUG=1
DDEFS =

# List all default ASM defines here, like -D_DEBUG=1
DADEFS =

# List all default directories to look for include files here
DINCDIR =

# List the default directory to look for the libraries here
DLIBDIR =

# List all default libraries here
DLIBS =

#
# End of default section
######################################################################## 
######################

######################################################################## 
######################
# Start of user section
#

# Define project name here
PROJECT = test

# Define linker script file here
LDSCRIPT= ./prj/lpc2148_ram.ld

# List all user C define here, like -D_DEBUG=1
UDEFS =

# Define ASM defines here
UADEFS =

# List C source files here
SRC  = ./src/main.c

# List ASM source files here
ASRC = ./src/crt.s

# List all user directories here
UINCDIR = ./inc

# List the user directory to look for the libraries here
ULIBDIR =

# List all user libraries here
ULIBS =

# Define optimisation level here
OPT = -O0

#
# End of user defines
######################################################################## 
######################


INCDIR  = $(patsubst %,-I%,$(DINCDIR) $(UINCDIR))
LIBDIR  = $(patsubst %,-L%,$(DLIBDIR) $(ULIBDIR))
DEFS    = $(DDEFS) $(UDEFS)
ADEFS   = $(DADEFS) $(UADEFS)
OBJS    = $(ASRC:.s=.o) $(SRC:.c=.o)
LIBS    = $(DLIBS) $(ULIBS)
MCFLAGS = -mcpu=$(MCU)

ASFLAGS = $(MCFLAGS) -g -gdwarf-2 -Wa,-amhls=$(<:.s=.lst) $(ADEFS)
CPFLAGS = $(MCFLAGS) $(OPT) -gdwarf-2 -mthumb-interwork
-fomit-frame-pointer -Wall -Wstrict-prototypes -fverbose-asm
-Wa,-ahlms=$(<:.c=.lst) $(DEFS)
LDFLAGS = $(MCFLAGS) -nostartfiles -T$(LDSCRIPT)
-Wl,-Map=$(PROJECT).map,--cref,--no-warn-mismatch $(LIBDIR)

# Generate dependency information
CPFLAGS += -MD -MP -MF .dep/$(@F).d

#
# makefile rules
#

all: $(OBJS) $(PROJECT).elf $(PROJECT).hex

%o : %c
  $(CC) -c $(CPFLAGS) -I . $(INCDIR) $< -o $@

%o : %s
  $(AS) -c $(ASFLAGS) $< -o $@

%elf: $(OBJS)
  $(CC) $(OBJS) $(LDFLAGS) $(LIBS) -o $@

%hex: %elf
  $(BIN) $< $@

clean:
  -rm -f $(OBJS)
  -rm -f $(PROJECT).elf
  -rm -f $(PROJECT).map
  -rm -f $(PROJECT).hex
  -rm -f $(SRC:.c=.c.bak)
  -rm -f $(SRC:.c=.lst)
  -rm -f $(ASRC:.s=.s.bak)
  -rm -f $(ASRC:.s=.lst)
  -rm -fR .dep

#
# Include the dependency files, should be the last of the makefile
#
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)

# *** EOF ***

von Borut K. (bkastel1)


Rate this post
useful
not useful
I tried to run make all in my project folder and besides warning on
missing /tmp everything went ok. So why can't i do this from Eclipse?

von Martin T. (mthomas) (Moderator)


Rate this post
useful
not useful
Please retry with eclipse after replacing
-rm -fR .dep
with
-rm -f .dep/*

Martin Thomas

von Borut K. (bkastel1)


Rate this post
useful
not useful
Martin Thomas wrote:
> Please retry with eclipse after replacing
> -rm -fR .dep
> with
> -rm -f .dep/*
>
> Martin Thomas

It works! Can you explain me wat was wrong? And just what is that waring
about missing /tmp?

Thank you again Martin.

von Martin T. (mthomas) (Moderator)


Rate this post
useful
not useful
Borut Kastelic wrote:
> Martin Thomas wrote:
>> Please retry with eclipse after replacing
>> -rm -fR .dep
>> with
>> -rm -f .dep/*
>>
>> Martin Thomas
>
> It works! Can you explain me wat was wrong?
I don't know the exact reason. It seems to be some kind of
"race-condition" or "locking" when a directory gets removed (during make
clean) and an attempt to recreated it (during make all) follows quickly
after the deletion. If you wait a short time between make clean and make
all the directory gets created as expected. But it seems Eclipse does
not wait or even just does a single make clean all. Since the above
modification does not delete the directory-entry itself but just the
files in the directory the issue does not occur any more. Maybe newer
versions of GNU-make built for Win32 are aware of this, but I have not
tested myself.

> And just what is that waring
> about missing /tmp?
Hmm, do you have the enviroment-variables TMP and TEMP set? Usualy
Windows NT/2k/XP set them to %USERPROFILE%/Local Settings/Temp. Check
your Eclipse-settingss if there are options that deal with
environment-variables.

Martin Thomas

von Borut K. (bkastel1)


Rate this post
useful
not useful
Thank you Martin for all your help. I appreciate it.

von Borut K. (bkastel1)


Rate this post
useful
not useful
Martin,

again with a problem. I installed the new version of Yagarto and when I
try to compile the LPC2148 test project I get this error (I also tried
the freeRTOS LPC2368 Eclipse demo and I get the same error):

**** Build of configuration Default for project LPC2148Test ****

make all
arm-elf-gcc -x assembler-with-cpp -c -mcpu=arm7tdmi -g -gdwarf-2
-Wa,-amhls=src/crt.lst   src/crt.s -o src/crt.o
arm-elf-gcc: CreateProcess: No such file or directory
make: *** [src/crt.o] Error 1

I'm I missing a path variable or? I also tried to run make all from cmd
line and i got the same error. Please help. I'm lost again :)

Regards,

Borut

von Martin T. (mthomas) (Moderator)


Rate this post
useful
not useful
Borut Kastelic wrote:
> Martin,
> ...

Sorry, I just have played with Eclipse a little bit and do not relay use
it. Maybe Michael Fischer can jump in here or you may ask him directly
by e-mail.

von Karunanithy M. (karun)


Rate this post
useful
not useful
Martin Thomas wrote:
> Please retry with eclipse after replacing
> -rm -fR .dep
> with
> -rm -f .dep/*
>
> Martin Thomas

Hai,

Even i modified the above i have facing the same problem.

make -k all
arm-elf-gcc -x assembler-with-cpp -c -mcpu=arm7tdmi -g -gdwarf-2
-Wa,-amhls=src/crt.lst   src/crt.s -o src/crt.o
arm-elf-gcc -c -mcpu=arm7tdmi -O0 -gdwarf-2 -mthumb-interwork
-fomit-frame-pointer -Wall -Wstrict-prototypes -fverbose-asm
-Wa,-ahlms=src/main.lst   -MD -MP -MF .dep/main.o.d -I . -I./inc
src/main.c -o src/main.o
src/main.c:86: fatal error: opening dependency file .dep/main.o.d: No
such file or directory
compilation terminated.
make: *** [src/main.o] Error 1
make: Target `all' not remade because of errors.

Could you please help me to solve this problem. I am using yagarto
eclipse platform

von Zeeshan Khan (Guest)


Rate this post
useful
not useful
Martin Thomas wrote:
> Borut Kastelic wrote:
>> Martin,
>> ...
>
> Sorry, I just have played with Eclipse a little bit and do not relay use
> it. Maybe Michael Fischer can jump in here or you may ask him directly
> by e-mail.

another problem that i am facing is as follows:

I follow the tutorial given at :
http://www2.amontec.com/sdk4arm/ext/jlynch-tutorial-20061124.pdf

but when i Build All the project, i get the following messages


**** Rebuild of configuration Debug for project
demo_at91sam7_blink_flash ****

**** Internal Builder is used for build               ****
gcc -O0 -g3 -Wall -c -fmessage-length=0 -oisrsupport.o ..\isrsupport.c
C:\DOKUME~1\zeeshan\LOKALE~1\Temp/ccsNaaaa.s: Assembler messages:
C:\DOKUME~1\zeeshan\LOKALE~1\Temp/ccsNaaaa.s:71: Error: no such
instruction: `msr cpsr,%eax'
C:\DOKUME~1\zeeshan\LOKALE~1\Temp/ccsNaaaa.s:90: Error: no such
instruction: `mrs %eax,cpsr'
Build error occurred, build is stopped
Time consumed: 62  ms



any help will be highly appreciated...

von Martin T. (mthomas) (Moderator)


Rate this post
useful
not useful
Zeeshan Khan wrote:
> gcc -O0 -g3 -Wall -c -fmessage-length=0 -oisrsupport.o ..\isrsupport.c
I don't know the Amontec package but are you sure that "gcc" is the
frontend of the cross-compiler? Usually the binary's name is something
like arm-*-gcc.

von Zeeshan Khan (Guest)


Rate this post
useful
not useful
Martin Thomas wrote:
> Borut Kastelic wrote:
>> Martin,
>> ...
>
> Sorry, I just have played with Eclipse a little bit and do not relay use
> it. Maybe Michael Fischer can jump in here or you may ask him directly
> by e-mail.

I am trying to build C (and assembly) applications debugging setup on
Atmel using SAM7EX256 development board.
I can successfully load and ebug the example application provided for
testing on:
http://www.yagarto.de/howto/yagarto1/index.html
though i run the openOCD from command prompt and the application
debugging from Eclipse environment.

However, since I am new to these applications and tools, hence for
debugging other applications, i need to clear out some confusions:

just for reminder: The example application generates and elf file and
uses the command file (.cfg file) to communicate over JTAG.

now questions:
1. Is and elf file necessary for debugging by OpenOCD and GDB, or a file
of other format, generated from the .c file can be used for debugging.
If yes, which file formats (J. Lynch´s manual suggests .out file, but it
doesnt work)... and do we need to make any changes to the .cfg file or
the initial commands in the Eclipse debug environment.
The errors I have encountered till now while debugging include "Symbols
not found", "cannot find bounds of current function", "Error while
execution" and may be others which I cant remember exactly.

2. Any guidance on setting up first break point. The command 'break
main' in the .cfg file doesnt seem to work with applications other than
the example application (including those having a C file with main()
subroutine.)

Thanks in advance.

von Martin T. (mthomas) (Moderator)


Rate this post
useful
not useful
Zeeshan Khan wrote:
> Martin Thomas wrote:
>> Borut Kastelic wrote:
>>> Martin,
>>> ...
>>
>> Sorry, I just have played with Eclipse a little bit and do not relay use
>> it. Maybe Michael Fischer can jump in here or you may ask him directly
>> by e-mail.
>
> I am trying to build C (and assembly) applications debugging setup on
> Atmel using SAM7EX256 development board.
> I can successfully load and ebug the example application provided for
> testing on:
> http://www.yagarto.de/howto/yagarto1/index.html
> though i run the openOCD from command prompt and the application
> debugging from Eclipse environment.
>
> However, since I am new to these applications and tools, hence for
> debugging other applications, i need to clear out some confusions:
>
> just for reminder: The example application generates and elf file
the linker creates an elf-file

>and uses the command file (.cfg file) to communicate over JTAG.
You may mean the config-file for OpenOCD. This does not "communicate
over JTAG". It's OpenOCD that does the communication though a
JTAG-interface.

> now questions:
> 1. Is and elf file necessary for debugging by OpenOCD and GDB, or a file
> of other format, generated from the .c file can be used for debugging.
> If yes, which file formats (J. Lynch´s manual suggests .out file, but it
> doesnt work)...
The .elf as file extension is optional. You can use any other extension
but elf is usual. I do not remember J. Lynch's tutorial know but maybe
he just uses the file extension .out and the file itself is still in
elf-format. Check the command-line for linking in the makefile or the
IDE-settings.

> and do we need to make any changes to the .cfg file or
> the initial commands in the Eclipse debug environment.
Usually there are not changes needed in the OpenOCD config-file.
Project-specific tasks can be controlled by the gdb-client (Eclipse) and
passed to the gdb-server (OpenOCD).

> The errors I have encountered till now while debugging include "Symbols
> not found", "cannot find bounds of current function", "Error while
> execution" and may be others which I cant remember exactly.
Did you use a debug-option (-g...)?

> 2. Any guidance on setting up first break point. The command 'break
> main' in the .cfg file doesnt seem to work with applications other than
> the example application (including those having a C file with main()
> subroutine.)
breakpoints can be set by the gdb-client. Check the Eclipse hardware
debugging plugin or Zylin plugin settings.

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.