AnsweredAssumed Answered

MK22FN512 使用NXP_Kinetis_Bootloader_2_0_0 跳转APP有时不成功

Question asked by andypeng on Nov 24, 2016

MK22FN512 使用NXP_Kinetis_Bootloader_2_0_0的boot ,然后跳转到APP时,APP有时成功,有时失败。

NXP_Kinetis_Bootloader_2_0_0编译环境:Kinetis Design Studio Version: 3.2.0

NXP_Kinetis_Bootloader_2_0_0程序起始地址:0x0000,

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的时钟我没有修改过。

 

app编译环境:Kinetis Design Studio Version: 3.2.0

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使用的时钟模式为:PEE ,外部晶体为10MHz

NXP_Kinetis_Bootloader_2_0_0启动然后跳转到APP失败时,通过仿真器观察,出错在如下地址处(CPU_Init.c):

 

当APP的程序地址为0x0000时,如下配置时则没有上述的问题。

/* 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
}

附件是APP工程.

NXP_Kinetis_Bootloader_2_0_0的工程是官网下的。

 

 

请问这是什么原因?谢谢!

Original Attachment has been moved to: LED_DEMO.7z.zip

Outcomes