新手上路
- 积分
- 28
- 金钱
- 28
- 注册时间
- 2017-7-24
- 在线时间
- 7 小时
|
发表于 2017-7-26 10:06:34
|
显示全部楼层
好了,
加了一句SCB->VTOR=ApplicationAddress;在IAP程序跳转之前的程序里面,但是没道理啊,我在APP程序里面加了这一句了,我把我可以的程序贴上来看看
void vfnExtiIap(void)
{
int i;
unsigned long int JumpAddress;
pFunction JumpToApplication;
if(((*(volatile unsigned long int *)ApplicationAddress)&0x2fff0000)==0x20000000)
{
JumpAddress=*(volatile unsigned long int *)(ApplicationAddress+4);
JumpToApplication=(pFunction)JumpAddress;
SCB->VTOR=ApplicationAddress;
__set_BASEPRI(0);
__set_FAULTMASK(0);
__set_PSP(*((volatile unsigned long int *)ApplicationAddress)); //重新设置进程PSP堆栈地址
__set_MSP(*((volatile unsigned long int *)ApplicationAddress));
__set_CONTROL(0);
__ISB();
__disable_irq();
JumpToApplication();
}
} |
|