Problem with Illegal address reset routine - S12XEP100

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Problem with Illegal address reset routine - S12XEP100

跳至解决方案
2,329 次查看
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?

标签 (1)
1 解答
1,625 次查看
mroczeks
Contributor IV

You can also try this way:

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

 

 

Hope it works for you :smileywink:

在原帖中查看解决方案

4 回复数
1,626 次查看
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 项奖励
回复
1,626 次查看
mroczeks
Contributor IV

You can also try this way:

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

 

 

Hope it works for you :smileywink:

1,626 次查看
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 项奖励
回复
1,626 次查看
sep2kor
Contributor III

thank you all.

 

the problem is fixed now.

 

0 项奖励
回复