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
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!
-----------------------------------------------------------------------------------------------------------------------
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!