I want to perform a software reset with a MCF52259 using following code:
MCF_RCM_RCR = MCF_RCM_RCR_SOFTRST | MCF_RCM_RCR_FRCRSTOUT;
After this command the coldfire "hangs": It does not restart and there is even no reaction on a further hardware reset. Just disconnecting the power supply reactivates the controller.(The same command works with a MCF52211.)
I am using a M52259DEMOMCU Board for this test.
I have also tryed to perform a reset using the Backup Watchdog Timer - with the same result.
Any ideas?
解決済! 解決策の投稿を見る。
I find the reset sequence works fine if not running under the debugger/BDM. If I execute the reset sequence under the debugger/BDM, I have to remove power from the board as you say.
On our target boards (with no BDM), the sequence always works fine.
On your M52269DEMOMCU, if you remove the debugger cable (USB-B) and power the board from the USB mini-B only, does the reset sequence work?
-- Rich
I find the reset sequence works fine if not running under the debugger/BDM. If I execute the reset sequence under the debugger/BDM, I have to remove power from the board as you say.
On our target boards (with no BDM), the sequence always works fine.
On your M52269DEMOMCU, if you remove the debugger cable (USB-B) and power the board from the USB mini-B only, does the reset sequence work?
-- Rich
I am having the same problem with a reset hangup and I am not using a Freescale board. I am using our own design, runnning without any debugger connected.
I have tried both the Software Watchdog and the Backup Watchdog Timer and in both case, the system will reset if the
watchdog times out but it will not recover from the reset. Even pulsing the Reset line will not reset.
If anyone has any ideas I would greatly appreciate it.
Hi Jeff,
What are you setting your CLKMOD[1:0] pins to?
Do you have a 10kohm pull-up on the ColdFire XTAL?
Did you initialize the ICR08 register?
Did you unmask the URML mask8 (bit 9)?
Here is what I found on my M52259EVB which lets me play around with many option running code to initialize core watchdog
BOOTCLK XTAL Result
00 1 boots OK but doesn't recover from WDT or reset button
00 0 No boot in bypass mode as I don't have clock for this mode
01 1 OK
01 0 OK
10 1 OK
10 0 No boot in bypass mode as I don't have clock for this mode
11 1 OK
11 0 OK
OK = Power On Reset work.....Watchdog timer interrupt called where I do a software reset of MCU and that works, and reset button works
Weird part is if I comment out the ICR08 and masking of the IMRL for watchdog, then
BOOTCLK XTAL Result
00 1 boots OK but doesn't recover from WDT BUT does recover with reset button
I've attached the main.c file with the source code and basically added the above comments to the code.
Regards,
David
Well this blows. Guess what mode I'm using. Which is the same mode used on the MCF52259DEMO.
if you comment out the ICR08 and IMRL, how are you getting to the WDT ISR?
Could you post your WDT Interrupt service routine?
David, have you tried this with the BWT?
If anyone else is interested I have found a solution.
My projects has the CLKMOD1,0 strapped to boot with the relaxation osc turn on and the pll turned off.
During startup I switch to the external crystal oscillator and turn the pll on. I thought that when a WDT reset occurs that
maybe there is some contention with the external oscillator running and the relaxation trying to turn on. I did notice that when the reset occured that I lost system clock. Anyway, I added some code in my WDT isr to switch the clock back to
the relaxation oscillator before issuing the reset request. and it is working.
Here is the code I used.
void WDT_ISR(void)
{
uint32 Count;
MCF_SCM_CWCR = 3; // clear interrupt flag
MCF_CLOCK_OCHR = 0x80; //turn on relaxation osc
MCF_CLOCK_CCLR = 0x01; //switch to relaxation
MCF_CLOCK_OCLR &= 0x7F; //turn off crystal
MCF_CLOCK_SYNCR &= ~(MCF_CLOCK_SYNCR_CLKSRC | MCF_CLOCK_SYNCR_PLLEN);// disable and turn off pll
for (Count = 14968; Count > 0; Count--) // 1mS delay
{
}
// set the soft reset bit
MCF_RCM_RCR |= MCF_RCM_RCR_SOFTRST;// request software reset
}
Unfortunately this cannot be done when using the BWT.
Hope this helps someone else.
Just thought I'd post up and say that I've just had this problem and Jeff's post above does indeed fix it, thanks Jeff!
Good day All,
Indeed, I am having the same problem as Jeff in regards to the BWT. Thankfully, his fix for the WDT does work... Thanks a lot Jeff for posting!
I am somewhat disappointed with Freescale in that there has been no errata on this (CLKMod 1:0 pulled low, XTAL high hsa problems with BWT and WDT)... Personally I think that it is quite important and should at least warrant an errata item in order to save someone a bunch of time on this issue...
Cheers,
Sam
Hi Rich,
thank you for your prompt reply.
Due to unknown reasons, the software reset blocks on my M52259DEMO Board, even if I power it from J7 (or from USB mini-B).
But according to your suggestions i tryed the same on a M52259EVB Board - and here it works!
There seems to be a hardware problem with the OSBDM interface (or with my DEMO Board). But since we will not have such a interface on our target board the problem is solved for me (Although I will try to find the reason, why it does not work on my DEMO Board)
Thanks:
Markus