AnsweredAssumed Answered

Include some compiled code (.s19/.bin?) in a project using LCF

Question asked by FridgeFreezer on Jul 20, 2011
Latest reply on Aug 1, 2011 by FridgeFreezer

Setup: MCF52259, CW7.2.


Following on from  it looks like we really need to split our bootloader code from our main application code so that the two are separate and one doesn't affect the other (and it seems like good practice to keep them separate anyway).


So, what I believe is needed is:

- Create a new project with JUST our bootloader code (have now done)

- Compile the bootloader into an executable form (.s19 seems to be the standard output, .bin just seems to be an .s19 minus the "S")

- In our main project, configure the LCF to put this executable code into the correct place & ensure it's called first at startup.


I have spent all day reading threads about including files in LCF's in various ways, and although I think I can see how to include a random data file (EG a picture) into the LCF, but I cannot find any mention of how you can include a compiled .s19 in such a way that it is treated as executable, and the main project compiles/debugs happily with the lower sector of flash occupied by this "unknown" block of code.


This thread asks a similar question about how to create the executable in the fist place, but objcopy seems like a workaround rather than a solution:


This thread has an answer from CrasyCat which seems to use .elf / .a files, I can't see a way to generate these or how they work:


I have seen mention of building a project as a static library but no explanation of what happens when you do this / how it works.


This post seems to come quite close but doesn't go into much detail:


There seem to be little pieces of this jigsaw puzzle everywhere, but not quite enough for me to complete the picture :smileytongue: