MCF52259 Software Reset Problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MCF52259 Software Reset Problem

Jump to solution
1,337 Views
kdavis
Contributor III

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
Labels (1)
Tags (2)
0 Kudos
Reply
1 Solution
1,057 Views
butok
NXP Employee
NXP Employee

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

View solution in original post

0 Kudos
Reply
3 Replies
1,057 Views
kdavis
Contributor III

I did get it working they was Andrey suggested, but when using the RCR it would never succesfully restart

0 Kudos
Reply
1,058 Views
butok
NXP Employee
NXP Employee

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

0 Kudos
Reply
1,057 Views
kdavis
Contributor III

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.

0 Kudos
Reply