MCU为F28069,采用Flash_to_RAM的方法,把所有程序都从FLASH移到RAM中运行,但程序运行后无法跳转到main(),不知道什么原因,是因为CMD文件有问题吗?大家帮忙看看。
{
PAGE 0: /* Program Memory */
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE1 for data allocation */
RAML0_8 : origin = 0x008000, length = 0x00B800 /* on-chip RAM */
OTP : origin = 0x3D7800, length = 0x000400 /* on-chip OTP */
FLASHD_H : origin = 0x3D8000, length = 0x014000 /* on-chip FLASH */
FLASHA_C : origin = 0x3EC000, length = 0x00BF80 //origin = 0x3F0000, length = 0x007F80 /* on-chip FLASH */
ROM : origin = 0x3FC000, length = 0x003F00 /* Boot ROM */
//FPUTABLES : origin = 0x3FD590, length = 0x000600 /* FPU Tables in Boot ROM */
//IQTABLES : origin = 0x3FDC30, length = 0x000B50 /* IQ Math Tables in Boot ROM */
//IQTABLES2 : origin = 0x3FE780, length = 0x00008C /* IQ Math Tables in Boot ROM */
//IQTABLES3 : origin = 0x3FE80C, length = 0x0000AA /* IQ Math Tables in Boot ROM */
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE0 for program allocation */
/* Registers remain on PAGE1 */
RAMM01 : origin = 0x000050, length = 0x0007B0 /* on-chip RAM block M0 */
RAML8 : origin = 0x012000, length = 0x001800 /* on-chip RAM block L8. From 0x13800 to 0x14000 is reserved for InstaSPIN */
USB_RAM : origin = 0x040000, length = 0x000800 /* USB RAM */
}
/* Link all user defined sections */
/**************************************************************/
SECTIONS
{
csmpasswds : > CSM_PWL, PAGE = 0 /* Used by file CSMPasswords.asm */
csm_rsvd : > CSM_RSVD, PAGE = 0 /* Used by file CSMPasswords.asm */
codestart : > BEGIN_FLASH, PAGE = 0 /* Used by file CodeStartBranch.asm */
wddisable : > FLASHA_C, PAGE = 0 /* Used by file CodeStartBranch.asm */
copysections : > FLASHA_C, PAGE = 0 /* Used by file SectionCopy.asm */
vectors : > VECTORS, PAGE = 0, TYPE = DSECT
/* Allocate uninitalized data sections: */
.stack : > RAMM01, PAGE = 1
.ebss : > RAML8, PAGE = 1
.esysmem : > RAML8, PAGE = 1
//IQmathTables : > IQTABLES, PAGE = 0, TYPE = NOLOAD
/*** Initialized Sections ***/ .cinit : LOAD = FLASHA_C, PAGE = 0 /* Load section to Flash */
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_cinit_loadstart),
RUN_START(_cinit_runstart),
SIZE(_cinit_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_const_loadstart),
RUN_START(_const_runstart),
SIZE(_const_size)
.econst : LOAD = FLASHA_C, PAGE = 0 /* Load section to Flash */
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_econst_loadstart),
RUN_START(_econst_runstart),
SIZE(_econst_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_pinit_loadstart),
RUN_START(_pinit_runstart),
SIZE(_pinit_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_switch_loadstart),
RUN_START(_switch_runstart),
SIZE(_switch_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_text_loadstart),
RUN_START(_text_runstart),
SIZE(_text_size)
mangui zhang:controlsuite中的工程都可以实现搬移吧。 TI提供了代码 只需使能宏定义就可以了 你试试那个
MCU为F28069,采用Flash_to_RAM的方法,把所有程序都从FLASH移到RAM中运行,但程序运行后无法跳转到main(),不知道什么原因,是因为CMD文件有问题吗?大家帮忙看看。
{
PAGE 0: /* Program Memory */
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE1 for data allocation */
RAML0_8 : origin = 0x008000, length = 0x00B800 /* on-chip RAM */
OTP : origin = 0x3D7800, length = 0x000400 /* on-chip OTP */
FLASHD_H : origin = 0x3D8000, length = 0x014000 /* on-chip FLASH */
FLASHA_C : origin = 0x3EC000, length = 0x00BF80 //origin = 0x3F0000, length = 0x007F80 /* on-chip FLASH */
ROM : origin = 0x3FC000, length = 0x003F00 /* Boot ROM */
//FPUTABLES : origin = 0x3FD590, length = 0x000600 /* FPU Tables in Boot ROM */
//IQTABLES : origin = 0x3FDC30, length = 0x000B50 /* IQ Math Tables in Boot ROM */
//IQTABLES2 : origin = 0x3FE780, length = 0x00008C /* IQ Math Tables in Boot ROM */
//IQTABLES3 : origin = 0x3FE80C, length = 0x0000AA /* IQ Math Tables in Boot ROM */
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE0 for program allocation */
/* Registers remain on PAGE1 */
RAMM01 : origin = 0x000050, length = 0x0007B0 /* on-chip RAM block M0 */
RAML8 : origin = 0x012000, length = 0x001800 /* on-chip RAM block L8. From 0x13800 to 0x14000 is reserved for InstaSPIN */
USB_RAM : origin = 0x040000, length = 0x000800 /* USB RAM */
}
/* Link all user defined sections */
/**************************************************************/
SECTIONS
{
csmpasswds : > CSM_PWL, PAGE = 0 /* Used by file CSMPasswords.asm */
csm_rsvd : > CSM_RSVD, PAGE = 0 /* Used by file CSMPasswords.asm */
codestart : > BEGIN_FLASH, PAGE = 0 /* Used by file CodeStartBranch.asm */
wddisable : > FLASHA_C, PAGE = 0 /* Used by file CodeStartBranch.asm */
copysections : > FLASHA_C, PAGE = 0 /* Used by file SectionCopy.asm */
vectors : > VECTORS, PAGE = 0, TYPE = DSECT
/* Allocate uninitalized data sections: */
.stack : > RAMM01, PAGE = 1
.ebss : > RAML8, PAGE = 1
.esysmem : > RAML8, PAGE = 1
//IQmathTables : > IQTABLES, PAGE = 0, TYPE = NOLOAD
/*** Initialized Sections ***/ .cinit : LOAD = FLASHA_C, PAGE = 0 /* Load section to Flash */
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_cinit_loadstart),
RUN_START(_cinit_runstart),
SIZE(_cinit_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_const_loadstart),
RUN_START(_const_runstart),
SIZE(_const_size)
.econst : LOAD = FLASHA_C, PAGE = 0 /* Load section to Flash */
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_econst_loadstart),
RUN_START(_econst_runstart),
SIZE(_econst_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_pinit_loadstart),
RUN_START(_pinit_runstart),
SIZE(_pinit_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_switch_loadstart),
RUN_START(_switch_runstart),
SIZE(_switch_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_text_loadstart),
RUN_START(_text_runstart),
SIZE(_text_size)
user524568:
拔掉编程器(XDS100V3)后程序运行是正常的,就是接编程器在仿真状态下进入不了MAIN(),也不能正常运行。是设置问题还是仿真器有问题呢?有人知道怎么解决吗?
MCU为F28069,采用Flash_to_RAM的方法,把所有程序都从FLASH移到RAM中运行,但程序运行后无法跳转到main(),不知道什么原因,是因为CMD文件有问题吗?大家帮忙看看。
{
PAGE 0: /* Program Memory */
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE1 for data allocation */
RAML0_8 : origin = 0x008000, length = 0x00B800 /* on-chip RAM */
OTP : origin = 0x3D7800, length = 0x000400 /* on-chip OTP */
FLASHD_H : origin = 0x3D8000, length = 0x014000 /* on-chip FLASH */
FLASHA_C : origin = 0x3EC000, length = 0x00BF80 //origin = 0x3F0000, length = 0x007F80 /* on-chip FLASH */
ROM : origin = 0x3FC000, length = 0x003F00 /* Boot ROM */
//FPUTABLES : origin = 0x3FD590, length = 0x000600 /* FPU Tables in Boot ROM */
//IQTABLES : origin = 0x3FDC30, length = 0x000B50 /* IQ Math Tables in Boot ROM */
//IQTABLES2 : origin = 0x3FE780, length = 0x00008C /* IQ Math Tables in Boot ROM */
//IQTABLES3 : origin = 0x3FE80C, length = 0x0000AA /* IQ Math Tables in Boot ROM */
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE0 for program allocation */
/* Registers remain on PAGE1 */
RAMM01 : origin = 0x000050, length = 0x0007B0 /* on-chip RAM block M0 */
RAML8 : origin = 0x012000, length = 0x001800 /* on-chip RAM block L8. From 0x13800 to 0x14000 is reserved for InstaSPIN */
USB_RAM : origin = 0x040000, length = 0x000800 /* USB RAM */
}
/* Link all user defined sections */
/**************************************************************/
SECTIONS
{
csmpasswds : > CSM_PWL, PAGE = 0 /* Used by file CSMPasswords.asm */
csm_rsvd : > CSM_RSVD, PAGE = 0 /* Used by file CSMPasswords.asm */
codestart : > BEGIN_FLASH, PAGE = 0 /* Used by file CodeStartBranch.asm */
wddisable : > FLASHA_C, PAGE = 0 /* Used by file CodeStartBranch.asm */
copysections : > FLASHA_C, PAGE = 0 /* Used by file SectionCopy.asm */
vectors : > VECTORS, PAGE = 0, TYPE = DSECT
/* Allocate uninitalized data sections: */
.stack : > RAMM01, PAGE = 1
.ebss : > RAML8, PAGE = 1
.esysmem : > RAML8, PAGE = 1
//IQmathTables : > IQTABLES, PAGE = 0, TYPE = NOLOAD
/*** Initialized Sections ***/ .cinit : LOAD = FLASHA_C, PAGE = 0 /* Load section to Flash */
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_cinit_loadstart),
RUN_START(_cinit_runstart),
SIZE(_cinit_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_const_loadstart),
RUN_START(_const_runstart),
SIZE(_const_size)
.econst : LOAD = FLASHA_C, PAGE = 0 /* Load section to Flash */
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_econst_loadstart),
RUN_START(_econst_runstart),
SIZE(_econst_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_pinit_loadstart),
RUN_START(_pinit_runstart),
SIZE(_pinit_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_switch_loadstart),
RUN_START(_switch_runstart),
SIZE(_switch_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_text_loadstart),
RUN_START(_text_runstart),
SIZE(_text_size)
mangui zhang:
回复 user524568:
仿真器只要能实现程序下载就应该能调试ccs工程属性下的程序入口设置一下看看
MCU为F28069,采用Flash_to_RAM的方法,把所有程序都从FLASH移到RAM中运行,但程序运行后无法跳转到main(),不知道什么原因,是因为CMD文件有问题吗?大家帮忙看看。
{
PAGE 0: /* Program Memory */
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE1 for data allocation */
RAML0_8 : origin = 0x008000, length = 0x00B800 /* on-chip RAM */
OTP : origin = 0x3D7800, length = 0x000400 /* on-chip OTP */
FLASHD_H : origin = 0x3D8000, length = 0x014000 /* on-chip FLASH */
FLASHA_C : origin = 0x3EC000, length = 0x00BF80 //origin = 0x3F0000, length = 0x007F80 /* on-chip FLASH */
ROM : origin = 0x3FC000, length = 0x003F00 /* Boot ROM */
//FPUTABLES : origin = 0x3FD590, length = 0x000600 /* FPU Tables in Boot ROM */
//IQTABLES : origin = 0x3FDC30, length = 0x000B50 /* IQ Math Tables in Boot ROM */
//IQTABLES2 : origin = 0x3FE780, length = 0x00008C /* IQ Math Tables in Boot ROM */
//IQTABLES3 : origin = 0x3FE80C, length = 0x0000AA /* IQ Math Tables in Boot ROM */
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE0 for program allocation */
/* Registers remain on PAGE1 */
RAMM01 : origin = 0x000050, length = 0x0007B0 /* on-chip RAM block M0 */
RAML8 : origin = 0x012000, length = 0x001800 /* on-chip RAM block L8. From 0x13800 to 0x14000 is reserved for InstaSPIN */
USB_RAM : origin = 0x040000, length = 0x000800 /* USB RAM */
}
/* Link all user defined sections */
/**************************************************************/
SECTIONS
{
csmpasswds : > CSM_PWL, PAGE = 0 /* Used by file CSMPasswords.asm */
csm_rsvd : > CSM_RSVD, PAGE = 0 /* Used by file CSMPasswords.asm */
codestart : > BEGIN_FLASH, PAGE = 0 /* Used by file CodeStartBranch.asm */
wddisable : > FLASHA_C, PAGE = 0 /* Used by file CodeStartBranch.asm */
copysections : > FLASHA_C, PAGE = 0 /* Used by file SectionCopy.asm */
vectors : > VECTORS, PAGE = 0, TYPE = DSECT
/* Allocate uninitalized data sections: */
.stack : > RAMM01, PAGE = 1
.ebss : > RAML8, PAGE = 1
.esysmem : > RAML8, PAGE = 1
//IQmathTables : > IQTABLES, PAGE = 0, TYPE = NOLOAD
/*** Initialized Sections ***/ .cinit : LOAD = FLASHA_C, PAGE = 0 /* Load section to Flash */
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_cinit_loadstart),
RUN_START(_cinit_runstart),
SIZE(_cinit_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_const_loadstart),
RUN_START(_const_runstart),
SIZE(_const_size)
.econst : LOAD = FLASHA_C, PAGE = 0 /* Load section to Flash */
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_econst_loadstart),
RUN_START(_econst_runstart),
SIZE(_econst_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_pinit_loadstart),
RUN_START(_pinit_runstart),
SIZE(_pinit_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_switch_loadstart),
RUN_START(_switch_runstart),
SIZE(_switch_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_text_loadstart),
RUN_START(_text_runstart),
SIZE(_text_size)
user524568:
回复 mangui zhang:
我看CCS里设置的是:
Auto run option:
Run to symbol main
还要设置哪里?
MCU为F28069,采用Flash_to_RAM的方法,把所有程序都从FLASH移到RAM中运行,但程序运行后无法跳转到main(),不知道什么原因,是因为CMD文件有问题吗?大家帮忙看看。
{
PAGE 0: /* Program Memory */
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE1 for data allocation */
RAML0_8 : origin = 0x008000, length = 0x00B800 /* on-chip RAM */
OTP : origin = 0x3D7800, length = 0x000400 /* on-chip OTP */
FLASHD_H : origin = 0x3D8000, length = 0x014000 /* on-chip FLASH */
FLASHA_C : origin = 0x3EC000, length = 0x00BF80 //origin = 0x3F0000, length = 0x007F80 /* on-chip FLASH */
ROM : origin = 0x3FC000, length = 0x003F00 /* Boot ROM */
//FPUTABLES : origin = 0x3FD590, length = 0x000600 /* FPU Tables in Boot ROM */
//IQTABLES : origin = 0x3FDC30, length = 0x000B50 /* IQ Math Tables in Boot ROM */
//IQTABLES2 : origin = 0x3FE780, length = 0x00008C /* IQ Math Tables in Boot ROM */
//IQTABLES3 : origin = 0x3FE80C, length = 0x0000AA /* IQ Math Tables in Boot ROM */
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE0 for program allocation */
/* Registers remain on PAGE1 */
RAMM01 : origin = 0x000050, length = 0x0007B0 /* on-chip RAM block M0 */
RAML8 : origin = 0x012000, length = 0x001800 /* on-chip RAM block L8. From 0x13800 to 0x14000 is reserved for InstaSPIN */
USB_RAM : origin = 0x040000, length = 0x000800 /* USB RAM */
}
/* Link all user defined sections */
/**************************************************************/
SECTIONS
{
csmpasswds : > CSM_PWL, PAGE = 0 /* Used by file CSMPasswords.asm */
csm_rsvd : > CSM_RSVD, PAGE = 0 /* Used by file CSMPasswords.asm */
codestart : > BEGIN_FLASH, PAGE = 0 /* Used by file CodeStartBranch.asm */
wddisable : > FLASHA_C, PAGE = 0 /* Used by file CodeStartBranch.asm */
copysections : > FLASHA_C, PAGE = 0 /* Used by file SectionCopy.asm */
vectors : > VECTORS, PAGE = 0, TYPE = DSECT
/* Allocate uninitalized data sections: */
.stack : > RAMM01, PAGE = 1
.ebss : > RAML8, PAGE = 1
.esysmem : > RAML8, PAGE = 1
//IQmathTables : > IQTABLES, PAGE = 0, TYPE = NOLOAD
/*** Initialized Sections ***/ .cinit : LOAD = FLASHA_C, PAGE = 0 /* Load section to Flash */
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_cinit_loadstart),
RUN_START(_cinit_runstart),
SIZE(_cinit_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_const_loadstart),
RUN_START(_const_runstart),
SIZE(_const_size)
.econst : LOAD = FLASHA_C, PAGE = 0 /* Load section to Flash */
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_econst_loadstart),
RUN_START(_econst_runstart),
SIZE(_econst_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_pinit_loadstart),
RUN_START(_pinit_runstart),
SIZE(_pinit_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_switch_loadstart),
RUN_START(_switch_runstart),
SIZE(_switch_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_text_loadstart),
RUN_START(_text_runstart),
SIZE(_text_size)
mangui zhang:
回复 user524568:
连上仿真器不能直接调试。需要重新加载仿真是在ram中跑
MCU为F28069,采用Flash_to_RAM的方法,把所有程序都从FLASH移到RAM中运行,但程序运行后无法跳转到main(),不知道什么原因,是因为CMD文件有问题吗?大家帮忙看看。
{
PAGE 0: /* Program Memory */
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE1 for data allocation */
RAML0_8 : origin = 0x008000, length = 0x00B800 /* on-chip RAM */
OTP : origin = 0x3D7800, length = 0x000400 /* on-chip OTP */
FLASHD_H : origin = 0x3D8000, length = 0x014000 /* on-chip FLASH */
FLASHA_C : origin = 0x3EC000, length = 0x00BF80 //origin = 0x3F0000, length = 0x007F80 /* on-chip FLASH */
ROM : origin = 0x3FC000, length = 0x003F00 /* Boot ROM */
//FPUTABLES : origin = 0x3FD590, length = 0x000600 /* FPU Tables in Boot ROM */
//IQTABLES : origin = 0x3FDC30, length = 0x000B50 /* IQ Math Tables in Boot ROM */
//IQTABLES2 : origin = 0x3FE780, length = 0x00008C /* IQ Math Tables in Boot ROM */
//IQTABLES3 : origin = 0x3FE80C, length = 0x0000AA /* IQ Math Tables in Boot ROM */
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE0 for program allocation */
/* Registers remain on PAGE1 */
RAMM01 : origin = 0x000050, length = 0x0007B0 /* on-chip RAM block M0 */
RAML8 : origin = 0x012000, length = 0x001800 /* on-chip RAM block L8. From 0x13800 to 0x14000 is reserved for InstaSPIN */
USB_RAM : origin = 0x040000, length = 0x000800 /* USB RAM */
}
/* Link all user defined sections */
/**************************************************************/
SECTIONS
{
csmpasswds : > CSM_PWL, PAGE = 0 /* Used by file CSMPasswords.asm */
csm_rsvd : > CSM_RSVD, PAGE = 0 /* Used by file CSMPasswords.asm */
codestart : > BEGIN_FLASH, PAGE = 0 /* Used by file CodeStartBranch.asm */
wddisable : > FLASHA_C, PAGE = 0 /* Used by file CodeStartBranch.asm */
copysections : > FLASHA_C, PAGE = 0 /* Used by file SectionCopy.asm */
vectors : > VECTORS, PAGE = 0, TYPE = DSECT
/* Allocate uninitalized data sections: */
.stack : > RAMM01, PAGE = 1
.ebss : > RAML8, PAGE = 1
.esysmem : > RAML8, PAGE = 1
//IQmathTables : > IQTABLES, PAGE = 0, TYPE = NOLOAD
/*** Initialized Sections ***/ .cinit : LOAD = FLASHA_C, PAGE = 0 /* Load section to Flash */
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_cinit_loadstart),
RUN_START(_cinit_runstart),
SIZE(_cinit_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_const_loadstart),
RUN_START(_const_runstart),
SIZE(_const_size)
.econst : LOAD = FLASHA_C, PAGE = 0 /* Load section to Flash */
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_econst_loadstart),
RUN_START(_econst_runstart),
SIZE(_econst_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_pinit_loadstart),
RUN_START(_pinit_runstart),
SIZE(_pinit_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_switch_loadstart),
RUN_START(_switch_runstart),
SIZE(_switch_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_text_loadstart),
RUN_START(_text_runstart),
SIZE(_text_size)
Eric Ma:”MCU为F28069,采用Flash_to_RAM的方法,把所有程序都从FLASH移到RAM中运行,但程序运行后无法跳转到main(),不知道什么原因,是因为CMD文件有问题吗?大家帮忙看看。“
ERIC:
你这中做法就不对。哪有把所有的代码都从flash搬移到RAM运行。
如果你想直接在RAM中运行,进行调试,那用RAM的cmd不就可以。
如果你想一部分的代码放到RAM中运行,那么参考initflash的这个函数以及cmd。
你这种CMD把main都弄到RAM里面去了,谁在执行memcpy的函数的工作,难怪会跑不到main.
MCU为F28069,采用Flash_to_RAM的方法,把所有程序都从FLASH移到RAM中运行,但程序运行后无法跳转到main(),不知道什么原因,是因为CMD文件有问题吗?大家帮忙看看。
{
PAGE 0: /* Program Memory */
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE1 for data allocation */
RAML0_8 : origin = 0x008000, length = 0x00B800 /* on-chip RAM */
OTP : origin = 0x3D7800, length = 0x000400 /* on-chip OTP */
FLASHD_H : origin = 0x3D8000, length = 0x014000 /* on-chip FLASH */
FLASHA_C : origin = 0x3EC000, length = 0x00BF80 //origin = 0x3F0000, length = 0x007F80 /* on-chip FLASH */
ROM : origin = 0x3FC000, length = 0x003F00 /* Boot ROM */
//FPUTABLES : origin = 0x3FD590, length = 0x000600 /* FPU Tables in Boot ROM */
//IQTABLES : origin = 0x3FDC30, length = 0x000B50 /* IQ Math Tables in Boot ROM */
//IQTABLES2 : origin = 0x3FE780, length = 0x00008C /* IQ Math Tables in Boot ROM */
//IQTABLES3 : origin = 0x3FE80C, length = 0x0000AA /* IQ Math Tables in Boot ROM */
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE0 for program allocation */
/* Registers remain on PAGE1 */
RAMM01 : origin = 0x000050, length = 0x0007B0 /* on-chip RAM block M0 */
RAML8 : origin = 0x012000, length = 0x001800 /* on-chip RAM block L8. From 0x13800 to 0x14000 is reserved for InstaSPIN */
USB_RAM : origin = 0x040000, length = 0x000800 /* USB RAM */
}
/* Link all user defined sections */
/**************************************************************/
SECTIONS
{
csmpasswds : > CSM_PWL, PAGE = 0 /* Used by file CSMPasswords.asm */
csm_rsvd : > CSM_RSVD, PAGE = 0 /* Used by file CSMPasswords.asm */
codestart : > BEGIN_FLASH, PAGE = 0 /* Used by file CodeStartBranch.asm */
wddisable : > FLASHA_C, PAGE = 0 /* Used by file CodeStartBranch.asm */
copysections : > FLASHA_C, PAGE = 0 /* Used by file SectionCopy.asm */
vectors : > VECTORS, PAGE = 0, TYPE = DSECT
/* Allocate uninitalized data sections: */
.stack : > RAMM01, PAGE = 1
.ebss : > RAML8, PAGE = 1
.esysmem : > RAML8, PAGE = 1
//IQmathTables : > IQTABLES, PAGE = 0, TYPE = NOLOAD
/*** Initialized Sections ***/ .cinit : LOAD = FLASHA_C, PAGE = 0 /* Load section to Flash */
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_cinit_loadstart),
RUN_START(_cinit_runstart),
SIZE(_cinit_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_const_loadstart),
RUN_START(_const_runstart),
SIZE(_const_size)
.econst : LOAD = FLASHA_C, PAGE = 0 /* Load section to Flash */
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_econst_loadstart),
RUN_START(_econst_runstart),
SIZE(_econst_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_pinit_loadstart),
RUN_START(_pinit_runstart),
SIZE(_pinit_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_switch_loadstart),
RUN_START(_switch_runstart),
SIZE(_switch_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_text_loadstart),
RUN_START(_text_runstart),
SIZE(_text_size)
shakencity:我也觉得不需要全部进行复制转移吧,你看下仿真设置那边呢
MCU为F28069,采用Flash_to_RAM的方法,把所有程序都从FLASH移到RAM中运行,但程序运行后无法跳转到main(),不知道什么原因,是因为CMD文件有问题吗?大家帮忙看看。
{
PAGE 0: /* Program Memory */
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE1 for data allocation */
RAML0_8 : origin = 0x008000, length = 0x00B800 /* on-chip RAM */
OTP : origin = 0x3D7800, length = 0x000400 /* on-chip OTP */
FLASHD_H : origin = 0x3D8000, length = 0x014000 /* on-chip FLASH */
FLASHA_C : origin = 0x3EC000, length = 0x00BF80 //origin = 0x3F0000, length = 0x007F80 /* on-chip FLASH */
ROM : origin = 0x3FC000, length = 0x003F00 /* Boot ROM */
//FPUTABLES : origin = 0x3FD590, length = 0x000600 /* FPU Tables in Boot ROM */
//IQTABLES : origin = 0x3FDC30, length = 0x000B50 /* IQ Math Tables in Boot ROM */
//IQTABLES2 : origin = 0x3FE780, length = 0x00008C /* IQ Math Tables in Boot ROM */
//IQTABLES3 : origin = 0x3FE80C, length = 0x0000AA /* IQ Math Tables in Boot ROM */
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE0 for program allocation */
/* Registers remain on PAGE1 */
RAMM01 : origin = 0x000050, length = 0x0007B0 /* on-chip RAM block M0 */
RAML8 : origin = 0x012000, length = 0x001800 /* on-chip RAM block L8. From 0x13800 to 0x14000 is reserved for InstaSPIN */
USB_RAM : origin = 0x040000, length = 0x000800 /* USB RAM */
}
/* Link all user defined sections */
/**************************************************************/
SECTIONS
{
csmpasswds : > CSM_PWL, PAGE = 0 /* Used by file CSMPasswords.asm */
csm_rsvd : > CSM_RSVD, PAGE = 0 /* Used by file CSMPasswords.asm */
codestart : > BEGIN_FLASH, PAGE = 0 /* Used by file CodeStartBranch.asm */
wddisable : > FLASHA_C, PAGE = 0 /* Used by file CodeStartBranch.asm */
copysections : > FLASHA_C, PAGE = 0 /* Used by file SectionCopy.asm */
vectors : > VECTORS, PAGE = 0, TYPE = DSECT
/* Allocate uninitalized data sections: */
.stack : > RAMM01, PAGE = 1
.ebss : > RAML8, PAGE = 1
.esysmem : > RAML8, PAGE = 1
//IQmathTables : > IQTABLES, PAGE = 0, TYPE = NOLOAD
/*** Initialized Sections ***/ .cinit : LOAD = FLASHA_C, PAGE = 0 /* Load section to Flash */
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_cinit_loadstart),
RUN_START(_cinit_runstart),
SIZE(_cinit_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_const_loadstart),
RUN_START(_const_runstart),
SIZE(_const_size)
.econst : LOAD = FLASHA_C, PAGE = 0 /* Load section to Flash */
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_econst_loadstart),
RUN_START(_econst_runstart),
SIZE(_econst_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_pinit_loadstart),
RUN_START(_pinit_runstart),
SIZE(_pinit_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_switch_loadstart),
RUN_START(_switch_runstart),
SIZE(_switch_size)
RUN = RAML0_8, PAGE = 0 /* Run section from RAM */
LOAD_START(_text_loadstart),
RUN_START(_text_runstart),
SIZE(_text_size)
user524568:
程序写到芯片后,采用断开仿真器,再连接的方式有一定几率复位到main(),要多试几次就可以了。成功后和正常的仿真是一样的,且后续每次复位都可以定位到main()。