COP Watchdog
11-21-2006
10:07 AM
8,267件の閲覧回数

patti
Contributor I
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi, am using CodeWarrior 4.1 (HCS12) with support for XGATE. Processor MC9S12XDP512.
I am having problems to get my processor to reset/restart after watchdog expires. Notting happens when I enter the infinite loop. What should I do?
Whats wrong?
I am having problems to get my processor to reset/restart after watchdog expires. Notting happens when I enter the infinite loop. What should I do?
Whats wrong?
thanks in advance Patrik
8 返答(返信)
11-28-2006
04:48 PM
1,988件の閲覧回数

J2MEJediMaster
Specialist I
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
The infinite loop is in the the routine _dummyISR, correct? That interrupt routine uses the loop to trap the thread of execution so that the processor doesn't run off into the weeds. When debugging, if you land in _dummyISR, it's because some unanticipated interrupt fired. What to do about a COP interrupt? That depends. If there's a way to recover from the event that delayed the processor (perhaps an I/O routine waiting on a response), you'd put code in the handler to retry the I/O interface. More often the COP signals that something catastrophic happened, and there's no possibility of recovery. In that case, in the vector table you'd just plug the reset interrupt vector into the COP interrupt vector. In other words, if the COP occurs, you reset the processor.
For now, I'd suggest disabling the COP and see if the processor continues to run, or at least hangs in a new location.
---Tom
For now, I'd suggest disabling the COP and see if the processor continues to run, or at least hangs in a new location.
---Tom
11-28-2006
06:28 PM
1,988件の閲覧回数

pIx
Contributor I
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
How do I plug the reset interrupt vector into the COP interrupt vector? I am using codewarrior 4.5 and the interrupt vectors are specified in MC9S12DP512.h.
Suppose I want to enter the ISR of COP, here is what I do:
#ifndef __SMALL__
#pragma CODE_SEG __NEAR_SEG NON_BANKED
#endif
interrupt 2 void COP(){
}
#ifndef __SMALL__
#pragma CODE_SEG DEFAULT
#endif
Please help as I have only half a day to fix the issue or go without the COP feature altogether.
Thanks a million.
Suppose I want to enter the ISR of COP, here is what I do:
#ifndef __SMALL__
#pragma CODE_SEG __NEAR_SEG NON_BANKED
#endif
interrupt 2 void COP(){
}
#ifndef __SMALL__
#pragma CODE_SEG DEFAULT
#endif
Please help as I have only half a day to fix the issue or go without the COP feature altogether.
Thanks a million.
11-28-2006
06:31 PM
1,988件の閲覧回数

pIx
Contributor I
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
The vector Table has COP and RESET etc written in this format:
.....
#define Vcop 0x0000FFFA
#define Vclkmon 0x0000FFFC
#define Vreset 0x0000FFFE
.........
All this is specified in the MC9S12DP512.h file. I tried putting "0x0000FFFE" against Vcop and 0x0000FFFA against Vreset but that did nothing to solve the problem. My controller just shuts down when COP runs out, but fails to restart.
.....
#define Vcop 0x0000FFFA
#define Vclkmon 0x0000FFFC
#define Vreset 0x0000FFFE
.........
All this is specified in the MC9S12DP512.h file. I tried putting "0x0000FFFE" against Vcop and 0x0000FFFA against Vreset but that did nothing to solve the problem. My controller just shuts down when COP runs out, but fails to restart.
11-28-2006
10:36 PM
1,988件の閲覧回数

peg
Senior Contributor IV
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi plx,
To achieve this simply place the same address value that is stored at FFFE:FFFF at FFFA:FFFB.
Regards
Peg
11-29-2006
03:38 PM
1,988件の閲覧回数

J2MEJediMaster
Specialist I
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
In the header file you would simply change
#define Vcop 0x0000FFFA
to
#define Vcop 0x0000FFFE
Leave everything else alone. Don't mess with the reset vector address! You're counting on it to point the the start-up code that properly resets and restarts the processor. If that doesn't work, you need to study the COP registers and see if an interrupt flag bit is being set somewhere that you need to clear. Otherwise, it will keep signaling a COP interrupt and you'll keep spinning in the reset interrupt routine.
---Tom
#define Vcop 0x0000FFFA
to
#define Vcop 0x0000FFFE
Leave everything else alone. Don't mess with the reset vector address! You're counting on it to point the the start-up code that properly resets and restarts the processor. If that doesn't work, you need to study the COP registers and see if an interrupt flag bit is being set somewhere that you need to clear. Otherwise, it will keep signaling a COP interrupt and you'll keep spinning in the reset interrupt routine.
---Tom
Message Edited by J2MEJediMaster on 2006-11-29 09:56 AM
12-01-2006
09:27 PM
1,988件の閲覧回数

pIx
Contributor I
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
That is what I did and all other possible combinations, but nothing worked. I though it may be resultant because my Low voltage reset chip (external to the microcontroller) was causing it and spend some time de-soldering and re-soldering my boards too without any luck.
But, I got a spot on answer from MICHAEL (Freescale technical support) and here is his solution:
"If You are writing in "C" in Codewarrior, go to linker parameter file *.prm for your target device.
Find the line: "VECTOR 0 _Startup" and write two additional lines below that:
VECTOR 1 _Startup /* Clock Monitor fail reset */
VECTOR 2 _Startup /* COP failure reset*/"
Solved all the issues and now when my COP runs out or my clock is shorted, it immedietely resets the controller.
Thanks to everyone who helped....
~Sujith
But, I got a spot on answer from MICHAEL (Freescale technical support) and here is his solution:
"If You are writing in "C" in Codewarrior, go to linker parameter file *.prm for your target device.
Find the line: "VECTOR 0 _Startup" and write two additional lines below that:
VECTOR 1 _Startup /* Clock Monitor fail reset */
VECTOR 2 _Startup /* COP failure reset*/"
Solved all the issues and now when my COP runs out or my clock is shorted, it immedietely resets the controller.
Thanks to everyone who helped....
~Sujith
Message Edited by pIx on 2006-12-0108:28 PM
11-21-2006
11:20 AM
1,988件の閲覧回数
Alban
Senior Contributor II
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi,
You should check that the COP is set as enabled in BDM (Special Single Chip) Mode for it to work with the debugger. Usually the developer disables it not to get COP Reset in step-by-step debugging.
In the stand alone application, you need to check the COP is enabled.
Alban.
You should check that the COP is set as enabled in BDM (Special Single Chip) Mode for it to work with the debugger. Usually the developer disables it not to get COP Reset in step-by-step debugging.
In the stand alone application, you need to check the COP is enabled.
Alban.
11-28-2006
12:41 AM
1,988件の閲覧回数

pIx
Contributor I
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
My microcontroller is also not reseting. It switches itself off but does not come back up. Same is the case with BDM attached and/or disconnected.
WHat could the problem be? Why is there an interrupt vector for COP? What do you need to write inside that interrupt routine?
I have a feeling Patti too is having the same problem. Please clarify and hope one solution solves all problem.
Thanks,
Sujith
