控制/MCU
bootloader设置:
static void check_boot_mode(void)
{
uint32_t JumpAddress;
void(*Jump_To_Application)(void);
if (((*((__IO uint32_t*)(APP_SEGA_START_ADDRESS+8))) & 0x2FFE0000 ) == 0x20000000)
{
JumpAddress = *(__IO uint32_t*) (APP_SEGA_START_ADDRESS + 12);
Jump_To_Application = (void *)JumpAddress;
__set_MSP(*((__IO uint32_t*) (APP_SEGA_START_ADDRESS+8)));
Jump_To_Application();
}
}
application设置:
const uint8_t eh[8] __attribute__((at(0x08004000)));这个是使应用代码加载首地址向后推移8字节;
下图是应用代码加载地址和内存设置:
下面是中断向量表映射配置:
#define APPLICATION_ADDRESS (uint32_t)0x08004008
__IO uint32_t VectorTable[48] __attribute__((at(0x20000000)));
for(i = 0; i 《 48; i++)
{
VectorTable[i] = *(__IO uint32_t*)(APPLICATION_ADDRESS + (i《《2));
}
全部0条评论
快来发表一下你的评论吧 !