views:

404

answers:

2

I'm working with the CCS c compiler which produces its object files in the Intel 32 bit HEX format, aka INHX32. This compiler has a directive which causes it to put comments in these files. The comment lines are at the beginning of the file, and begin with a semicolon, like so:

;  This is a comment
:020000040000FA
:1000000007EF33F0000C000C056ED8CF06F0E0CF00
:1000100007F00001E9CF0DF0EACF08F0E1CF09F0D9

I'd like to use this directive, as the comments as would be extremely useful to those who later import the hex files into MPLAB. However, MPLAB will not import files with comments. When I try, I get an "Invalid file format, information not available" error.

I realize these comment lines are not part of the original Intel spec, but some other compilers and development tools accept them. Is there any way to make MPLAB do so?

I could write a script that would strip these lines out and then pass the resulting file to MPLAB, but as far as I can tell MPLAB can't import a file via the commandline.

A: 

Random stuff...

  1. Is there a compiler flag that disables this comment in the object? That would be the best place to start.

  2. If not that, does the IDE's C plug-in let you add a post-processor in it? If it's as above, you could write a comment eater easily.

Foobarista
I **want** the comments, that's why I want to use the directive that creates them.
Jeanne Pindar
A: 

It turns out MPLAB definitely doesn't do imports (or much else) from the commandline. So I wrote an AutoIt script to strip the comments, and save the rest in a temporary file. Then it imports that file into MPLAB by controlling MPLAB's GUI.

This is actually better than getting MPLAB to import the file directly, since my script displays the comments in a dialog so there is no need for the user to open the file in an editor to read them.

Jeanne Pindar