I am using a MCF52259 with mqx 3.8.1. I am trying to use the reset control register to do a software reset, and when I do I get a some weird stack trace (below) and the processor locks up. Location 0x8 hex is the illegal instruction vector address, but I am not using interrupts for this program, and they are disabled. The code runs fine, until the reset where I get these problems.
This is the only code I have for the reset, and its all the manual shows that I should need.
MCF_RCM_RCR |= MCF_RCM_RCR_SOFTRST;
Thanks for any help you might be able to give,
Kevin
3 0x00000008 (0x00000008)() 0x00000008 | |
2 0x20007FFC (0x20007FFC)() 0x20007ffc | |
1 _startup() startup.c:55 0x00000010 |
Solved! Go to Solution.
Hi,
For example, to reset MCF, I use the following code (from www.fnet.sf.net project):
fnet_mcf.c:
void fnet_cpu_reset (void)
{
#if FNET_CFG_MCF_RCM
FNET_MCF_RCM_RCR = FNET_MCF_RCM_RCR_SOFTRST | FNET_MCF_RCM_RCR_FRCRSTOUT;
#else
unsigned long address = *((unsigned long *)(0x4));
(( void(*)() )address)(); /* Jump. */
#endif
}
Hope it will help,
Andrey Butok
I did get it working they was Andrey suggested, but when using the RCR it would never succesfully restart
Hi,
For example, to reset MCF, I use the following code (from www.fnet.sf.net project):
fnet_mcf.c:
void fnet_cpu_reset (void)
{
#if FNET_CFG_MCF_RCM
FNET_MCF_RCM_RCR = FNET_MCF_RCM_RCR_SOFTRST | FNET_MCF_RCM_RCR_FRCRSTOUT;
#else
unsigned long address = *((unsigned long *)(0x4));
(( void(*)() )address)(); /* Jump. */
#endif
}
Hope it will help,
Andrey Butok
I should say that there is a boot loader and an application and I am trying to go back to the bootloader from the application by resetting the chip. So when I say I am not using interrupts I mean in the bootloader.