how to convert a .bin file to .hex file?

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi!

I have dumped one image file from an atmega128 MCU but it's in .bin format. how can I convert this file into .hex format then I can read it in the avrstudio? is there such tools existing in winavr tool chain?

Thanks alot!

regards, st

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avr-objcopy -I binary -O ihex

But why did you dump it in binary in the first place?

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you Jörg!
Now I have converted it into the hex format.
The bin was read by one programmer which is defaultly in bin format. I have not find option/menu entry to set it to in .hex. :-(.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

> I have not find option/menu entry to set it to in .hex.

Then use AVRDUDE instead.

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It didnt work for this C:\Program Files (x86)\Atmel\Atmel Toolchain\ARM GCC\Native\4.8.1443\arm-gnu-toolchain\arm-none-eabi\bin

 

objcopy -O "C:\D_Drive\Test_Binary\FW.bin" -O "C:\D_Drive\Test_Binary\FW.hex

 

any idea?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But that is not the syntax? First the arm tool is probably not just "objcopy" but is likely called arm-none-eabi-objcopy. But even then your syntax is wrong:

arm-none-eabi-objcopy -I binary -O ihex "C:\D_Drive\Test_Binary\FW.bin" "C:\D_Drive\Test_Binary\FW.hex

You use -I followed by the format you think the input file has. Then use use -O followed by the ouput format you want to create. In this case it's "binary" as the input type and "ihex" (which obviously means Intel Hex) as the output type.

 

But what is "FW.bin" anyway? If this is the output of a build created with a previous objcopy then why didn't you just tell it to create ihex at that stage?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just a background.

 

I have a firmware binary file which consists of bootloader and application firmware. The atmel studio willl create two bin files, i merged those files and made one bin file.

 

Now, i want to flash the binary file. I didnt not find any tool other than SAM BA.

 

So, I have ATMEL Studio. ATMEL STUDIO takes only elf or hex file. Thus, I need to convert it.

 

By the way, What is INTEL Format? I am using SAM E70 CORTEX Controller. How the INTEL related to SAM devices ?

 

it would be better if u suggest anyhting ?

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

naveenkumarbece wrote:
What is INTEL Format?
Check out https://en.wikipedia.org/wiki/Intel_HEX

David (aka frog_jr)