Hi,
We have recently got a MPC5606B_trk board , and I have a application code compiled from codewarrier which meant to blink a LED. I am using RappId bootloader to flash the xxx.mot file to board. As soon as I flash it is started blinking the LED. When when I do the reset(power cycle) it is not running.
What could be the issue. ??
NOTE:
The code is built for FLASH.
Thanks,
Solved! Go to Solution.
Hi,
I did quick test with your mot file and the result is that it is caused by SWT watchdog. I can see that F_SWT flag is set in RGM_DES register. If I attach debugger and stop execution before first watchdog time-out, debugger automatically disables the watchdog and when I run the code again, it works and the LED is blinking. If I don't do that, the device is periodically reset by SWT.
It is possible that you call DisableWatchdog() too late. Try to call it before all initialization. I'm not familiar with Rappid Init but I guess that it is possible to disable watchdog also in Rappid initialization.
Regards,
Lukas
Hi,
first thing that comes into my mind - have you disabled watchdog? Try to add this function to your project:
void DisableWatchdog(void)
{
SWT.SR.R = 0x0000c520; /* Write keys to clear soft lock bit */
SWT.SR.R = 0x0000d928;
SWT.CR.R = 0x8000010A; /* Clear watchdog enable (WEN) */
}
Does it work now? If not, could you attach the *.mot file?
Regards,
Lukas
Hi Lukas,
Thanks for your response.
I tried add DisableWatchdog() and called inside main. But still didn't work.
Let me give some idea about what i am doing..
i am just trying to run a simple LED app to get hands on MPC5606B. I used rappid init to gennerate the code and I configured only the GPIO pheripheral and GPIO interrupt. I Disabled everything else including watchdog .
I compiled the code in codewarrier and used Rappid bootloader to load the xxx.mot file into the Board. I am choosing default password in Rappid bootloader and didn't touch the password registers. It is fresh Board.
What I am facing:::
When I flash the code using the serial cable , as soon as the flashing is finished I am able to see the LED blinking . Now i changed the Boot jumbers to boot from the flash and resetted the Board. But It doesn't Boot now.. This is where I stuck.. Attaching the xx.mot file.
Thanks ,
Dhinesh R
Hi,
I did quick test with your mot file and the result is that it is caused by SWT watchdog. I can see that F_SWT flag is set in RGM_DES register. If I attach debugger and stop execution before first watchdog time-out, debugger automatically disables the watchdog and when I run the code again, it works and the LED is blinking. If I don't do that, the device is periodically reset by SWT.
It is possible that you call DisableWatchdog() too late. Try to call it before all initialization. I'm not familiar with Rappid Init but I guess that it is possible to disable watchdog also in Rappid initialization.
Regards,
Lukas
Thanks Lukas,
That worked. Saved my day.