我现在使用F28075,启用了加密功能。将所有的fiash;CLA;RAM:D0,D1,LS0~LS5都分配到Zone1,加密上锁。LS0~LS5分配给CLA,所有的数据(cla会读写的数据放置在LS0)、堆栈等都分配到除上述区域外的片上RAM,将“ramfuncs”代码段(如ADC中断函数代码)上电从flash复制到RAMD0D1中运行,一切正常。现在我想把CAN发送函数代码从flash复制到非安全RAM GS1中去运行,以提高其运行速度。CAN发送函数中没有调用“ramfuncs”代码段的函数,调用的函数也都分配到RAM GS1中。CAN发送采用定时器0中断来执行,定时器0中断函数也分配到RAM GS0中,然后执行,发现CAN没有发送数据。这些函数没有分配到RAM GS1,直接在flash里运行时,一切正常。
我想了解一下,像我这样对芯片加密后,GS1是不是不能加载代码运行?下面是cmd文件:
// Set this variable to 1 to use the CLA Math Tables in the CLA Data ROM
// If set to 0, make sure the right CLA Math library is used in the project
–define=CLA_MATH_TABLES_IN_ROM=1
_Cla1Prog_Start = _Cla1funcsRunStart;
-heap 0x100
-stack 0x100
// Define a size for the CLA scratchpad area that will be used
// by the CLA compiler for local symbols and temps
// Also force references to the special symbols that mark the
// scratchpad are.
CLA_SCRATCHPAD_SIZE = 0x100;
–undef_sym=__cla_scratchpad_end
–undef_sym=__cla_scratchpad_start
MEMORY
{
PAGE 0 :
/* BEGIN is used for the "boot to SARAM" bootloader mode */
BEGIN : origin = 0x080000, length = 0x000002
RAMM0 : origin = 0x000122, length = 0x0002DE
RAMD0D1 : origin = 0x00B000, length = 0x001000
RAMLS1LS5 : origin = 0x008800, length = 0x002800
RAMGS1 : origin = 0x00D000, length = 0x001000
RESET : origin = 0x3FFFC0, length = 0x000002
/* Flash sectors */
FLASHAB : origin = 0x080002, length = 0x003FFE /* on-chip Flash */
FLASHC_START : origin = 0x084000, length = 0x000002 /* on-chip FLASH */
FLASHC : origin = 0x084002, length = 0x001FFE /* on-chip Flash */
FLASHAPP : origin = 0x086000, length = 0x011FFF /*8+32K+32K=72k to FLASHF*/
FLASH_FLAG : origin = 0x097FFF, length = 0x000001
PAGE 1 :
BOOT_RSVD : origin = 0x000002, length = 0x000120 /* Part of M0, BOOT rom will use this for stack */
RAMM1 : origin = 0x000400, length = 0x000400 /* on-chip RAM block M1 */
RAMLS0 : origin = 0x008000, length = 0x000800
OSSTACK : origin = 0x00C000, length = 0x001000
RAMGS2TO3 : origin = 0x00E000, length = 0x001FD0
RAMGS4TO7 : origin = 0x010000, length = 0x004000
RAMGS3_ALARM : origin = 0x00FFD0, length = 0x000020 /* */
RAMGS3_APP2BOOT : origin = 0x00FFF0, length = 0x000010 /* */
/*RAMGS9TO13 : origin = 0x015000, length = 0x005000*/
CLA1_MSGRAMLOW : origin = 0x001480, length = 0x000080
CLA1_MSGRAMHIGH : origin = 0x001500, length = 0x000080
}
SECTIONS
{
/* Allocate program areas: */
.cinit : > FLASHAPP PAGE = 0, ALIGN(4)
.pinit : > FLASHAPP, PAGE = 0, ALIGN(4)
.text : > FLASHAPP PAGE = 0, ALIGN(4)
codestart : > BEGIN PAGE = 0, ALIGN(4)
AppStart : > FLASHC_START PAGE = 0
flashflag : > FLASH_FLAG PAGE = 0
App2BootData : > RAMGS3_APP2BOOT PAGE = 1
AlarmData : > RAMGS3_ALARM PAGE = 1
ramfuncs : LOAD = FLASHAPP,
RUN = RAMD0D1,
LOAD_START(_RamfuncsLoadStart),
LOAD_END(_RamfuncsLoadEnd),
RUN_START(_RamfuncsRunStart),
PAGE = 0, ALIGN(4)
.canfuncs : LOAD = FLASHAPP,
RUN = RAMGS1,
LOAD_START(_CanfuncsLoadStart),
LOAD_END(_CanfuncsLoadEnd),
RUN_START(_CanfuncsRunStart),
PAGE = 0
/* Allocate uninitalized data sections: */
.stack : > RAMM1 PAGE = 1
.ebss : > RAMGS2TO3 PAGE = 1
.esysmem : > RAMGS2TO3 PAGE = 1
/* Initalized sections go in Flash */
.econst : > FLASHAPP PAGE = 0, ALIGN(4)
.switch : > FLASHAPP PAGE = 0, ALIGN(4)
.reset : > RESET, PAGE = 0, TYPE = DSECT /* not used, */
//user define
OSStack : > OSSTACK PAGE = 1
stepdata : > RAMGS4TO7 PAGE = 1
DataBuffer1 : > RAMGS4TO7 PAGE = 1
DataBuffer2 : > RAMGS4TO7 PAGE = 1
/* CLA specific sections */
Cla1Prog : LOAD = FLASHAPP,
RUN = RAMLS1LS5,
LOAD_START(_Cla1funcsLoadStart),
LOAD_END(_Cla1funcsLoadEnd),
RUN_START(_Cla1funcsRunStart),
PAGE = 0, ALIGN(4)
CLAData : > RAMLS0, PAGE=1
/* Allocate IQ math areas: */
IQmath : > FLASHC, PAGE = 0, ALIGN(4) /* Math Code */
IQmathTables : > FLASHC, PAGE = 0, ALIGN(4)
Cla1ToCpuMsgRAM : > CLA1_MSGRAMLOW, PAGE = 1
CpuToCla1MsgRAM : > CLA1_MSGRAMHIGH, PAGE = 1
/* CLA C compiler sections */
//
// Must be allocated to memory the CLA has write access to
//
CLAscratch :
{ *.obj(CLAscratch)
. += CLA_SCRATCHPAD_SIZE;
*.obj(CLAscratch_end) } > RAMLS0, PAGE = 1
.scratchpad : > RAMLS0, PAGE = 1
.bss_cla : > RAMLS0, PAGE = 1
.const_cla : LOAD = FLASHAPP,
RUN = RAMLS0,
RUN_START(_Cla1ConstRunStart),
LOAD_START(_Cla1ConstLoadStart),
LOAD_SIZE(_Cla1ConstLoadSize),
PAGE = 1
}
Annie Liu:
为更加有效地解决您的问题,我们建议您将问题发布在E2E英文技术论坛上https://e2e.ti.com/support/microcontrollers/c2000/f/171,将由资深的工程师为您提供帮助。我们的E2E英文社区有TI专家进行回复,并得到全球各地工程师的支持,分享他们的知识和经验。