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.

工程选择RAM还是FLASH,区别在哪里

请问下,我买的开发套件文档里介绍If you are working with Buck_VMC_F2837xS project,set F2837xS_RAM project configuration as the active configuration,这里还有Flash工程,请问下工程选择ram和flash这两者有什么区别,请指点下,谢谢

  • 选择RAM的程序,就是只把代码下载到RAM跑,这样调试的时候速度快,但是程序并没有真正下载。进入FLASH模式就是会把程序下载到FLASH,那就可以离线standalone跑。

    从程序上看,主要区别是CMD文件的memorymap的区别和是否有memorycoy函数来初始化FLASH,进入FLASH模式后,main函数的InitSysCtrl()里面会多出来

    #ifdef _FLASH
    // Copy time critical code and Flash setup code to RAM
    // This includes the following functions: InitFlash();
    // The RamfuncsLoadStart, RamfuncsLoadSize, and RamfuncsRunStart
    // symbols are created by the linker. Refer to the device .cmd file.
    memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);

    // Call Flash Initialization to setup flash waitstates
    // This function must reside in RAM
    InitFlash_Bank0();
    #endif

    并且CMD文件会多出:

    /* Flash sectors */
    FLASHA : origin = 0x080002, length = 0x001FFE /* on-chip Flash */
    FLASHB : origin = 0x082000, length = 0x002000 /* on-chip Flash */
    FLASHC : origin = 0x084000, length = 0x002000 /* on-chip Flash */
    FLASHD : origin = 0x086000, length = 0x002000 /* on-chip Flash */
    FLASHE : origin = 0x088000, length = 0x008000 /* on-chip Flash */
    FLASHF : origin = 0x090000, length = 0x008000 /* on-chip Flash */
    FLASHG : origin = 0x098000, length = 0x008000 /* on-chip Flash */
    FLASHH : origin = 0x0A0000, length = 0x008000 /* on-chip Flash */
    // FLASHI : origin = 0x0A8000, length = 0x008000 /* on-chip Flash */
    FLASHI : origin = 0x0A9E20, length = 0x0061E0 /* on-chip Flash */
    FLASHJ : origin = 0x0B0000, length = 0x008000 /* on-chip Flash */
    FLASHK : origin = 0x0B8000, length = 0x002000 /* on-chip Flash */
    FLASHL : origin = 0x0BA000, length = 0x002000 /* on-chip Flash */
    FLASHM : origin = 0x0BC000, length = 0x002000 /* on-chip Flash */
    FLASHN : origin = 0x0BE000, length = 0x002000 /* on-chip Flash */