STM32F0 系列IAP升级笔记

注意:F0系列在app工程中需要添加中断偏移函数,在MDK中要修改偏移地址,IROM1和IRAM1;

具体移植文件请参考我之前发布的iap教程,此处只做区分笔记;

1、IAP程序:

 

2、app程序

#define  APPLICATION_ADDRESS			((uint32_t)0x08003000)			//application load address  
#define  SRAM_ADDRESS							((uint32_t)0x20000000)			// Relocate by software the vector table to the internal SRAM at 0x20000000



void bsp_iapAppInit(void)
{
   uint32_t i = 0;
	/* 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++)
  {
    *((uint32_t*)(SRAM_ADDRESS + (i << 2))) = *(__IO uint32_t*)(APPLICATION_ADDRESS + (i<<2));
	}
	
   /* Enable the SYSCFG peripheral clock*/
  __HAL_RCC_SYSCFG_CLK_ENABLE(); 
  /* Remap SRAM at 0x00000000 */
  __HAL_SYSCFG_REMAPMEMORY_SRAM();

}

 

 

 

bin文件生成:

E:\XXXXXXX\Keil_v5\ARM\ARMCC\bin\fromelf.exe --bin -o $L@P.bin #L

3、时钟配置:IAP的时钟必须要和APP的时钟一致,否则iap跳转到app时有可能会失败;

  • 4
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值