Hi @bobpaddock
1) I followed the below link
https://mcuoneclipse.com/2017/07/12/getting-started-rom-bootloader-on-the-nxp-frdm-kl03z-board/
and
I called bootloader from application with the following piece of code:
static void RunRomBootloader(void) {
uint32_t runBootloaderAddress;
void (*runBootloader)(void *arg);
/* Read the function address from the ROM API tree. */
runBootloaderAddress = **(uint32_t **)(0x1c00001c);
runBootloader = (void (*)(void * arg))runBootloaderAddress;
/* Start the bootloader. */
runBootloader(NULL);
}
But the problem is after reset the board its always be in bootloader mode only, its not entering the application. I waited 1 or 2 min also. Will you please guide me what is wrong with the process. and Where exactly I need to call this function.
2) I want to trying the process what you previously showed the solution, Actually I have startup_MKL27Z644.s file for vectors, can I place the below code in this file or do I need to create my own vectors.c file ?
static void vectors_bootloader_mr_setup( void ) __attribute__( ( used, __aligned__( 4U ), section( ".after_vectors" ) ) );
static void vectors_bootloader_mr_setup( void )
{
/*
* RCM_MR Indicates the boot source, the boot source remains set
* until the next System Reset or software can write logic one to
* clear the corresponding mode bit. While either bit is set the
* NMI input is disabled and the vector table is relocated to the
* ROM base address at 0x1C00_0000. These bits should be cleared by
* writing logic one before executing any code from either Flash or
* SRAM.
*
* A reset is forced to clear out anything that the ROM
* bootloader did, so we are sure we have the data sheet reset
* values.
* This method works around the buggy KL43/27/17 bootloaders as
* described in: "Problem Analysis and solutions for booting from
* ROM BOOTLOADER in KL series".
*/
if( 0U != ( RCM_MR & RCM_MR_BOOTROM_MASK ) )
{
RCM_MR = RCM_MR_BOOTROM_MASK; /* Clear the bits that indicated a bootloader boot via ROM */
RCM_FM = 0U; /* Boot from Flash not ROM on next reset */
SCB_AIRCR = ( SCB_AIRCR_VECTKEY( 0x05FAU ) | SCB_AIRCR_SYSRESETREQ_MASK ); /* Force a Software Reset */
}
}
Thanks in advance,
Regards,
Ravikumar