Force clean K64F processor reboot?

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

Force clean K64F processor reboot?

894 Views
davenadler
Senior Contributor I

After changing some device configurations I'd like to force a reboot,
which requires disabling interrupts but also shutting down any operations in progress (DMA, peripherals,  etc.)
What's a nice clean way to do that in K64F?
Thanks in advance,
Best Regards, Dave

PS: I tried NVIC_SystemReset(); but it doesn't seem to reset all the hardware...

PPS: To clarify: I have common software common for some very different hardware. After initial programming, the software is configured and stores lots of "personality" information in flash. After a change in "personality", all the IO must be re-initialized, so I do a cold-start of the software via NVIC_SystemReset(). I have not found exactly what is not re-initialized, but some of the IO does not work here. After a power-cycle all works perfectly. Hence the question...

Labels (1)
0 Kudos
5 Replies

843 Views
bobpaddock
Senior Contributor III

"some of the IO does not work"

This is an issue with the power down modes, not sure it is relevant here, still worth checking:

if( 0U != ( PMC_REGSC & PMC_REGSC_ACKISO_MASK ) ) /* Acknowledge Isolation */
{
/* PMC_REGSC: ACKISO=1 */
PMC_REGSC |= PMC_REGSC_ACKISO_MASK; /* Release IO pads after wakeup from VLLS mode */
}

0 Kudos

846 Views
davenadler
Senior Contributor I

Thanks @ErichStyger  - Its too late to add a hardware solution with many many units in the field (including most of world's fabs I think) Mostly its just a big annoyance when we initially configure the devices. If I get a chance I'll try the internal watchdog and see if I get any better result. Thanks as always!

0 Kudos

854 Views
ErichStyger
Senior Contributor V

Hi @davenadler ,

The NVIC_SystemReset() is just triggering a forced system reset through the Arm Application Interrupt and Reset Control register (see https://mcuoneclipse.com/2015/07/01/how-to-reset-an-arm-cortex-m-with-software/), but it does not perform a 'clean' reset. For example RAM content and many other register content/values are kept.

I'm not sure, but I believe doing an internal watchdog reset clear more of the peripheral registers, but I'm not 100% positive. In one of my applications I had the need for a 'full and clean' reset, and for the K64F and many other MCUs you only can achieve this with a POR (Power-On-Reset, re-power the MCU). For this I used an external watchdog device connected to a FET, which power-cycles the MCU in such a case.

In another design, I had not added that watchdog device. In that case I have extended my startup code to set all the peripheral register content (and of course RAM) to a defined (reset) state. Maybe this is something you could do as well?

I hope this helps,

Erich

0 Kudos

860 Views
PabloAvalos
NXP TechSupport
NXP TechSupport

Hi @davenadler 

 

Thank you so much for using our community. We are overloaded on the requests these days, so I really appreciate your patience.

 

Regarding your question, may you tell me please what is exactly what you are trying to do? Because it is unclear to me. It comes to my mind that you are trying to do a mass erase from flash, or probably, charge the bootloader again to your MCU, but it is not so clear.

Hope you might help me, please let me know your comments or if you have more questions.

 

Thanks in advance.
Sincerely,
Pablo Avalos

0 Kudos

847 Views
davenadler
Senior Contributor I

@PabloAvalos- I have clarified the original question above; hope it is clear now...

0 Kudos