Michael Aeberhard

Programming two projects at once

Discussion created by Michael Aeberhard on Jun 2, 2006
Latest reply on Jan 28, 2011 by Joe Kissell
I currently have two projects: the bootloader and the main application; both of which are loaded onto the same Microcontroller.  Right now what I do is the following: load the bootloader with CodeWarrior, and then run the bootloader application and use it to program the main application using hyperterminal and the .s19 file generated by CodeWarrior.
Basically I want to reduce this two-step process into one stop, being able to program both the bootloader and application at once.
But the problem is with allocation of certain functions/constants.  The Bootloader uses several ansi.c functions, which correctly loaded into the $4000-$8000 memory space where the bootloader lies (strings and constants are loaded there too).  So basically EVERYTHING the bootloader needs is in this page between local address $4000 and $8000, and the code is written so that the bootloader won't allow itself to be overwritten.  The application must then start at address $C000, where the bootloader jumps to.
How would I be able to compile and program the bootloader and application, but retain this rigid independence for the bootloader in the memory space I specified.  The problem I foresee is that things such as STRINGS, CONSTANTS, etc. (segments from the .prm file) will then program strings and constants from the application AND bootloader into the same area, which I don't want - I need them to be totally seperate.  Same issue with ansi.c functions, which both the bootloader and application use (and in the future, it could be the case that the application only gets recompiled differently, and then reference to these functions are messed up).
Anyone have any tips or suggestions on how to accomplish this in Codewarrior?  The idea is to program the bootloader and application together ONCE, and then afterwards still be able to use that combined project's .s19 file to program JUST the application (now using the bootloader only).