Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Download an ELF file to flash? Is it executable? (SAM7X)
PostPosted: Sun Jan 03, 2010 7:59 pm 
Offline

Joined: Wed Dec 16, 2009 8:23 pm
Posts: 9
I'm using a SAM7X micro-controller and need to download the binary file to the flash.

Until now I've done this with my IDE (EDGE) while I was in debug mode.
Now, I want to download the binary to the flash using the SAM-BA software, because that my IDE gives me a not descriptive error when I try to run the program.

An ELF file gets created as a result of a project build.
Do I need to download the ELF file to the flash,
or convert the ELF to EXE and then download the EXE to the flash?

Thank you :)


Top
 Profile  
 
 Post subject: Re: Download an ELF file to flash? Is it executable? (SAM7X)
PostPosted: Sun Jan 03, 2010 9:34 pm 
Offline

Joined: Sun Jan 03, 2010 5:18 pm
Posts: 22
Hello, if i am right, you have to convert it to exe.
I am still trying to make sense of the makefile and all it's commands.

I found some information here.

http://en.wikipedia.org/wiki/Executable_and_Linkable_Format

This what is written in the make file i use :

Code:

RAM: $(OBJS) $(PROJECT)_ram.elf $(PROJECT)_ram.hex

ROM: $(OBJS) $(PROJECT)_rom.elf $(PROJECT)_rom.hex

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

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

%ram.elf: $(OBJS)
   $(CC) $(OBJS) $(LDFLAGS_RAM) $(LIBS) -o $@

%rom.elf: $(OBJS)
   $(CC) $(OBJS) $(LDFLAGS_ROM) $(LIBS) -o $@

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


If you want the complete makefile , i can post it if you want.


Top
 Profile  
 
 Post subject: Re: Download an ELF file to flash? Is it executable? (SAM7X)
PostPosted: Thu Jan 07, 2010 9:32 pm 
Offline

Joined: Sat Feb 02, 2008 11:35 pm
Posts: 15
Location: USA
extract your binary from ELF:

objcopy -O binary yourfile.elf yourfile.bin

and that would be "arm-elf-objcopy" for gnu arm.

gd


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: