hello
I am having some problem in executing the reset routine in S12XEP100 target.
I have the below piece of code to execute an illegal address routine....but it seems to me that the code is not working properly.
( * ( Mcu_ByteRegisterPtrType ) ( ( 0x0 ) + ( 0x10 ) ) ) . UC = 0x60 ;
{
__asm ( "GLDAB 0, X" ) ;
}
Can anyone help me?
Solved! Go to Solution.
You can also try this way:
void Reset() {
static dword val;
val = *(dword * __far)0x00600000;
}
Hope it works for you
1) Is MCU operating in single chip mode? As you may know, there are no illegal addresses in expanded modes.
2) Isn't memory protection unit (MPU) setup to trigger error on access to 0x600000'G? Try disabling MPU configuration steps and see if that makes ILAD reset working.
P.S. Are you using Codewarrior? This line should do the same what your code is doing
if( *(volatile char * far)0x600000ul ) { }
You can also try this way:
void Reset() {
static dword val;
val = *(dword * __far)0x00600000;
}
Hope it works for you
Another technique to cause a reset is to enable COP and then sit in a busy loop without writing the flags. The COP will timeout and cause your desired reset.
James
thank you all.
the problem is fixed now.