Greetings, Does anyone know if it is possible to initiate an alternate start after a software reset on the Infineon XC164? My problem is I have 2 pieces of software programmed into the ROM of the XC164, one lives in 0xC00000 to 0xC0FFFF, and the other lives in 0xC10000 to 0xC1FFFF. I can select which program runs using the /ALE switch and doing a hardware reset on my dev board, but I want to have one program relinquish control to the other through a software reset. There may be a clue in the VECSEG register, but nothing I have tried so far has worked. I was thinking along the lines of:
void reset_to_prog_a( void ) { VECSEG = 0xC0; _trap_(0); } void reset_to_prog_b( void ) { VECSEG = 0xC1; _trap_(0); }
How about writing a magic number to a specific location and doing a conditional jump to the alternate program address? Basically, dealing with the problem in software, rather than in hardware. - mike
Thanks for your reply Mike. I have implemented something along the lines of what you have suggested. Although it works, it isn't ideal, since the initial value of this specific location is not known after a power on reset. I have heard whispers from Infineon that it may be possible somehow - apparently their internal bootcode works along similar lines. So for now I'll continue to badger them about it! Paul.