void CLA_configClaMemory(void)
{
extern uint32_t Cla1funcsRunStart, Cla1funcsLoadStart, Cla1funcsLoadSize;
EALLOW;
#ifdef _FLASH
// Copy over code from FLASH to RAM
memcpy((uint32_t *)&Cla1funcsRunStart, (uint32_t *)&Cla1funcsLoadStart,
(uint32_t)&Cla1funcsLoadSize);
#endif //_FLASH
上面的代码是CLA存储配置函数,其中怎样再cmd文件体现这些呢,谁方便提供下这方面的例程吗?
Susan Yang:
您可以看一下 C:\ti\controlSUITE\device_support\F2837xD\v210\F2837xD_examples_Dual\cla_iir2p2z\cpu02
其中的 CLA_configClaMemory
// CLA_configClaMemory - Configure CLA memory // void CLA_configClaMemory(void) {extern uint32_t Cla1funcsRunStart, Cla1funcsLoadStart, Cla1funcsLoadSize;//// Wait for signal from CPU1 before configuring//IpcSync(5);EALLOW; #ifdef _FLASH//// Copy over code from FLASH to RAM//memcpy((uint32_t *)&Cla1funcsRunStart, (uint32_t *)&Cla1funcsLoadStart,(uint32_t)&Cla1funcsLoadSize); #endif //_FLASH #ifdef CPU2//// Enable CPU2 clocking at the sys clock level//CpuSysRegs.PCLKCR0.bit.CLA1 = 1; #endif //CPU2//// Initialize and wait for CLA1ToCPUMsgRAM//MemCfgRegs.MSGxINIT.bit.INIT_CLA1TOCPU = 1;while(MemCfgRegs.MSGxINITDONE.bit.INITDONE_CLA1TOCPU != 1){};//// Initialize and wait for CPUToCLA1MsgRAM//MemCfgRegs.MSGxINIT.bit.INIT_CPUTOCLA1 = 1;while(MemCfgRegs.MSGxINITDONE.bit.INITDONE_CPUTOCLA1 != 1){};//// Select LS5RAM to be the programming space for the CLA// First configure the CLA to be the master for LS5 and then// set the space to be a program block//MemCfgRegs.LSxMSEL.bit.MSEL_LS5 = 1;MemCfgRegs.LSxCLAPGM.bit.CLAPGM_LS5 = 1;//// Next configure LS0RAM and LS1RAM as data spaces for the CLA// First configure the CLA to be the master for LS0(1) and then// set the spaces to be code blocks//MemCfgRegs.LSxMSEL.bit.MSEL_LS0 = 1;MemCfgRegs.LSxCLAPGM.bit.CLAPGM_LS0 = 0;MemCfgRegs.LSxMSEL.bit.MSEL_LS1 = 1;MemCfgRegs.LSxCLAPGM.bit.CLAPGM_LS1 = 0;EDIS; }
void CLA_configClaMemory(void)
{
extern uint32_t Cla1funcsRunStart, Cla1funcsLoadStart, Cla1funcsLoadSize;
EALLOW;
#ifdef _FLASH
// Copy over code from FLASH to RAM
memcpy((uint32_t *)&Cla1funcsRunStart, (uint32_t *)&Cla1funcsLoadStart,
(uint32_t)&Cla1funcsLoadSize);
#endif //_FLASH
上面的代码是CLA存储配置函数,其中怎样再cmd文件体现这些呢,谁方便提供下这方面的例程吗?
liang wang:
回复 Susan Yang:
这个例子是加载到RAM的有那种cla代码下载到flash里的例子吗