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搬移到RAM的问题?

       网上看到一个帖子,说程序流程一般如下:code_start->wd_disable->copy_sections->c_int00->mian()

但参考TI给的示例flash工程,里面MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart)是放在mian函数里,且是在系统初始化之后。这样就感觉跟上面的流程有矛盾,copy_sections跟mian()的先后顺序到底如何?

  • 上述说法有误。

    参考FLASH例程。如例程中要运行在RAM中的函数时init flash函数,需要在这个函数定义出加上#pragma CODE_SECTION(InitFlash, "ramfuncs");

    然后cmd要设置ramfuncs这个段,最后在main中要先调用memcopy函数,把代码从flash复制到ram中,然后接下去才能调用iniFlash这个函数,。

    Eric