AnsweredAssumed Answered

Reset from RAM vs Reset from ROM

Question asked by jimzhang on Mar 3, 2017
Latest reply on Mar 16, 2017 by jimzhang

Test MCU:   MK20DN512VLK10

 

sbloader_finalize() will reset ecm after flashing:

 

status_t sbloader_finalize()
{

   assert(g_bootloaderContext.memoryInterface->flush);

 

if (s_loaderContext.bootCmd.tag == ROM_JUMP_CMD)
{

    //jump to applciation

}

else if (s_loaderContext.bootCmd.tag == ROM_RESET_CMD)
{
    // Prepare for shutdown.
    shutdown_cleanup(kShutdownType_Reset);

    NVIC_SystemReset();
    / / Does not get here.
    assert(0);

   // We should never get here, so return an error if we do
   return kStatusRomLdrResetReturned;
}

}

 

If the above code is executed from ROM, target is reset properly.

If the same code is executed from RAM, target keeps resetting

 

What more cleanup needs to be done when board is reset from RAM?

 

Thanks,

 

Jim

Outcomes