converting elf to binary - VxWorks

This is a discussion on converting elf to binary - VxWorks ; Hi, I am running into problems trying to convert an existing elf format vxworks.st to a compressed binary image. I am using PPC(Artesyn), Vxworks 5.5 and PPCBoot. Here is what I am doing: objcopyppc -O binary vxWorks.st vxWorks.bin gzip -9 ...

+ Reply to Thread
Results 1 to 9 of 9

Thread: converting elf to binary

  1. converting elf to binary

    Hi,
    I am running into problems trying to convert an existing elf format
    vxworks.st to a compressed binary image. I am using PPC(Artesyn),
    Vxworks 5.5 and PPCBoot. Here is what I am doing:

    objcopyppc -O binary vxWorks.st vxWorks.bin
    gzip -9 vxWorks.bin
    mkimage -A ppc -C gzip -O VxWorks -n "VxWorks" -a 0x800000 -e 0x800000
    -d vxWorks.bin.gz vxWorks.img

    The PPCBoot displays the right header info, CRC check is fine and
    uncompresses it fine. But it hangs when trying to boot the
    uncompressed image:

    ## Booting image at 00400000 ...
    Image Name: VxWorks
    Image Type: PowerPC VxWorks Kernel Image (gzip compressed)
    Data Size: 517225 Bytes = 505 kB = 0 MB
    Load Address: 00800000
    Entry Point: 00800000
    Verifying Checksum ... OK
    Uncompressing Kernel Image ... OK
    ## Ethernet MAC address not copied to NV RAM
    ## No elf image at address 0x00800000
    ## Not an ELF image, assuming binary
    ## Using bootline (@ 0x4200): ip=auto
    ## Starting vxWorks at 0x00800000 ...

    I have tried elfToBin instead of objcopyppc and it doesnt work either.
    I am wondering what I am missing here.

    Thanks for your help!

    Jay

  2. Re: converting elf to binary

    On May 23, 8:39*pm, jjaya...@gmail.com wrote:
    > Hi,
    > I am running into problems trying to convert an existing elf format
    > vxworks.st to a compressed binary image. I am using PPC(Artesyn),
    > Vxworks 5.5 and PPCBoot. Here is what I am doing:
    >
    > objcopyppc -O binary vxWorks.st vxWorks.bin
    > gzip -9 vxWorks.bin
    > mkimage -A ppc -C gzip -O VxWorks -n "VxWorks" -a 0x800000 -e 0x800000
    > -d vxWorks.bin.gz vxWorks.img
    >
    > The PPCBoot displays the right header info, CRC check is fine and
    > uncompresses it fine. But it hangs when trying to boot the
    > uncompressed image:
    >
    > ## Booting image at 00400000 ...
    > * *Image Name: * VxWorks
    > * *Image Type: * PowerPC VxWorks Kernel Image (gzip compressed)
    > * *Data Size: * *517225 Bytes = 505 kB = 0 MB
    > * *Load Address: 00800000
    > * *Entry Point: *00800000
    > * *Verifying Checksum ... OK
    > * *Uncompressing Kernel Image ... OK
    > ## Ethernet MAC address not copied to NV RAM
    > ## No elf image at address 0x00800000
    > ## Not an ELF image, assuming binary
    > ## Using bootline (@ 0x4200): ip=auto
    > ## Starting vxWorks at 0x00800000 ...
    >
    > I have tried elfToBin instead of objcopyppc and it doesnt work either.
    > I am wondering what I am missing here.
    >
    > Thanks for your help!
    >
    > Jay


    Dear Jay,

    I had lot of problem with elf format for my bootrom. Windriver's
    support team advise me to avoid this format. Now I use hex format and
    that works fine. Elf format is always generated (even if you indicate
    hex or directly bin format). I use hex file for the flash programmer
    and elf file for debug (it includes symbols).

    I never user the command line only workbench and OCD (based on
    eclipse) and I work with VxWorks 6.5.

    I don't know if this message help you but it seems elf format has lot
    of problem since a long time and some of them are solved but not all
    of them.

    regards,
    Sylvain

  3. Re: converting elf to binary

    On May 26, 1:13 pm, sybe wrote:
    > On May 23, 8:39 pm, jjaya...@gmail.com wrote:
    >
    >
    >
    > > Hi,
    > > I am running into problems trying to convert an existing elf format
    > > vxworks.st to a compressed binary image. I am using PPC(Artesyn),
    > > Vxworks 5.5 and PPCBoot. Here is what I am doing:

    >
    > > objcopyppc -O binary vxWorks.st vxWorks.bin
    > > gzip -9 vxWorks.bin
    > > mkimage -A ppc -C gzip -O VxWorks -n "VxWorks" -a 0x800000 -e 0x800000
    > > -d vxWorks.bin.gz vxWorks.img

    >
    > > The PPCBoot displays the right header info, CRC check is fine and
    > > uncompresses it fine. But it hangs when trying to boot the
    > > uncompressed image:

    >
    > > ## Booting image at 00400000 ...
    > > Image Name: VxWorks
    > > Image Type: PowerPC VxWorks Kernel Image (gzip compressed)
    > > Data Size: 517225 Bytes = 505 kB = 0 MB
    > > Load Address: 00800000
    > > Entry Point: 00800000
    > > Verifying Checksum ... OK
    > > Uncompressing Kernel Image ... OK
    > > ## Ethernet MAC address not copied to NV RAM
    > > ## No elf image at address 0x00800000
    > > ## Not an ELF image, assuming binary
    > > ## Using bootline (@ 0x4200): ip=auto
    > > ## Starting vxWorks at 0x00800000 ...

    >
    > > I have tried elfToBin instead of objcopyppc and it doesnt work either.
    > > I am wondering what I am missing here.

    >
    > > Thanks for your help!

    >
    > > Jay

    >
    > Dear Jay,
    >
    > I had lot of problem with elf format for my bootrom. Windriver's
    > support team advise me to avoid this format.


    Then, how to do the debugging ?

    > Now I use hex format and
    > that works fine. Elf format is always generated (even if you indicate
    > hex or directly bin format). I use hex file for the flash programmer
    > and elf file for debug (it includes symbols).
    >
    > I never user the command line only workbench and OCD (based on
    > eclipse) and I work with VxWorks 6.5.
    >
    > I don't know if this message help you but it seems elf format has lot
    > of problem since a long time and some of them are solved but not all
    > of them.


    Interesting . Is there any link for this info regarding the ELF
    problem ?

    Now, i wonder which could be the best format for debugging with JTAG.
    Does ELF has lot of problems ?
    What could be the alternative to ELF for debugging ?

    Thx in advans,
    Karthik Balaguru

  4. Re: converting elf to binary

    On May 26, 1:13 pm, sybe wrote:
    > On May 23, 8:39 pm, jjaya...@gmail.com wrote:
    >
    >
    >
    > > Hi,
    > > I am running into problems trying to convert an existing elf format
    > > vxworks.st to a compressed binary image. I am using PPC(Artesyn),
    > > Vxworks 5.5 and PPCBoot. Here is what I am doing:

    >
    > > objcopyppc -O binary vxWorks.st vxWorks.bin
    > > gzip -9 vxWorks.bin
    > > mkimage -A ppc -C gzip -O VxWorks -n "VxWorks" -a 0x800000 -e 0x800000
    > > -d vxWorks.bin.gz vxWorks.img

    >
    > > The PPCBoot displays the right header info, CRC check is fine and
    > > uncompresses it fine. But it hangs when trying to boot the
    > > uncompressed image:

    >
    > > ## Booting image at 00400000 ...
    > > Image Name: VxWorks
    > > Image Type: PowerPC VxWorks Kernel Image (gzip compressed)
    > > Data Size: 517225 Bytes = 505 kB = 0 MB
    > > Load Address: 00800000
    > > Entry Point: 00800000
    > > Verifying Checksum ... OK
    > > Uncompressing Kernel Image ... OK
    > > ## Ethernet MAC address not copied to NV RAM
    > > ## No elf image at address 0x00800000
    > > ## Not an ELF image, assuming binary
    > > ## Using bootline (@ 0x4200): ip=auto
    > > ## Starting vxWorks at 0x00800000 ...

    >
    > > I have tried elfToBin instead of objcopyppc and it doesnt work either.
    > > I am wondering what I am missing here.

    >
    > > Thanks for your help!

    >
    > > Jay

    >
    > Dear Jay,
    >
    > I had lot of problem with elf format for my bootrom. Windriver's
    > support team advise me to avoid this format. Now I use hex format and
    > that works fine. Elf format is always generated (even if you indicate
    > hex or directly bin format). I use hex file for the flash programmer
    > and elf file for debug (it includes symbols).
    >
    > I never user the command line only workbench and OCD (based on
    > eclipse) and I work with VxWorks 6.5.
    >
    > I don't know if this message help you but it seems elf format has lot
    > of problem since a long time and some of them are solved but not all
    > of them.
    >


    Are you sure that ELF file format has problems ?
    I find this to be a strange information about ELF file format.

    I have used ELF formats in many other environments, i have not
    faced any problems.

    I am worried if ELF format has some problems, then it will
    cause lot of unnecessary pain while debugging.

    Is there any link in the internet that confirms the problems with
    ELF file format ?
    Are you sure that ELF file format has problems ?

    Thx in advans,
    Karthik Balaguru

  5. Re: converting elf to binary

    On May 26, 11:45*am, karthikbalaguru
    wrote:
    > On May 26, 1:13 pm, sybe wrote:
    >
    >
    >
    >
    >
    > > On May 23, 8:39 pm, jjaya...@gmail.com wrote:

    >
    > > > Hi,
    > > > I am running into problems trying to convert an existing elf format
    > > > vxworks.st to a compressed binary image. I am using PPC(Artesyn),
    > > > Vxworks 5.5 and PPCBoot. Here is what I am doing:

    >
    > > > objcopyppc -O binary vxWorks.st vxWorks.bin
    > > > gzip -9 vxWorks.bin
    > > > mkimage -A ppc -C gzip -O VxWorks -n "VxWorks" -a 0x800000 -e 0x800000
    > > > -d vxWorks.bin.gz vxWorks.img

    >
    > > > The PPCBoot displays the right header info, CRC check is fine and
    > > > uncompresses it fine. But it hangs when trying to boot the
    > > > uncompressed image:

    >
    > > > ## Booting image at 00400000 ...
    > > > * *Image Name: * VxWorks
    > > > * *Image Type: * PowerPC VxWorks Kernel Image (gzip compressed)
    > > > * *Data Size: * *517225 Bytes = 505 kB = 0 MB
    > > > * *Load Address: 00800000
    > > > * *Entry Point: *00800000
    > > > * *Verifying Checksum ... OK
    > > > * *Uncompressing Kernel Image ... OK
    > > > ## Ethernet MAC address not copied to NV RAM
    > > > ## No elf image at address 0x00800000
    > > > ## Not an ELF image, assuming binary
    > > > ## Using bootline (@ 0x4200): ip=auto
    > > > ## Starting vxWorks at 0x00800000 ...

    >
    > > > I have tried elfToBin instead of objcopyppc and it doesnt work either.
    > > > I am wondering what I am missing here.

    >
    > > > Thanks for your help!

    >
    > > > Jay

    >
    > > Dear Jay,

    >
    > > I had lot of problem with elf format for my bootrom. Windriver's
    > > support team advise me to avoid this format.

    >
    > Then, how to do the debugging ?
    >
    > > Now I use hex format and
    > > that works fine. Elf format is always generated (even if you indicate
    > > hex or directly bin format). I use hex file for the flash programmer
    > > and elf file for debug (it includes symbols).

    >
    > > I never user the command line only workbench and OCD (based on
    > > eclipse) and I work with VxWorks 6.5.

    >
    > > I don't know if this message help you but it seems elf format has lot
    > > of problem since a long time and some of them are solved but not all
    > > of them.

    >
    > Interesting . Is there any link for this info regarding the ELF
    > problem ?
    >
    > Now, i wonder which could be the best format for debugging with JTAG.
    > Does ELF has lot of problems ?
    > What could be the alternative to ELF for debugging ?
    >
    > Thx in advans,
    > Karthik Balaguru- Hide quoted text -
    >
    > - Show quoted text -


    Dear Karthik Balaguru

    I don't use elf file in order to flash my board (NOR or NAND) but I
    use elf for debugging. In order to do that you must download symbols
    (and symbols only) from elf file. When I connect my probe in OCD I've
    a red arrow icon to "reset and download". In this properties form,
    select "download" tab, add your elf file, uncheck "download" and CHECK
    "load symbols". With this configuration I can debug my flashed code
    (i.e: bootrom) with symbols taken in the elf file.

    And I confirm I have some problem to flash something if I use elf file
    as source (even if this case exists in the flash programmer).

    regards,
    Sylvain

  6. Re: converting elf to binary

    I found out the problem. I was using incorrect entry point and load
    address. Once I fixed it the kernel started booting up.

    Thanks guys!

  7. Re: converting elf to binary

    Karthik,
    Sylvain is refering to bootrom (boot loader) issues. I have used elf
    format for kernel images and never faced problems. We switched to
    binary compressed format because you can put a CRC check in that. This
    will detect any corrupted kernel received either over network or read
    out from flash.

    Are you looking to debug elf bootrom image?

    Thanks,
    Jay

  8. Re: converting elf to binary

    On May 29, 7:59*pm, jjaya...@gmail.com wrote:
    > Karthik,
    > Sylvain is refering to bootrom (boot loader) issues. I have used elf
    > format for kernel images and never faced problems. We switched to
    > binary compressed format because you can put a CRC check in that. This
    > will detect any corrupted kernel received either over network or read
    > out from flash.
    >
    > Are you looking to debug elf bootrom image?
    >


    Yes, Does vxworks support debugging using elf file
    format ?
    If there is some problem in debugging using elf file format
    in VxWorks, can you pls let me know the alternative file
    format that can be used for debugging ?

    Thx in advans,
    Karthik Balaguru

  9. Re: converting elf to binary

    On May 29, 11:13 am, karthikbalaguru
    wrote:
    > On May 29, 7:59 pm, jjaya...@gmail.com wrote:
    >
    > > Karthik,
    > > Sylvain is refering to bootrom (boot loader) issues. I have used elf
    > > format for kernel images and never faced problems. We switched to
    > > binary compressed format because you can put a CRC check in that. This
    > > will detect any corrupted kernel received either over network or read
    > > out from flash.

    >
    > > Are you looking to debug elf bootrom image?

    >
    > Yes, Does vxworks support debugging using elf file
    > format ?
    > If there is some problem in debugging using elf file format
    > in VxWorks, can you pls let me know the alternative file
    > format that can be used for debugging ?
    >
    > Thx in advans,
    > Karthik Balaguru


    Aside from any issues involving bootroms, you shouldn't have
    any problems with ELF ... its a standard format, and I've
    never had any problems with any of the tools generating
    incorrect images.

    ELF is basically a relocatable binary image, so there's a table
    at the start saying where text, data, symbols are so they can
    be relocated independently.

    The debugger will access the symbol part of the ELF file;
    the only other information it might need, it is wasn't involved
    in loading vxWorks, is where the rest of the sections
    where relocated too

    By default, the VxWorks image (with no extension) is a ELF
    file. Similarly, RTP's (.vxe) are ELF files.

    If you download your VxWorks image over a network and
    attach the target server to it, it will use the VxWorks image
    to get the symbols.

    One cool thing I've done with RTP's (presumably it would
    work with the VxWorks image too) is to generate the RTP
    with -g to get full symbol information embedded in the
    ELF file). The RTP can get huge!!

    We keep the original file, and the strip the symbols out,
    and load that RTP - its a lot smaller that way, but we can
    still use the original so the debugger has access to symbols

    Jason

+ Reply to Thread