Including a binary file

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Including a binary file

1,695 Views
cessna
Contributor I
I'd like to include an html file in a project written in 'C' for an HC05, its a small (600byte) status page.
I've tried setting my .htm file to "Ignored By Make" in the Standard Settings (Alt-F5) - "File-Mappings" but the included .htm file is still read and rejected, any ideas?
Labels (1)
Tags (1)
0 Kudos
Reply
2 Replies

761 Views
CompilerGuru
NXP Employee
NXP Employee
With changed File-Mappings you can only control how the ide treats the file, it wont download the content of the file to the target tough.
I think the simplest approach, and probably the best one too, is to store the content of the file as string literal as part of the application. So it wont be a separate file anymore, but everything is straight forward, no custom build steps.
If you really want to put the content of a file into the application, then the only way I see is to create an srecord out of the html page and then include the srecord in the prm.
The linker supports to include srecords, and the conversion from a binary file to an srecord can be done with the burner in a batch burner file.
I'm not going into too many details, as I think the simple code it as string literal approach is still the best one :smileyhappy:.


Daniel

BTW: I think processor expert has a bean for such purpose, but processor expert is not an option with the HC05. I'm sure there are many tools on the web too to encode a file into a C source file.

761 Views
bigmac
Specialist III
Hello,
 
Using a similar aproach to Daniel's suggestion, and assuming your compiler/linker also supports the inclusion of .ASM assembly fiiles, a further alternative might be to incorporate the data as assembly directives.  For CW, this would be a series of lines of the following format -
 
   dc.b  "Line data",$0D,$0A  ; or whatever line termination is needed
 
Regards,
Mac