Searching \ for '[PIC]: Tool to compare two HEX files ?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'Tool to compare two HEX files ?'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Tool to compare two HEX files ?'
2004\03\27@075034 by Jan-Erik Soderholm

face picon face
Hi.
Does anyone know of a tool to compare two HEX files ?

The problem with using "normal" file compare tools, is that
two HEX files could look different, but they could still be
functional the same. The reason is of course that different
things (memory sections) in the HEX file don't have to come
in any special or fixed order. As when using one HEX file to
flash a part, and then reading back the contents to a new
file.

I need a tool tool that  knows how to read and interpret
the HEX data from two files and report any differences.

Best Regards
Jan-Erik.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\03\27@091454 by Bill Couture

picon face
On Sat, 27 Mar 2004, Jan-Erik Soderholm wrote:

> Does anyone know of a tool to compare two HEX files ?
>
> The problem with using "normal" file compare tools, is that
> two HEX files could look different, but they could still be
> functional the same. The reason is of course that different
> things (memory sections) in the HEX file don't have to come
> in any special or fixed order. As when using one HEX file to
> flash a part, and then reading back the contents to a new
> file.
>
> I need a tool tool that  knows how to read and interpret
> the HEX data from two files and report any differences.

How about:
  1) Run both files through a disassembler
  2) Compare resulting source files

While it only supports a limited number of PICs, you can try my
PICDIS program (http://www.picemulator.com) or one of the other disassemblers
from my links page.

Bill

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\03\27@093356 by Rob Hamerling

flavicon
face
Jan-Erik Soderholm wrote:

> I need a tool tool that  knows how to read and interpret
> the HEX data from two files and report any differences.

You could use your new Xwisp2!
- xwisp2 load hexfile1 save hexfileA
- xwisp2 load hexfile2 save hexfileB
Now that hexFileA and HexfileB are created by the same program, the
files have a similar structure, at least contiguous program and data
memory adresses.
Then you could use the good old Comp command to compare the files (or
any other ASCII-text file compare utility.

Regards, Rob.

--
Rob Hamerling, Vianen, NL phone +31-347-322822
homepage: http://www.robh.nl/

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\03\27@100644 by Jan-Erik Soderholm

face picon face
Bill Couture wrote :

> > I need a tool tool that  knows how to read and interpret
> > the HEX data from two files and report any differences.
>
> How about:
>    1) Run both files through a disassembler
>    2) Compare resulting source files

Yes, if that takes care of both prog mem, eprom and
config settings.

And, basicly, I'd just like to know if two HEX files
are functional and logical the same. Not realy whats
in there. I suppose that this could be made device
independant.

Jan-Erik.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\03\27@101058 by Spehro Pefhany

picon face
fAt 01:49 PM 3/27/2004 +0100, you wrote:
>Hi.
>Does anyone know of a tool to compare two HEX files ?
>
>The problem with using "normal" file compare tools, is that
>two HEX files could look different, but they could still be
>functional the same. The reason is of course that different
>things (memory sections) in the HEX file don't have to come
>in any special or fixed order. As when using one HEX file to
>flash a part, and then reading back the contents to a new
>file.
>
>I need a tool tool that  knows how to read and interpret
>the HEX data from two files and report any differences.

Years ago I wrote a utility to do this when porting a whole bunch of
programs for working products from one assembler to another. I had
already found discrepancies and wanted to be sure that there were no
other ones.  Unfortunately I don't have the software any more, but
if someone wants to write it, it should only take a few hours if you're
up to speed. You can get the official Intel hex format document from
my website (in sig). Parsing Intel hex is easy, so just read it in,
note any checksum errors if you like, and put it into arrays.
Compare the arrays, spit out the differences.

The only other consideration is what to do with "unspecified" words,
as Intel hex allows you to leave "holes" in the data. Typical choices
might be all 0's or all 1's. You could also keep track of just what bytes
were specified in both cases, and compare, which might be ideal, or
might show up differences where there were no important ones.

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
spam_OUTspeffTakeThisOuTspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\03\27@111155 by Larry Williams

flavicon
face
Use what comes on your computer. At dos prompt type

FC file1 file2

simple and free.

Bill Couture wrote:
{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\03\27@112410 by Spehro Pefhany

picon face
At 10:19 AM 3/27/2004 -0600, you wrote:
>Use what comes on your computer. At dos prompt type
>
>FC file1 file2
>
>simple and free.

Doesn't work. Suppose one hex file has 8 word line lengths
and the other has 16 word line lengths... headers and checksums
will be different on every line.

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
.....speffKILLspamspam@spam@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\03\27@115549 by Byron A Jeff

face picon face
On Sat, Mar 27, 2004 at 10:19:04AM -0600, Larry Williams wrote:
> Use what comes on your computer. At dos prompt type
>
> FC file1 file2

You obviously didn't read what Jan-Erik wrote.

He wants a tool that FUNCTIONALLY compares two hex file, not lexigraphically
compares them. It would need to work something like this:

1) Allocate some memory space for both files (16 bit integer array), then fill
  the space with 0xffff for each value.

2) Open both files and use a typical HEX file read routine to read them into
  the array.

3) Compare the arrays.

So even if the hex file's lines are out of order, or if one head header
information and the other doesn't, they can still compare the same.

>
> simple and free.

Free, but not simple. If you can spare a PIC and you have a programmer, then
you can do the following:

1) Read the first file into your programming software, and program the PIC with
  it.

2) clear the programmer buffer, then read the second file into it.

3) Do a verify on the PIC.

If the files are the same, then the verify should work fine, however if they
are functionally different then the verify will catch it.

Hope this helps,

BAJ
{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\03\27@115757 by Jan-Erik Soderholm

face picon face
Larry Williams wrote :

> > On Sat, 27 Mar 2004, Jan-Erik Soderholm wrote:
> >
> > > The problem with using "normal" file compare tools, is that
> > > two HEX files could look different, but they could still be
> > > functional the same.
>
>
> Use what comes on your computer. At dos prompt type
>
> FC file1 file2
> simple and free.

So, so you are saying that FC doesn't have the "problem" I
outlined above ? Could you be a little more specific abaout that ?

Jan-Erik.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\03\27@150139 by Wouter van Ooijen

face picon face
> I need a tool tool that  knows how to read and interpret
> the HEX data from two files and report any differences.

I'll add a COMPARE command to XWisp :)

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\03\27@150347 by Robert Rolf

picon face
What is so hard about using google?
hex + file + compare + program

First hit is what you want

http://www.getsomesoft.com/Development/Web/6382-HexCmp.html

and a subsequent reference confirming that it reads intel hex.

http://www.fairdell.com/patchfactory/
HexCmp 2 (2.2.0.6)
Added:
-  add hex-file support Intel format(read only).
                                                                          -
fixed scrolling bug, when open single file.

(12-September-2003)

OR

http://www.picbasic.co.uk/support_tools.php

PICHEX A package for manipulating Microchip PIC16C84 hex files.

This package provides a suite of programs for manipulating Microchip hex
files. The software is designed for the type of hex dump used to program the
PIC16C84; these are based on Intel hex format and integrate into a single
file all the information needed to specify the contents of the PIC16C84
program memory, data memory, ID words and configuration word. The

ICHEX package can perform the following operations:
Convert INHX8M files to INHX16 and vice-versa.
Convert between INHX8M and John Morrison binary.
Combine separate program and data hex files.
Split an integrated hex file into separate files.
Add/replace a configuration word.
Add/replace a 4-word ID record.
Identify which areas of a hex file are present.
Compute a file checksum using Microchip's own algorithm.
Build a data hex file from a free-format hex list.
Dump a data hex file as a hex list.
***>  Intelligently compare two hex files.

AND SO ON FOR A FEW THOUSAND OTHER HITS.

Robert

Jan-Erik Soderholm wrote:
{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\03\27@151008 by Mike W

flavicon
picon face
Is'nt there a program called FC.COM or FC.EXE in Dos which does just
this?
or are we past useful utrils and Dos ?
--
On 27 Mar 04, at 20:59, Wouter van Ooijen wrote:

{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\03\27@152601 by Bob Axtell

face picon face
Spehro Pefhany wrote:
> At 10:19 AM 3/27/2004 -0600, you wrote:
>
>> Use what comes on your computer. At dos prompt type
>>
>> FC file1 file2
>>
>> simple and free.

I wrote a compare program in the Deep Dark Distant DOS Days, when
computers actually worked.

You have to first create an output image set to the erased value of your
device. In the case of Microchip parts, its a file of words set to
h'fff'(12b PICs), h'3fff' (14b PICs), or h'ffff' (16b PICs). Then, using
the extracted Hex format, fill in all the data as indicated.

Do the same for the second file, then compare the output images byte for
byte.

--Bob
---
 Replies: NOTE-Script, EXE,BAT and COM
    files will be rejected by server
             --------------
               Bob Axtell
       PIC Hardware & Firmware Dev
         http://beam.to/baxtell
             1-520-219-2363

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\03\27@152814 by Jan-Erik Soderholm

face picon face
Robert Rolf wrote :

> What is so hard about using google?
>
> hex + file + compare + program
> First hit is what you want
> www.getsomesoft.com/Development/Web/6382-HexCmp.html
> and a subsequent reference confirming that it reads intel hex.

He he...
Thanks for the pointer ! Currently downloading...
I'll report back how it worked.


Mike W wrote :

> Is'nt there a program called FC.COM or FC.EXE in Dos
> which does just this? or are we past useful utrils and Dos ?

No, Re-read the original post. In particular *this* part :

> > The problem with using "normal" file compare tools, is that
> > two HEX files could look different, but they could still be
> > functional the same.

Jan-Erik.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\03\27@175421 by Mike W

flavicon
picon face
On 27 Mar 04, at 21:27, Jan-Erik Soderholm wrote:


> Mike W wrote :
>
> > Is'nt there a program called FC.COM or FC.EXE in Dos
> > which does just this? or are we past useful utrils and Dos ?
>
> No, Re-read the original post. In particular *this* part :
>
> > > The problem with using "normal" file compare tools, is that
> > > two HEX files could look different, but they could still be
> > > functional the same.
>
Sorry ;-(

--
"Smile" said the Lord, "things could be worse"
so I did, and they were ;-(

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

More... (looser matching)
- Last day of these posts
- In 2004 , 2005 only
- Today
- New search...