> Thanks for your reply. But what I want is not make .h
file from coff file, I
> want to make a .h file back coff file. So I want to know how COFF2C extract
> the coff file to a .h file. Is there any detail document about that?
The first thing is to look in TI's Assembly Language Tools User's Guide doc
whatever chip is being used. In your case (C54x), look in this doc:
under Appendix A, Common Object File Format.
Second, I suggest to Google for "COFF reader" or "COFF parser" similar source
program. I'm not sure of any reliable, "standardized" open source for parsing
files, but I haven't looked for a while so who knows what's out there.
But be careful, my experience has been that each chip vendor has a somewhat
"interpretations" of the COFF format. For example, TI follows the COFF format
but there are several deviations. Of course this makes sense because
processors/CPUs have different native architecture and requirements -- things
alignment, load-time initialization (i.e. your friendly .cinit section!),
ways of handling stacks or stack alternatives (think "data pointer"
artifacts resulting from optimization, etc. So, if you find some open source,
write your own program, then you gotta test, test, test with many different
outputs with many different combinations of Project Build and Linker options
you can say your program is working.
> On 11/18/08, Jeff Brower
> > John-
> > > I have some .h files that contain the dsp binary code. These .h files
> > > generated by COFF2C. And I want to get the assembly code from these .h
> > file
> > > what should I do? Or anyone knows how COFF2C generated .h file with
> > > file so I can write a tool to make .h back coff.
> > coff2c does not generate source code from a COFF file and is not a step
> > that
> > direction. It extracts COFF sections -- executable code (.text section),
> > .const,
> > .cinit, and any other other initialized sections -- and stores in a
> > standard .h
> > file. There is some C code that goes along with it that you can use to
> > load the
> > sections into a TI DSP at run-time; i.e. before releasing Reset.
> > It's basically a free version of TI's hex6x.exe and hex500.exe programs
> > they
> > functionally accomplish the same thing.
> > Here is a page with an example of using coff2c:
> > http://www.cadenux.com/bsp/CadenuxArmDriverGuide.html
> > The above page describes how to load a DSP executable from an ARM core
> > dual-core
> > TI devices, for example C5471, various DM2x, DM2x, and DM6x, devices and
> > OMAP 1510,
> > 5910 and other OMAP devices.
> > -Jeff