Problem with Illegal address reset routine - S12XEP100

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

Problem with Illegal address reset routine - S12XEP100

Jump to solution
1,204 Views
sep2kor
Contributor III

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?

Labels (1)
1 Solution
500 Views
mroczeks
Contributor IV

You can also try this way:

void Reset() {
    static dword val;
    val = *(dword * __far)0x00600000;
}

 

 

Hope it works for you :smileywink:

View solution in original post

4 Replies
501 Views
kef
Specialist I

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 )  { }

0 Kudos
501 Views
mroczeks
Contributor IV

You can also try this way:

void Reset() {
    static dword val;
    val = *(dword * __far)0x00600000;
}

 

 

Hope it works for you :smileywink:

501 Views
jsmcortina
Contributor III

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

0 Kudos
501 Views
sep2kor
Contributor III

thank you all.

 

the problem is fixed now.

 

0 Kudos