参考了AN4065,上电后从IAP跳转到APP后,正常工作。但是当从APP跳转到IAP(不更新程序)后再直接跳回APP,APP就不能中断了。是什么原因?
// __disable_irq();//关中断
// for(u8 i = 0; i < 48; i++)
// {
// VectorTable[i] = *(__IO uint32_t*)(IAP_ADDRESS + (i<<2));
// }
//
// RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
// SYSCFG_MemoryRemapConfig(SYSCFG_MemoryRemap_Flash );
/* Test if user code is programmed starting from address "APPLICATION_ADDRESS" */
if (((*(__IO uint32_t*)IAP_ADDRESS) & 0x2FFE0000 ) == 0x20000000)
{
/* Jump to user application */
JumpAddress = *(__IO uint32_t*) (IAP_ADDRESS + 4);
Jump_To_Application = (pFunction) JumpAddress;
/* Initialize user application's Stack Pointer */
__set_MSP(*(__IO uint32_t*) IAP_ADDRESS);
/* Jump to application */
Jump_To_Application();
}
还有就是APP跳转到IAP时 需要重映射中断吗,很疑惑。对M0不了解,请教大家 |