cancel
Showing results for 
Search instead for 
Did you mean: 

creating a binary image file

stuart2399
Associate II
Posted on March 08, 2007 at 07:23

creating a binary image file

4 REPLIES 4
stuart2399
Associate II
Posted on March 06, 2007 at 07:29

Hi,

I'm to program my STR710 project (Hitop with GCC compiler & linker). To convert to a binary file, I'm using the objcopy exe utility (arm-elf-objcopy).

e.g. objcopy -O binary file.elf

Sector 0 of my code is protected (contains a bootloader). How do I avoid including this area of code in my binary file?

In other words how can you create a binary file over a limited address range using ObjCopy?

Please help! Thanks, Solartron

ben2
Associate II
Posted on March 07, 2007 at 05:07

Hi

Not sure if I understand your problem exactly, but a binary file is just that, it is down to the programming software to decide which sectors should be programmed. It(programming software) should allow you to specify an offset from the start of flash to program.

If it doesn't then perhaps you should try using motorla or intel hex file format that does specify and address. Assuming your program is linked to start at sector 1 the resultant hex file should be correct.

Ben

stuart2399
Associate II
Posted on March 08, 2007 at 05:18

Thanks, Ben.

Unfortunately, I can't use Intel HEX with the programmer I am using. Only binary is accepted.

What I am after is to create a binary file (from an ELF) at a specified address range (i.e. start & end address/length). I can't see how to do this with arm-elf-objcopy without hand editing.

Hope this clarifies my problem.

Thanks

ben2
Associate II
Posted on March 08, 2007 at 07:23

Ok I must be missing something obvious.

You have some code compiled and linked to start at say sector 1. Using objcopy to convert it to binary gives you a binary file. If you then need to program it from sector 1 or any other location it is the programming software that does this.

If your binary file includes the bootsector code (not sure why you would do this) and you wish to strip off the start/end you should be able to use the dd command assuming you are running either cygwin or linux.