1 前言
在使用F0的片子在增加IAP后,我们经常发现,原来的APP必须增加一段代码,将中断向量表从内部FLASH拷贝到SRAM后再执行REMAP到SRAM,这样操作后APP才能正常运行,这一过程一直困扰着蝶粉们,为什么需要这样呢?本文将针对这一问题为大家解惑。
2 问题详细描述
比如F0的下面这部分代码:
#define APPLICATION_ADDRESS (uint32_t)0x08004000
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
#if (defined ( __CC_ARM ))
__IO uint32_t VectorTable[48] __attribute__((at(0x20000000)));
#elif (defined (__ICCARM__))
#pragma location = 0x20000000
__no_init __IO uint32_t VectorTable[48];
#elif defined ( __GNUC__ )
__IO uint32_t VectorTable[48] __attribute__((section(".RAMVectorTable")));
#endif
int main(void)
{
uint32_t i = 0;
HAL_Init();
/* Configure the system clock to 48 MHz *