Is there a software reset on KL24z?

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

Is there a software reset on KL24z?

1,274 Views
mikeconover
Contributor II

Is there a way to reset the KL24z processor through software?

I have a problem where my state machine gets hung up in a certain state. I tried adding a timer and when the timer expires, I try to switch the state. This didn't seem to help so I was wondering if there was a way to reset the processor when this timer expires. I am using MQX lite so I wonder if it is getting stuck in idle task.

Thanks,

Mike

0 Kudos
Reply
6 Replies

1,056 Views
BlackNight
NXP Employee
NXP Employee

Hi Mike,

I'm using the SoftwareReset() function of the KinetisTools component (available on SourceForge: McuOnEclipse - Browse /PEx Components at SourceForge.net)

pastedImage_0.png

The function is implemented like this:

void KIN1_SoftwareReset(void)

{

  /* generic way to request a reset from software for ARM Cortex */

  SCB_AIRCR = SCB_AIRCR_VECTKEY(0x5FA) | SCB_AIRCR_SYSRESETREQ_MASK;

  for(;;) {

    /* wait until reset */

  }

}

The SCB_AIRCR register can be used to reset the device.

Erich

0 Kudos
Reply

1,056 Views
mikeconover
Contributor II

Erich,

Thanks for this. For the Kinetis Tools component, do I need to enable the shell in order for the software reset to work?

Also, do you think doing a software reset is a better solution then using a watchdog timer? I tried getting the watchdog timer to work the past two days, but I haven't been successful.

Thanks,

Mike

0 Kudos
Reply

1,056 Views
BlackNight
NXP Employee
NXP Employee

You do not need the shell for this.

And yes, this is a better approach than using the watchdog, as you do not need to wait until the watchdog expires.

Erich

0 Kudos
Reply

1,056 Views
mikeconover
Contributor II

This software reset isn't like a power on reset? I switch clock configurations when first powered. Where does this software reset take me to in the code?

For my application, when the processor is first powered, I go through a state machine and then put the processor to sleep. Then, wake up a minutes later, go through the state machine again and then go back to sleep. When I call the software reset, it doesn't take me back to the beginning of the state machine, it takes me to the sleep state and it seems like the sleep counter isn't working.

Thanks,

Mike

0 Kudos
Reply

1,056 Views
mikeconover
Contributor II

Actually, I don't think a software reset or a watchdog will work for my application. Unless, you are able to keep a GPIO line high during the reset. Do you know if that is possible?

Thanks,

Mike

0 Kudos
Reply

1,056 Views
BlackNight
NXP Employee
NXP Employee

Hi Mike,

you will need an external pull-up resistor on such a pin.

Erich

0 Kudos
Reply