intel hex format
intel hex format
intel hex file의 예.
:10008000AF5F67F0602703E0322CFA92007780C361 :1000900089001C6B7EA7CA9200FE10D2AA00477D81 :0B00A00080FA92006F3600C3A00076CB :00000001FF
위를 살펴보면
- 첫번째 character (:)는 record start를 의미한다
- 다음의 2 character는 record의 길이(length)를 말한다. 여기서는 0x10(16byte hex == 32 byte ascii hex)
- 다음의 4 character는 load되는 번지를 말한다. 여기서는 0x0080
- 다음의 2 character는 record type을 말한다. (아래를 참조)
- 다음의 32 character는 record length에서 가리킨 data를 말함
- 마지막 2 character는 checksum을 말함(sum of all bytes + checksum = 00).
Record types:
- 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
* Extended linear address record(0x04)
예):0200000400609A
:10000000B800008ED08ED88EC0BC00C0B864668E9A
여기서 ULBA란 Upper Linear Base Address란 말의 줄임말이다.16bit 초과한 32bit 까지의 addressing에 대한 표현을 ULBA를 통해서 한다
위의 예에서 실제 hex값의 번지는
0x0060 (upper address) + 0x0000( lower address) ,즉 0x600000 부터의 값을 의미한다.
아래 싸이트 보고 내용을 추가하면
https://jimmywongiot.com/2021/04/20/format-of-intelhex/
Extended Segment Address Records (HEX86)
Extended segment address records-also known as HEX86 records-contain bits 4-19 of the data address segment. The extended segment address record always has two data bytes and appears as follows:
:020000021200EA
where:
- 02 is the number of data bytes in the record.
- 0000 is the address field. For the extended segment address record, this field is always 0000.
- 02 is the record type 02 (an extended segment address record).
- 1200 is the segment of the address.
- EA is the checksum of the record and is calculated as
01h + NOT(02h + 00h + 00h + 02h + 12h + 00h).
:020000021200EA
:10246200464C5549442050524F46494C4500464C33
이럴경우 실제 어드레스는
Address from the data record's address field 2462
Extended segment address record data field 1200
--------
Absolute memory address 00014462
End-of-File (EOF) Records
An Intel HEX file must end with an end-of-file (EOF) record. This record must have the value 01 in the record type field. An EOF record always appears as follows:
:00000001FF
where:
- 00 is the number of data bytes in the record.
- 0000 is the address where the data are to be located in memory. The address in end-of-file records is meaningless and is ignored. An address of 0000h is typical.
- 01 is the record type 01 (an end-of-file record).
- FF is the checksum of the record and is calculated as
01h + NOT(00h + 00h + 00h + 01h).
Format of IntelHex
Intel hexadecimal object file format, Intel hex format or Intellec Hex is a file format that conveys binary information in ASCII text form. It is commonly used for programming microcontrollers, EPR…
jimmywongiot.com