This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

主程序在flash中,部分程序memcopy到ram

想请教一下各位前辈:

cmd中

ramfuncs : LOAD = FLASHD,
RUN = progRAM,
LOAD_START(_RamfuncsLoadStart),
LOAD_END(_RamfuncsLoadEnd),
RUN_START(_RamfuncsRunStart),
PAGE = 0

main中

#ifdef FLASH
// Copy time critical code and Flash setup code to RAM
// The RamfuncsLoadStart, RamfuncsLoadEnd, and RamfuncsRunStart
// symbols are created by the linker. Refer to the linker files.
MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart);

1把对时间需求重要的程序写入FlashD中,这点首先怎么做到?

2cpu从flash开始启动,他怎么做到从flash中运行中,切换到ram中,又从ram中跑回来的呢?

  • 我之前不明白ram中和flash同时有相同的程序,cpu是怎么选择的。现在想想,是不是memcopy的时候,已经把进入该段程序的入口(原来是flash入口)改成了改代码在ram的入口处啦。所以memcopy或者在cmd文件映射时,不仅copy进了代码,而且同时修改了入口????

  • memcopy只进行代码段的拷贝,但是编译生成的符号对应的是拷贝后的运行地址。

  • 代码肯定都是存到flash中的   上电后通过将一部分代码搬移到ram中

    然后执行也就是跳转不同的地址而已

x 出现错误。请重试或与管理员联系。