请问一下在e2studio中,如何从boot跳转到app,跳转函数是否如下,跳转的地址也就是app的起始地址在app中要如何设置,我在memory_regions.ld中修改了FLASH_START,但是生成的hex文件程序部分数据依旧是从0x000开始的,还需要进行什么其他的设置吗,急需您的答复
void jump_to_app(void){ /* Clang at O0, stores variables on the stack with SP relative addressing. * When manually set the SP then the place of reset vector is lost. * Static variables are stored in 'data' or 'bss' section, change of SP has * no effect on them. */ static struct arm_vector_table *vt; uint64_t flash_base = ABUP_FLASH_APP_ADDR;
vt = (struct arm_vector_table *)(flash_base);
vt->msp = *(uint32_t *)flash_base; vt->reset = *(uint32_t *)(flash_base+4);
#if defined(__ARM_ARCH_8M_MAIN__) || defined(__ARM_ARCH_8M_BASE__) /* Restore the Main Stack Pointer Limit register's reset value * before passing execution to runtime firmware to make the * bootloader transparent to it. */ __set_MSPLIM(0);#endif
SCB->VTOR = ((int)(&(vt->msp)) & 0x1FFFFF80); __DSB();
__set_MSP(vt->msp);
((void (*)()) vt->reset)();}
搜索
复制
请参考以下链接
https://japan.renesasrulz.com/rulz-chinese/ra-mcu-fsp/f/forum/7952/r7a2l1ab-_bootloader-boot-app/41554#41554
您好,我参考了以下链接,但是我生成的hex文件中app数据部分并不从FLASH_START的地方开始,该链接好像没有相应的解决方案,只有debug调试的设置
首先,修改 *.ld文件, FLASH ORIGIN设定为目标起始地址(如下图,则编译后的*.srec 文件起始地址为0x0002 0000)
在 Debug Configuration中,将下图的三行代码添加到 Startup -> Run Commands中
我这样设置后编译出来的hex文件起始地址还是0x0000