how to goto VECTOR 2

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

how to goto VECTOR 2

跳至解决方案
1,234 次查看
everkimage
Contributor IV

My mcu is MC9S12XE.The Vector 0 is __Startup(),it's the default startup routine.And Vector 2 is __cop_reset_startup(),just like:

byte gb_flag = 0x00;

void __cop_reset_startup(void)

{

   Init();

   gb_flag = 0x55;

   main();

}

In main(),cop is enabled without feeding,after about 1 seconds later,system restart but don't goto __cop_reset_startup(),cause gb_flag == 0x00;

Also i change "VECTOR 2 __cop_reset_startup" to "VECTOR ADDRESS 0xFFFA __cop_reset_startup",result is same.

I debug the project and find that when system restart,PC is equal to 0xFF13.

标签 (1)
0 项奖励
1 解答
1,058 次查看
lama
NXP TechSupport
NXP TechSupport

Hi,

the COP reset vector usage depends on COP reset, COP reset recognition and correct external HW becasue the COP reset recognition depends on timing characteristics of the external reset circuitry.

For more info look at: S12 FAMILY DEVICES COP RECOGNITION CONSIDERATIONS_v2.0.pdf 

If large capacitor is used for reset circuitry then the rising time of the voltage exceeds the time for COP reset recognition and the MCU starts with POR.

BTW, the COP is not debuggable because the MCU losts BDM connection during reset. Better is to use some temporary signal or diode to signalize the COP.

The COP SW example can be found at https://community.nxp.com/docs/DOC-329209 

(XET is a subset device of XEP100 device)

Best regards,

Ladislav

在原帖中查看解决方案

4 回复数
1,059 次查看
lama
NXP TechSupport
NXP TechSupport

Hi,

the COP reset vector usage depends on COP reset, COP reset recognition and correct external HW becasue the COP reset recognition depends on timing characteristics of the external reset circuitry.

For more info look at: S12 FAMILY DEVICES COP RECOGNITION CONSIDERATIONS_v2.0.pdf 

If large capacitor is used for reset circuitry then the rising time of the voltage exceeds the time for COP reset recognition and the MCU starts with POR.

BTW, the COP is not debuggable because the MCU losts BDM connection during reset. Better is to use some temporary signal or diode to signalize the COP.

The COP SW example can be found at https://community.nxp.com/docs/DOC-329209 

(XET is a subset device of XEP100 device)

Best regards,

Ladislav

1,058 次查看
everkimage
Contributor IV

Finally it's ok.

First remove the capacitor,then initialize the SP and MMC before invoke the Init() in function __cop_reset_startup().

0 项奖励
1,058 次查看
everkimage
Contributor IV

I remove the capacitor connected with RESET pin,and change VECTOR 2 to __Startup(),system can reset again and again,but when i change VECTOR 2 to __cop_reset_startup(),system only reset once.

Is there any wrong with function __cop_reset_startup()?

0 项奖励
1,058 次查看
everkimage
Contributor IV

Thanks for your reply very much.

The reset pin of MCU connect with a 100nF capacitor,now i remove it,but still can't goto COP Reset Vector.

The difference is the system always halt after the first timeout of COP.

By the way,the system type out the value of gb_flag every 500ms after system initialization through CAN,and i always see the value 0x00,so i know that the COP Reset didn't happen.

0 项奖励