how to generate hex code of c code

cancel
Showing results for 
Search instead for 
Did you mean: 

how to generate hex code of c code

Jump to solution
7,685 Views
Contributor I
please help me(procedure or settings) how to generate hex code for the c file after buiding it. 
Labels (1)
Tags (1)
0 Kudos
1 Solution
43 Views
Specialist III

Hello

I assume you are using CodeWarrior for HC08 and you are building from the IDE.

If this sis the case, in order to generate an Intel Hex file rather than a S record file at the end of the build process, do the following:

 - Open the file burner.bbl from your project in an edit window.
 - Change the line "format=motorola" to "format=intel"
 - Change the line OPENFILE "%ABS_FILE%.s19" into
    OPENFILE "%ABS_FILE%.hex"
 - Save the changes and force a rebuild of the project.

A Intel Hex file will be generated at the end of the build process rather than a S record file.

I hope this helps. 

CrasyCat

View solution in original post

0 Kudos
7 Replies
43 Views
Contributor I

thanks i have been able to generate hex code but can u plz tell me how can i be able to verify that the hex code generated is correct or no i mean using LST files or any other way u know plz suggest. also shall i send u the project so that u can see and check is all correct or not.

:0DEE00004500B094CCEE079AC7FFFF20FB41
:02FFFE00EE0013
:00000001FF

this is my hex code got
but i have a confusion that in 1st line address start is EE00 which is not possible in 4k device memory as in QB4 plz help


thanks & regards

0 Kudos
43 Views
Specialist III

Hello

I have checked the Reference manual for HC08QB4.

According to the reference manual there is Flash between 0xEE00 and 0xFDFF on HC08QB4. So there is memory there.

Around disassembling an Intel Hex file you can do that as follows:

 - Start a Window Explorer
 - Browse for {Install}\PROG directory
 - Start decoder.exe
 - Select "Decoder" -> "Options"
 - Switch to "Input" Tab
 - Check the "Set Processor" options and specify HC08 in the edit box on the bottom of the dialog.
 - Click OK to close the dialog
 - Select "File" -> "Decode"
 - Browse for your Intel Hex file. The decoder will generate a file with extension .lst containing the disassembly listing.

CrasyCat

43 Views
Contributor I
thanks for ur help that mean the code gererating is correct
sir i m good @ pcb designing(Protel 99SE) i do autorouting also if u need any help i can make design for u from hand drawn ckts ..plz dont hesitate if u need some thing i will love to do
 
Best regards
Pallav
0 Kudos
43 Views
Contributor I
 
i want , after i compiler a code withn  no error it shuld generate a hex file(as s19 file is generated so that i can download it using my  programmer(it can only take hex files).
 
thanks & regards
pallav
0 Kudos
44 Views
Specialist III

Hello

I assume you are using CodeWarrior for HC08 and you are building from the IDE.

If this sis the case, in order to generate an Intel Hex file rather than a S record file at the end of the build process, do the following:

 - Open the file burner.bbl from your project in an edit window.
 - Change the line "format=motorola" to "format=intel"
 - Change the line OPENFILE "%ABS_FILE%.s19" into
    OPENFILE "%ABS_FILE%.hex"
 - Save the changes and force a rebuild of the project.

A Intel Hex file will be generated at the end of the build process rather than a S record file.

I hope this helps. 

CrasyCat

View solution in original post

0 Kudos
43 Views
Specialist III

Hello

First which processor are you targeting (HC08, HC12, Coldfire, ...)?

Then I am not sure I understand the question. Are you looking for a way to generate an S record file for your ANSI C application?

If not can you please explain what you want to do.

CrasyCat

0 Kudos
43 Views
Contributor I

at present i m using QB4 but let it be any chip.(it realy does't matter)

 

 

0 Kudos