这个是跳转函数
void loading_program(uint32_t LoadAddress)
{
if (((*(__IO uint32_t*)LoadAddress) & 0x2FFE0000 ) == 0x20000000)/*检查栈顶地址是否合法*/
{
U2_Printf("
M2 Ready to go to the APP!
");
osDelay(50);
/*Debug*/
U2_Printf("Jump Address:0x%08X
", ((*(uint32_t*)LoadAddress) & 0x2FFE0000 ));
osDelay(100);
Disable();
JumpToAddress = (pFunction)*(uint32_t*) (LoadAddress + 4);
MSR_MSP(*(__IO uint32_t*) LoadAddress);
JumpToAddress(); /*跳转app*/
}
else
{
U2_Printf("
M2 Loading APP ERROR!
");
osDelay(50);
U2_Printf("Load Address:0x%08X
", LoadAddress);
osDelay(50);
/*Debug*/
U2_Printf("Jump Address:0x%08X
", ((*(__IO uint32_t*)LoadAddress)&0x2FFE0000));
osDelay(1000);
}
}
跳转打印是这个
M2 Loading APP ERROR!
Load Address:0x08020000
Jump Address:0x28160000
一直无解为什么是这样 |