项目作者: AhmedYousriSobhi

项目描述 :
C code to convert Hex file to array Txt file
高级语言: C
项目地址: git://github.com/AhmedYousriSobhi/Hex-To-array-txt.git
创建时间: 2020-12-09T15:29:22Z
项目社区:https://github.com/AhmedYousriSobhi/Hex-To-array-txt

开源协议:

下载


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