1/flash page 和 stm103 一样
2/启动偏移重映射说明
在对STM32F1/F2/F3/F4/F0几个系列的芯片作IAP应用时,F0系列跟其它系列不一样,它没有中断矢量定义寄存器SCB_VTOR,所以在相应的用户APP代码开始处要先做SYSCFG外设时钟的使能开启和中断矢量的拷贝操作。相关参考代码如下:
M0 核心初始化代码如下:
int main(void)
{
uint32_t i = 0;
/* Relocate by softwarethe vector table to the internal SRAM at 0x20000000 ***/
/* Copy the vector table from the Flash(mapped at the base of the application
loadaddress APPLICATION_ADDRESS) to the base address of the SRAM at 0x20000000. */
for(i = 0; i < 48; i++)
{
VectorTable[i] = *(__IOuint32_t*) (APPLICATION_ADDRESS + (i<<2));
}
/* Enable the SYSCFG peripheral clock*/
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
/* Remap SRAM at 0x00000000 */
SYSCFG_MemoryRemapConfig(SYSCFG_MemoryRemap_SRAM);
/****************下面书写你的应用代码 **********************/
其它操作跟其它几个系列一样,该怎么操作怎么操作。
3/
SCB->VTOR = FLASH_BASE | 0x10000;
表示中断向量表的起始地址为0X08010000,STM32的IROM1起始地址一般为0X08000000,这里的0x10000(64K)为Bootloader所占空间大小。STM32中flash 的大小为1M,则剩余空间为0X100000-0X10000=0XF0000(960K字节)