本帖最后由 wangzhihai1986 于 2014-10-28 17:17 编辑
ST提供的STM32F0xx_AN4065_FW_V1.0.0例程,用串口进行IAP升级的。其中有部分代码是错误的。如下 :
/* Relocate by software the vector table to the internal SRAM at 0x20000000 ***/
/* Copy the vector table from the Flash (mapped at the base of the application
load address 0x08003000) to the base address of the SRAM at 0x20000000. */
for(i = 0; i < 48; i++)
{
VectorTable = *(__IO uint32_t*)(APPLICATION_ADDRESS + (i<<2));
}
/* Enable the SYSCFG peripheral clock*/
RCC_APB2PeriphResetCmd(RCC_APB2Periph_SYSCFG, ENABLE);
/* Remap SRAM at 0x00000000 */
SYSCFG_MemoryRemapConfig(SYSCFG_MemoryRemap_SRAM);
应改为:RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE); |