找回密码
 立即注册

QQ登录

只需一步,快速开始

打印 上一主题 下一主题
开启左侧

[NUC] __set_SP(*(uint32_t *)u32Address);有啥作用?

[复制链接]
跳转到指定楼层
楼主
匿名  发表于 2018-4-4 16:13:51 回帖奖励 |倒序浏览 |阅读模式
#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);有啥作用? 可以不要嘛?

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 顶 踩
回复

使用道具

沙发
jamesliu 发表于 2018-4-9 09:18:26 | 只看该作者
取堆栈指针地址,必须要加上的
回复 支持 反对

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies |上传

本版积分规则

新唐MCU