K64 how to use the code to do the hot start address from the start address

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

K64 how to use the code to do the hot start address from the start address

600 Views
yibinwang
Contributor I

Dear all,

In my code, I would like to make a hot start function code so i can recall this function in anytime to implement the processor hot restart from start address 0x00000000, just like the watch dog function.

In the hot start function, I would like to use assembly code to jump address 0x00000000. But i am not sure it is the good way for this hot restart function. Would you have any better way to implement this hot restart function? Please let me know.  I will appreciate for your any comments or feedback.
Thanks in advance!

Jerry

0 Kudos
4 Replies

492 Views
gabrielharrison
Contributor III

Hi,

If you are using CMSIS and it is just a software reset you want then NVIC_SystemReset(); will achieve this for you.

/** \brief  System Reset

    The function initiates a system reset request to reset the MCU.

*/

__STATIC_INLINE void NVIC_SystemReset(void)

{

  __DSB();                                                     /* Ensure all outstanding memory accesses included

                                                                  buffered write are completed before reset */

  SCB->AIRCR  = ((0x5FA << SCB_AIRCR_VECTKEY_Pos)      |

                 (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |

                 SCB_AIRCR_SYSRESETREQ_Msk);                   /* Keep priority group unchanged */

  __DSB();                                                     /* Ensure completion of memory access */

  while(1);                                                    /* wait until reset */

}

Gabriel

0 Kudos

492 Views
BlackNight
NXP Employee
NXP Employee

Hi Jerry,

are you asking how to do a software restart/reset? See How to Reset an ARM Cortex-M with Software | MCU on Eclipse .

I hope this helps,

Erich

0 Kudos

492 Views
yibinwang
Contributor I

Hi Erich,

Yes, I want to do a software restart/reset. Would you please share the hyperlink for me on your above mentioned?

Thanks.

Jerry

0 Kudos

492 Views
BlackNight
NXP Employee
NXP Employee

Hi Jerry,

It has the hyperlink in it, here again:

http://mcuoneclipse.com/2015/07/01/how-to-reset-an-arm-cortex-m-with-software/

Erich

0 Kudos