This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Hex File Error??

After a considerable amount of effort, I have found a problem that
can be traced back to the hex file generated by the Keil C compiler.
The hex file seems to meet the Intel hex file specification, but it is
incorrectly translated into a binary file by several translation programs.
( One EPROM emulator utility and an EPROM programmer software
package.)

The following is the first part of the hex file generated by the compiler
version 1.32.

:104C39002D48454D205361772D000A2A2A2A2045FF
:104C490052524F52202A2A2A3A2025730A000A531F
:0B4C590054415455533A2025730A00C3
:103EAC004102AF00410290004100100041000500AA
:103EBC00410015004102E001410291004402E4007E
:103ECC000000004402CC00000000440292000000FC
:103EDC000044029E000000004402960000000044D2
:103EEC000011000000004402A40000000042000D7C
:103EFC00000042000300004202A200004202AD009A
:103F0C00004400180000000044012600000000429C
:103F1C000006000042028E00004202A8000042028D
:103F2C009C00004202B2000042000100004202E18B
:103F3C0000004202AA00004202C400004202B0008B
:103F4C000041002100420016000042029A0000418C
:103F5C0000000041000F0044001C00000000410262
:103F6C00AC32410023004100240041000C00410010
:063F7C00200041002200BC
:03000B0002494364
:10494300C0E0C0D075D008051DE51D64047037F5BF
:104953001D0519E51970020518FFAE18BE0327BF20
:10496300E824751800751900051AE51AB43C177583
:104973001A00051CE51CB43C0D751C00051BE51B4A
:0B498300B41803751B00D0D0D0E03248
:00000001FF

The locations of the code sections are:

hex file addr binary file addr
4C39-4C63 0C39-0C63 wrong
3EAC-3F82 1EAC-1F82 wrong
000B-000D correct
4943-498D correct

One translator seemed to work when the tiny code section at
0x000B was moved to the beginning of the hex file.

Any ideas or comments will be appreciated.

Parents
  • why doesn't Keil make the binary to hex conversion program sort
    the records so it will work with virtually all emulators and programmers?

    the dos sort functions with the /+4 ( start sorting with character 4 )
    but it also moves the end of file record to the first part of the file

Reply
  • why doesn't Keil make the binary to hex conversion program sort
    the records so it will work with virtually all emulators and programmers?

    the dos sort functions with the /+4 ( start sorting with character 4 )
    but it also moves the end of file record to the first part of the file

Children
  • Why should they?
    The Hex format does not require it.
    Similarly for Motorola S-Records.
    As you said yourself,
    "The hex file seems to meet the Intel hex file specification"

    The problem is lazy programmers who just assume - without verifying their assumption - that the hex file will be in order.
    You should complain to your translator vendors who have supplied deficient software which can't cope with well-formed hex files!