#stm32f0_iap_config
void IAP_Set(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 0x08002800) to the base address of the SRAM at 0x20000000. */
for (i = 0; i < 48; i++)
{
*((uint32_t*)(0x20000000 + (i << 2))) = *(__IO uint32_t*)(ApplicationAddress + (i << 2));
}
/* Enable the SYSCFG peripheral clock*/
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
/* Remap SRAM at 0x00000000 */
SYSCFG_MemoryRemapConfig(SYSCFG_MemoryRemap_SRAM);
}
- 这段程序是改变中断向量表,stm32f0没有设置中断向量表的函数NVIC_SetVectorTable(NVIC_VectTab_FLASH,VectorTable_Offset);
本文介绍了一段用于STM32F0系列微控制器的代码,该代码实现了中断向量表从Flash到内部SRAM的重定位。通过复制中断向量表,使中断服务能够在SRAM中执行,提高了中断响应速度。同时,文章还提到了SYSCFG外设时钟的启用及SRAM的重映射。
1221

被折叠的 条评论
为什么被折叠?



