no name

S12X system reboots twice

Discussion created by no name on May 29, 2006
Latest reply on May 30, 2006 by no name
I use the following macro 'REBOOT()' to restart an S12X system which has a permanently running XGATE thread:

#define STOP_XGATE() {XGMCTL=0x2020; while(XGMCTL_XGDBG==0); XGCHID=0;}
#define REBOOT() {STOP_XGATE(); __asm sei; COPCTL = 0x41; ARMCOP = 0x01; for(;:smileywink:;}

The COP vector points to the startup code:
VECTOR ADDRESS 0xfffa _Startup

Most of the time it works, but sometimes the system restarts again (after one or two seconds). Could this be a problem with the macro above?

Thanks in advance,