Reset from RAM vs Reset from ROM

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

Reset from RAM vs Reset from ROM

599 Views
imx_proc_user
Contributor I

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

0 Kudos
2 Replies

458 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi

The Kinetis product always boot from internal Flash(ROM).

When the code run in RAM with NVIC_SystemReset();, which will software reset the K20.

The K20 will reboot to execute the code from internal Flash.

If Flash doesn't with available code/instruction, the K20 internal watchdog will work to reset the chip periodically.


Wish it helps.

Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

458 Views
imx_proc_user
Contributor I

Yes, that was it. In the .bd file, I was loading the flash image to 0xa00. Once I changed to 0x000, it works now.

Thank you very much for the answer!

0 Kudos