I use the device MK22FN512,want using boot NXP_Kinetis_Bootloader_2_0_0, jump to APP, but APP sometimes successful, sometimes failure.
NXP_Kinetis_Bootloader_2_0_0 compiler environment: Kinetis Design Studio Version: 3.2.0
NXP_Kinetis_Bootloader_2_0_0 program start address: 0x0000,
The following is the address configuration:
MEMORY
{
m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000400
m_flash_config (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010
m_text (RX) : ORIGIN = 0x00000410, LENGTH = 0x0007FBF0
m_data (RW) : ORIGIN = 0x1FFF0000, LENGTH = 0x00020000
}
NXP_Kinetis_Bootloader_2_0_0 clock I have not modified.
APP compiler environment: Kinetis Design Studio Version: 3.2.0
the following is the address configuration for APP:
/* Entry Point */
ENTRY(__thumb_startup)
/* Highest address of the user mode stack */
_estack = 0x20010000; /* end of m_data */
__SP_INIT = _estack;
__stack = _estack;
/* Generate a link error if heap and stack don't fit into RAM */
__heap_size = 0x00; /* required amount of heap */
__stack_size = 0x0400; /* required amount of stack */
MEMORY {
m_interrupts (RX) : ORIGIN = 0x0000A000, LENGTH = 0x00000198
m_text (RX) : ORIGIN = 0x0000A410, LENGTH = 0x00075BF0
m_data (RW) : ORIGIN = 0x1FFF0000, LENGTH = 0x00020000
m_cfmprotrom (RX) : ORIGIN = 0x0000A400, LENGTH = 0x00000010
}
APP uses the clock mode: PEE, the external crystal is 10MHz
From the NXP_Kinetis_Bootloader_2_0_0 start and then jump to the APP failed, through the emulator to observe, the error at the following address (CPU_Init.c):


When the APP program address is 0x0000, the following configuration does not have the above problem.
/* Entry Point */
ENTRY(__thumb_startup)
/* Highest address of the user mode stack */
_estack = 0x20010000; /* end of m_data */
__SP_INIT = _estack;
__stack = _estack;
/* Generate a link error if heap and stack don't fit into RAM */
__heap_size = 0x00; /* required amount of heap */
__stack_size = 0x0400; /* required amount of stack */
MEMORY {
m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000198
m_text (RX) : ORIGIN = 0x00000410, LENGTH = 0x00075BF0
m_data (RW) : ORIGIN = 0x1FFF0000, LENGTH = 0x00020000
m_cfmprotrom (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010
}
The following is a APP clock configuration:




APP project on attachment .
How is the cause of this problem?
Thanks & regards
Andy ,China
Original Attachment has been moved to: LED_DEMO.7z.zip