And just in case: attached the KinetisTools component which can do this both for Kinetis SDK and non-SDK projects
void KIN1_SoftwareReset(void)
{
/* Generic way to request a reset from software for ARM Cortex */
/* See https://community.freescale.com/thread/99740
To write to this register, you must write 0x5FA to the VECTKEY field, otherwise the processor ignores the write.
SYSRESETREQ will cause a system reset asynchronously, so need to wait afterwards.
*/
#if KIN1_IS_USING_KINETIS_SDK
SCB->AIRCR = (0x5FA<<SCB_AIRCR_VECTKEY_Pos)|SCB_AIRCR_SYSRESETREQ_Msk;
#else
SCB_AIRCR = SCB_AIRCR_VECTKEY(0x5FA) | SCB_AIRCR_SYSRESETREQ_MASK;
#endif
for(;;) {
/* wait until reset */
}
}
Erich
Hi Bernard,
This is a generic way for ARM Cortex to perform a software reset:
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 */
}
}
If you are using Processor Expert: that functionality/function is present in the 'KinetisTools' component:
available on SourceForge (see McuOnEclipse Releases on SourceForge | MCU on Eclipse).
Erich
And just in case: attached the KinetisTools component which can do this both for Kinetis SDK and non-SDK projects
void KIN1_SoftwareReset(void)
{
/* Generic way to request a reset from software for ARM Cortex */
/* See https://community.freescale.com/thread/99740
To write to this register, you must write 0x5FA to the VECTKEY field, otherwise the processor ignores the write.
SYSRESETREQ will cause a system reset asynchronously, so need to wait afterwards.
*/
#if KIN1_IS_USING_KINETIS_SDK
SCB->AIRCR = (0x5FA<<SCB_AIRCR_VECTKEY_Pos)|SCB_AIRCR_SYSRESETREQ_Msk;
#else
SCB_AIRCR = SCB_AIRCR_VECTKEY(0x5FA) | SCB_AIRCR_SYSRESETREQ_MASK;
#endif
for(;;) {
/* wait until reset */
}
}
Erich
In fact, the use of kinetis tools make some instability inside my project after adding ksdk component.
I will try again with the new KDS3!
For now, I reboot the app with timeout watchdog. It's not really the best solution, but it works.