牛卧堂MCU技术交流

标题: __set_SP(*(uint32_t *)u32Address);有啥作用? [打印本页]

作者: 匿名    时间: 2018-4-4 16:13
标题: __set_SP(*(uint32_t *)u32Address);有啥作用?
#ifdef __ARMCC_VERSION
__asm __INLINE __set_SP(uint32_t _sp)
{
    MSR MSP, r0
    BX lr
}
#endif
__INLINE void BranchTo(uint32_t u32Address)
{
    FUNC_PTR        *func;
    FMC_SetVectorPageAddr(u32Address);
    func = (FUNC_PTR *)(*(uint32_t *)(u32Address + 4));
    printf("branch to address 0x%x\n", (int)func);
    printf("\n\nChange VECMAP and branch to user application...\n");
    while(!IsDebugFifoEmpty());
    __set_SP(*(uint32_t *)u32Address);
    func();
}


请问     __set_SP(*(uint32_t *)u32Address);有啥作用? 可以不要嘛?


作者: jamesliu    时间: 2018-4-9 09:18
取堆栈指针地址,必须要加上的




欢迎光临 牛卧堂MCU技术交流 (http://www.nuvoton-mcu.com/) Powered by Discuz! X3.2