S12X system reboots twice

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S12X system reboots twice

1,899 Views
pittbull
Contributor III
Hello,
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,
pittbull
Labels (1)
0 Kudos
1 Reply

389 Views
pittbull
Contributor III
Hi again,
The problem is gone. Those macros were definitely *not* guilty :smileywink:
0 Kudos