Skip to content

AhmedYousriSobhi/Hex-To-array-txt

Repository files navigation

Hex-To-array-txt

C code to convert Hex file to array Txt file.

This code is used to Covert Hex file to Txt file, so you can easily extract hex bytes into array in 'txt' file.

So this txt file would be input in bootloader code.

Code Idea:

  • First you need to understand Intel Hex Format
  • This code is simple just open the hex file:
    • Reads every line byte by byte.
    • Check the number of data bytes in this line and reads these data.
    • Store these data in the output txt file which i named OutputArray.txt and fill the reset of bytes by 0xFF until the code size is equivlent to const integer * PAGE_SIZE in ATmega-16. The Page size in AVR is 128 bytes = 64 word.
    • The OutputArray.txt file contains the Data bytes of the Application code, Code size, and number of pages needed for this code in the flash memory.

CMD Command:

CMD

.HEX File:

Hex file

.TXT File:

txt file

About

C code to convert Hex file to array Txt file

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages