Discussion:
From elf to axf
D***@infineon.com
2005-08-10 13:37:07 UTC
Permalink
Hi all,
I'm writing a minimal boot-loader to run Linux on an arm based board.
Does anyone know how to convert an ELF file (compiled with the arm cross
compiled gcc) to the AXF (Arm ExecutableFormat).
Thanks a lot
Greetings
thomas

-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ: http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette: http://www.arm.linux.org.uk/mailinglists/etiquette.php
Robert Schwebel
2005-08-10 14:14:16 UTC
Permalink
Post by D***@infineon.com
I'm writing a minimal boot-loader to run Linux on an arm based board.
Why don't you use one of the existing boot loaders?
Post by D***@infineon.com
Does anyone know how to convert an ELF file (compiled with the arm cross
compiled gcc) to the AXF (Arm ExecutableFormat).
Are you sure you need this? U-Boot for example uses a normal ARM gcc
toolchain to build the bootloader, so why should there be a need to use
something different?

Robert
--
Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
Pengutronix - Linux Solutions for Science and Industry
Handelsregister: Amtsgericht Hildesheim, HRA 2686
Hannoversche Str. 2, 31134 Hildesheim, Germany
Phone: +49-5121-206917-0 | Fax: +49-5121-206917-9


-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ: http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette: http://www.arm.linux.org.uk/mailinglists/etiquette.php
Andreas Schweigstill
2005-08-10 14:25:01 UTC
Permalink
Dear Thomas!
Post by D***@infineon.com
I'm writing a minimal boot-loader to run Linux on an arm based board.
Does anyone know how to convert an ELF file (compiled with the arm cross
compiled gcc) to the AXF (Arm ExecutableFormat).
cp myfile.elf myfile.axf

ELF and AXF are the same; you probably mean AIF (ARM image format).

To convert ELF files to plain binary files you can use the objcopy
tool from your target's binutils. Using ARM ADS or SDT the appropriate
program is fromelf.

Regards
Andreas Schweigstill
--
Dipl.-Phys. Andreas Schweigstill
Schweigstill IT | Embedded Systems
Schauenburgerstraße 116, D-24118 Kiel, Germany
Phone: (+49) 431 5606-435, Fax: (+49) 431 5606-436
Mobile: (+49) 171 6921973, Web: http://www.schweigstill.de/

-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ: http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette: http://www.arm.linux.org.uk/mailinglists/etiquette.php
D***@infineon.com
2005-08-10 14:56:56 UTC
Permalink
Are you sure ELF and AXF are the same? I'm not.
Can I use a plain binary as a boot-loader?
I'm not sure either.
What options should I pass to fromelf in order to get an axf properly generated?

Thanks
Regards
thomas


-----Original Message-----
From: Andreas Schweigstill [mailto:***@schweigstill.de]
Sent: 10 August 2005 16:25
To: linux-***@lists.arm.linux.org.uk
Cc: Dupas Thomas (IFF COM CV External)
Subject: Re: From elf to axf


Dear Thomas!
Post by D***@infineon.com
I'm writing a minimal boot-loader to run Linux on an arm based board.
Does anyone know how to convert an ELF file (compiled with the arm
cross compiled gcc) to the AXF (Arm ExecutableFormat).
cp myfile.elf myfile.axf

ELF and AXF are the same; you probably mean AIF (ARM image format).

To convert ELF files to plain binary files you can use the objcopy tool from your target's binutils. Using ARM ADS or SDT the appropriate program is fromelf.

Regards
Andreas Schweigstill
--
Dipl.-Phys. Andreas Schweigstill
Schweigstill IT | Embedded Systems
Schauenburgerstraße 116, D-24118 Kiel, Germany
Phone: (+49) 431 5606-435, Fax: (+49) 431 5606-436
Mobile: (+49) 171 6921973, Web: http://www.schweigstill.de/

-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ: http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette: http://www.arm.linux.org.uk/mailinglists/etiquette.php
Catalin Marinas
2005-08-10 15:39:38 UTC
Permalink
Post by D***@infineon.com
Are you sure ELF and AXF are the same? I'm not.
Can I use a plain binary as a boot-loader?
I'm not sure either.
What options should I pass to fromelf in order to get an axf
properly generated?
If you do a search for ELF, AXF and ARM you get the first link:
http://www.epitools.com/support/jeeni_other.php#differences

Anyway, with the recent toolchains from ARM, AXF is the same as
ELF. There might be some slight differences but the latest ARM EABI
refers to the ELF structure as well.

What problems are you seeing with the ELF file? I always wrote the ELF
file into flash using the ARM's boot monitor (which accepts AXF
images).
--
Catalin


-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ: http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette: http://www.arm.linux.org.uk/mailinglists/etiquette.php
D***@infineon.com
2005-08-10 15:46:38 UTC
Permalink
When I try writing directly the ELF to flash And then run it I get the error message:
Flash error, image checksum failure.
though there is no error or warning when my file is compiled.
Is there any mean available to verify wether I have really generated an ELF or not.
thanks.
bye
thomas

________________________________

From: Catalin Marinas [mailto:***@arm.com]
Sent: Wed 10/08/2005 17:39
To: Dupas Thomas (IFF COM CV External)
Cc: ***@schweigstill.de; linux-***@lists.arm.linux.org.uk
Subject: Re: From elf to axf
Post by D***@infineon.com
Are you sure ELF and AXF are the same? I'm not.
Can I use a plain binary as a boot-loader?
I'm not sure either.
What options should I pass to fromelf in order to get an axf
properly generated?
If you do a search for ELF, AXF and ARM you get the first link:
http://www.epitools.com/support/jeeni_other.php#differences

Anyway, with the recent toolchains from ARM, AXF is the same as
ELF. There might be some slight differences but the latest ARM EABI
refers to the ELF structure as well.

What problems are you seeing with the ELF file? I always wrote the ELF
file into flash using the ARM's boot monitor (which accepts AXF
images).

--
Catalin


-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ: http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette: http://www.arm.linux.org.uk/mailinglists/etiquette.php
Catalin Marinas
2005-08-10 16:00:34 UTC
Permalink
Post by D***@infineon.com
When I try writing directly the ELF to flash And then run it I get
the error message: Flash error, image checksum failure. though
there is no error or warning when my file is compiled. Is there any
mean available to verify wether I have really generated an ELF or
not. thanks. bye thomas
The readelf tool should tell you the details of the ELF file.

You might also be able to write a binary image converted with objcopy
but you might need to tell your boot monitor where the entry point
is.

Also make sure that the flash is not broken.
--
Catalin


-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ: http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette: http://www.arm.linux.org.uk/mailinglists/etiquette.php
D***@infineon.com
2005-08-10 16:29:17 UTC
Permalink
Unfortunately converting ELF files to binary as revealed being no use.
I got exactly the same error although I have specified the entry_point parameter obtained thanks to readelf (and the friendly help of Catalin).
thomas

________________________________

From: Catalin Marinas [mailto:***@arm.com]
Sent: Wed 10/08/2005 18:00
To: Dupas Thomas (IFF COM CV External)
Cc: ***@schweigstill.de; linux-***@lists.arm.linux.org.uk
Subject: Re: From elf to axf
Post by D***@infineon.com
When I try writing directly the ELF to flash And then run it I get
the error message: Flash error, image checksum failure. though
there is no error or warning when my file is compiled. Is there any
mean available to verify wether I have really generated an ELF or
not. thanks. bye thomas
The readelf tool should tell you the details of the ELF file.

You might also be able to write a binary image converted with objcopy
but you might need to tell your boot monitor where the entry point
is.

Also make sure that the flash is not broken.

--
Catalin


-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ: http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette: http://www.arm.linux.org.uk/mailinglists/etiquette.php
Andreas Schweigstill
2005-08-11 08:16:22 UTC
Permalink
Dear Thomas!
Post by D***@infineon.com
Unfortunately converting ELF files to binary as revealed being no use.
I got exactly the same error although I have specified the entry_point
parameter obtained thanks to readelf (and the friendly help of Catalin).
I think you really should _understand_ how the different strategies for
starting a program work. You have to keep in mind that there is a
distinction between load and execution addresses which have to be
properly adjusted. Without aid of a JTAG debugger it will be nearly
impossible to solve any problems concerning program start-up when you
are building your own bootloader. I really recommend the TRACE32 ICD
from Lauterbach for such purposes. As a low-cost solution also the
Macraigor Wiggler with the Rowley Associates IDE is quite usable. Using
a plain GDB is not exactly the easiest entrance to JTAG debugging.

With best regards
Andreas Schweigstill
--
Dipl.-Phys. Andreas Schweigstill
Schweigstill IT | Embedded Systems
Schauenburgerstraße 116, D-24118 Kiel, Germany
Phone: (+49) 431 5606-435, Fax: (+49) 431 5606-436
Mobile: (+49) 171 6921973, Web: http://www.schweigstill.de/

-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ: http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette: http://www.arm.linux.org.uk/mailinglists/etiquette.php
Loading...