How to convert an Intel HEX file to raw data, such as a memory view?

I want to make a bootloader code for AVR that can update firmware on air.

Now I can write to the application area using some fixed data. I have a hex file of a new firmware for upgrade. How to convert this hex file to raw data so that I can update the application using this raw data?

+3
source share
3 answers

You can use some tool ( http://hex2bin.sourceforge.net/ or another hex2bin converter) or write your own hexadecimal parser, which may have some caveats when receiving files> 64 KB.

+3
source

If you use WinAVR to compile, you can do this by including avr-objcopy:

C:\WinAVR-20100110\bin> avr-objcopy.exe -I ihex -O binary input_file.hex output.bin

If you are developing Linux, there is an avr-binutils package with the program avr-objcopy.

+8
source

, Intel Hex. - . () 16 (, ) . , , , , -. Wiki , .

+3

All Articles