Hi,
I am using MK22FN1M0VLL12 part no. from freescale Semiconductor.
I am unable to do software reset.
Can anyone guide me how to do software reset with example?
Thanks in advance.
Solved! Go to Solution.
Hi Mayur,
see https://mcuoneclipse.com/2015/07/01/how-to-reset-an-arm-cortex-m-with-software/
I hope this helps,
Erich
Hi Erich,
My college started the project. I believe it is a processor expert project.
If it is not a SDK project this option is not available?
By the way, how can i know if it is a SDK project or not?
What is the difference?
Thanks and regards
If it has a .pe file in the project root, it is a Processor Expert project.
Erich
Hi Erich
Then it is a processor Expert project but still dont know what is the difference with a SDK project. A SDK project can be made with processor expert too so that .pe file will be there too.
In anyways i wonder why the "Mk22FA12.h" file which is the MCU definition file, doesnt have those definitions in it and if It is a Core part of the Cortex M3/M4 implementation, i cant understand why they are not there.
Why other people with a k22 can make a soft reset that way? are there diferents "Mk22FA12.h" files which include those definitions?
I have had to add all those definitions to its "Mk22FA12.h" file and so far it seems i can make a software reset successfully.
By the way i have follow what it is said in this link How to Reset an ARM Cortex-M with Software | MCU on Eclipse so i can import more components, but after it, i cant find the KIN1 component.
Thanks for your quick responses.
Regards
Hi Alberto,
the KIN1 is from the KinetisTools component you can find in the Components Library:
You can find an overview and discussion about the different project types here:
Overview: Processor Expert | MCU on Eclipse
I hope this helps,
Erich
Hi Erich,
Thanks for the info.
As for the "Mk22FA12.h" file, why arent "SCB_Register_Masks" definitions and "SCB - Peripheral register structure" in the file?
As i said in the previous post:
>>In anyways i wonder why the "Mk22FA12.h" file which is the MCU definition file, doesnt have those definitions in it and if It is a Core part of the Cortex M3/M4 implementation, i cant understand why they are not there.
Why other people with a k22 can make a soft reset that way? are there diferents "Mk22FA12.h" files which include those definitions?
I have had to add all those definitions to a header file and so far it seems i can make a software reset successfully.
Thanks and best regards
Hi Mayur,
see https://mcuoneclipse.com/2015/07/01/how-to-reset-an-arm-cortex-m-with-software/
I hope this helps,
Erich
Hi Erich,
Sometime ago i did a software reset on a K60 with the following line of code:
SCB_AIRCR = (SCB_AIRCR_VECTKEY(0x05FA) | SCB_AIRCR_SYSRESETREQ_MASK);
Now im working with MK22FN1M0AVLL12 but can´t find those definitions in its "Mk22FA12.h" file so im getting an error when i build the project.
I have looked for them with different but similar names but i didn't find them either. I have not found its address either.
How can i do this software reset?
Thanks and best regards
Hi Alberto,
is this a SDK project? If yes, it uses different header files/declarations. I'm using the following:
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 */
}
}
So you need to use that code for the SDK?
Maybe this helps,
Erich