IAP例程求助
发布: 2009-6-29 19:37 | 作者: archsb | 来源: StmFans思蜕盟 OPELC 自由电子联盟
我按IAP的例程自己编了个自举程序。但只能带开发机时正常运行(可以烧用户应用程序)。撤掉开发机就无法运行烧录程序了(即与超级终端不通讯)。我看程序main.c时有一处看不懂,请大家指教:
int main(void)
{
#ifdef DEBUG
debug();
#endif
/* Flash unlock */
FLASH_Unlock();
Push_Button_Config();
/* Test if Key push-button on STM3210x-EVAL Board is pressed */
if (Push_Button_Read() == 0x00)
{ /* If Key is pressed */
/* Execute the IAP driver in order to re-program the Flash */
IAP_Init();
SerialPutString("\r\n**************************Copyright (c)*******************************");
SerialPutString("\r\n* 哈 尔 滨 科 技 发 展 有 限 公 司 *");
SerialPutString("\r\n* 基 础 开 发 部 *");
SerialPutString("\r\n* *");
SerialPutString("\r\n* In-Application Programming Application (Version 1.00) *");
SerialPutString("\r\n* *");
SerialPutString("\r\n* 南 岗 区 先 锋 路 号 *");
SerialPutString("\r\n* 电话: *");
SerialPutString("\r\n* *");
SerialPutString("\r\n* 作 者 : *");
SerialPutString("\r\n* *");
SerialPutString("\r\n**********************************************************************");
SerialPutString("\r\n\r\n");
Main_Menu ();
}
/* Keep the user application running */
else
{
NVIC_SETPRIMASK(); //disable all system interrupts
/* Test if user code is programmed starting from address "ApplicationAddress" */
if (((*(vu32*)ApplicationAddress) & 0x2FFE0000 ) == 0x20000000) ******此条没看懂*******
{ /* Jump to user application */
JumpAddress = *(vu32*) (ApplicationAddress + 4);
Jump_To_Application = (pFunction) JumpAddress;
/* Initialize user application's Stack Pointer */
__MSR_MSP(*(vu32*) ApplicationAddress);
Jump_To_Application();
}
}
while (1) ***********此处看来自举只能运行1次,到这就死循环了**************
{}
}
if (((*(vu32*)ApplicationAddress) & 0x2FFE0000 ) == 0x20000000) 此处 & 0x2FFE0000 是什么意思,== 0x20000000又是什么意思。。是否应当和0x08003000有关呢? 谢谢大家指教。。。
int main(void)
{
#ifdef DEBUG
debug();
#endif
/* Flash unlock */
FLASH_Unlock();
Push_Button_Config();
/* Test if Key push-button on STM3210x-EVAL Board is pressed */
if (Push_Button_Read() == 0x00)
{ /* If Key is pressed */
/* Execute the IAP driver in order to re-program the Flash */
IAP_Init();
SerialPutString("\r\n**************************Copyright (c)*******************************");
SerialPutString("\r\n* 哈 尔 滨 科 技 发 展 有 限 公 司 *");
SerialPutString("\r\n* 基 础 开 发 部 *");
SerialPutString("\r\n* *");
SerialPutString("\r\n* In-Application Programming Application (Version 1.00) *");
SerialPutString("\r\n* *");
SerialPutString("\r\n* 南 岗 区 先 锋 路 号 *");
SerialPutString("\r\n* 电话: *");
SerialPutString("\r\n* *");
SerialPutString("\r\n* 作 者 : *");
SerialPutString("\r\n* *");
SerialPutString("\r\n**********************************************************************");
SerialPutString("\r\n\r\n");
Main_Menu ();
}
/* Keep the user application running */
else
{
NVIC_SETPRIMASK(); //disable all system interrupts
/* Test if user code is programmed starting from address "ApplicationAddress" */
if (((*(vu32*)ApplicationAddress) & 0x2FFE0000 ) == 0x20000000) ******此条没看懂*******
{ /* Jump to user application */
JumpAddress = *(vu32*) (ApplicationAddress + 4);
Jump_To_Application = (pFunction) JumpAddress;
/* Initialize user application's Stack Pointer */
__MSR_MSP(*(vu32*) ApplicationAddress);
Jump_To_Application();
}
}
while (1) ***********此处看来自举只能运行1次,到这就死循环了**************
{}
}
if (((*(vu32*)ApplicationAddress) & 0x2FFE0000 ) == 0x20000000) 此处 & 0x2FFE0000 是什么意思,== 0x20000000又是什么意思。。是否应当和0x08003000有关呢? 谢谢大家指教。。。
