Article ID: 000076770 Content Type: Troubleshooting Last Reviewed: 09/11/2012

What is the format of Intel Hexadecimal files (.hex)?

Environment

BUILT IN - ARTICLE INTRO SECOND COMPONENT
Description A HEX is often downloaded from a PC to a development system and run from RAM. HEXs can also be converted to binary files and programmed into a configuration device. 
                                                                         
A sample HEX is shown below:                                             
                                                                              
:10008000AF5F67F0602703E0322CFA92007780C361                                   
:1000900089001C6B7EA7CA9200FE10D2AA00477D81                                   
:0B00A00080FA92006F3600C3A00076CB                                             
:00000001FF                                                                    

The format for this file is: 
                                                                           
First character (:)  =  Start of a record                                     
Next two characters  =  Record length (in this example, 10h)                  
Next four characters =  Load address (in this example, 0080h)                 
Next two characters  =  Record type (see below)                               
Remaining characters =  Actual data                                           
Last two characters  =  Checksum (i.e., sum of all bytes checksum = 00)     

The last line of the file is special, and always looks like the last line shown above. HEX record types are shown below: 
                                                                      
00 = Data record                                                              
01 = End of file record                                                       
02 = Extended segment address record                                          
03 = Start segment address record                                             
04 = Extended linear address record                                           
05 = Start linear address record
      

Related Products

This article applies to 1 products

Intel® Programmable Devices