Re-building sources from MC9S08SH4 .s19 file

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

Re-building sources from MC9S08SH4 .s19 file

1,010 Views
krisba
Contributor I

Hello,

 

I have been working on a simple project with the MC9S08SH4.  I recently had a harddrive crash on my code repository, and all of the backups do not include all of the data; lesson learned.  However, I can pull the code from my IC in an .s19 format using usbdm.  I can also disassemble it using CodeWarrior tools.  However, its in an absolute format, and is not readily usable.  Is there an easy way to transcribe the .s19 back in to a ready-to-use assembly source?  I spent a lot of time playing with both the Classic CW and Eclipse based CW and was not able to find a way.  Thank you.

Labels (1)
0 Kudos
Reply
3 Replies

751 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

hello Kris,

If you've only the Srecord file we don't have solution to generate the source code.

However with the decoder tool you can have the assembly instruction of your application.

To that you must launch the decoder.exe tool in the \prog folder.

Under Decoder ¦ Option Settings, you must define the processor and select the options:

            -D: Decode DWARF Sections

            -E: Decode ELF sections

The decoder will generates a file containing all assembly instruction for your application.

.S19 is optimized code by compiler, the compiler already optimizes the original source C code then generates .S19   That’s to say, each of them doesn’t contain any the original source code info any more, but only includes optimized code.

We can only be able to decode it and see the object code in assembly-pseudo (not real assembly) format.

This attribute is depended on .s19 and .lib itself but not decode tool.



====================================

this answer is for you. if it helps. please click on "Correct Answer " button. thanks!


Best Regards,

ZhangJun

751 Views
krisba
Contributor I

Thank you for your response.  The original source was already in assembly format, there was no C involved.  However, like I noted, and you did as well, when using the decoder, its in a format that is difficult to use, with everything being absolute.  I don't need any labels to make sense, but having a way to automatically generate source, with labels would save me a lot of time.  I assume that this is not possible based on your answer, and I guess I just have a lot of work to transcribe the sources.

0 Kudos
Reply

751 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

yes, because the s19 file you retrieved from flash is a kind of optimized code. with this, we can only convert it to assembly-pseudo. but not a real original project assembly.

====================================

this answer is for you. if it helps. please click on "Correct Answer " button. thanks!


Best Regards,

ZhangJun

0 Kudos
Reply