Is there a way to compile two programs (each has its own main() function) and download them to different parts of memory at the same time?
My first program is a resident firmware programmed to reside in 0xC000 ... 0xC3FF, my second program is an application programmed to reside in 0xC400...0xDFFF. They use
__asm("mov.w #0xC000, PC"); ..... and
__asm("mov.w #0xC400, PC");
to jump back and forth to each other, as needed. I currently download them one at a time. The firmware is downloaded with the option to "Erase main and information memory" and the app is downloaded with the option "Retain unchanged memory". The firmware uses the default linker file, the app uses a custom linker file with
-Z(CONST)DATA16_C,DATA16_ID,DIFUNCT,CHECKSUM=C400-FFDF
-Z(CODE)CSTART,ISR_CODE,CODE_ID=C400-FFDF
-P(CODE)CODE=C400-FFDF
so that it doesn't overwrite the firmware that is already downloaded into 0xC000 ... 0xC3FF.
What I would like to be able to do is download both programs with one command, either from within IAR Embedded Workbench or via command line. Any suggestions?