how to goto VECTOR 2

cancel
Showing results for 
Search instead for 
Did you mean: 

how to goto VECTOR 2

Jump to solution
205 Views
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.

Labels (1)
0 Kudos
1 Solution
29 Views
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

View solution in original post

4 Replies
30 Views
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

View solution in original post

29 Views
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 Kudos
29 Views
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 Kudos
29 Views
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 Kudos