Hi,
you can use this function to reset MCU by software:
//-----------------------------------------------------------------------------
// FUNCTION: Cpu_SystemReset
// SCOPE: Bootloader application system function
// DESCRIPTION: Force a system reset
//-----------------------------------------------------------------------------
void Boot_Cpu_SystemReset(void)
{
/* SCB_AIRCR: VECTKEY=0x05FA,SYSRESETREQ=1 */
SCB_AIRCR = (uint32_t)((SCB_AIRCR & (uint32_t)~(uint32_t)(
SCB_AIRCR_VECTKEY(0xFA05)
)) | (uint32_t)(
SCB_AIRCR_VECTKEY(0x05FA) |
SCB_AIRCR_SYSRESETREQ_MASK
)); /* Request system reset */
while(1) { /* Wait until reset */
}
this part of code is used in demo:
Kinetis Bootloader to Update Multiple Devices in a Network - for Cortex-M0+
can this help you?
Have a great day,
Jennie Zhang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------