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.
//大家好,我在配置CLA_Background Task时 //发现通过Debug监控Cla1BackgroundTask函数中 //的index(外部定义的全局变量)发现程序执行过程之中 //未曾进入过Cla1BackgroundTask函数, //以下是我对CLA的配置,请问有什么问题吗? // Turn on all peripherals EALLOW; CpuSysRegs.PCLKCR0.bit.CLA1 = 1; CpuSysRegs.PCLKCR0.bit.CPUTIMER0 = 1; CpuSysRegs.PCLKCR0.bit.CPUTIMER1 = 1; CpuSysRegs.PCLKCR0.bit.CPUTIMER2 = 1; ... EDIS; //Configuring CPUTimer ConfigCpuTimer(&CpuTimer0, 100, TIMER_1MS); ConfigCpuTimer(&CpuTimer1, 100, TIMER_50US); ConfigCpuTimer(&CpuTimer2, 100, TIMER_100US); void CLAInit(void) { // // Copy the program and constants from FLASH to RAM before configuring // the CLA // memcpy((Uint32 *)&Cla1funcsRunStart, (Uint32 *)&Cla1funcsLoadStart, (Uint32)&Cla1funcsLoadSize ); memcpy((Uint32 *)&Cla1ConstRunStart, (Uint32 *)&Cla1ConstLoadStart, (Uint32)&Cla1ConstLoadSize ); // // CLA Program will reside in RAMLS3,RAML4 // MemCfg_setCLAMemType((MEMCFG_SECT_LS3 | MEMCFG_SECT_LS4), MEMCFG_CLA_MEM_PROGRAM); MemCfg_setLSRAMMasterSel(MEMCFG_SECT_LS3, MEMCFG_LSRAMMASTER_CPU_CLA1); MemCfg_setLSRAMMasterSel(MEMCFG_SECT_LS4, MEMCFG_LSRAMMASTER_CPU_CLA1); // CPU and CLA1 share RAMLS5 MemCfg_setCLAMemType(MEMCFG_SECT_LS5, MEMCFG_CLA_MEM_DATA); // RAMLS5 as Data memory MemCfg_setLSRAMMasterSel(MEMCFG_SECT_LS5, MEMCFG_LSRAMMASTER_CPU_CLA1); CLA_mapTaskVector(CLA1_BASE, CLA_MVECT_1, (Uint16)&Cla1Task1); CLA_mapTaskVector(CLA1_BASE, CLA_MVECT_2, (Uint16)&Cla1Task2); CLA_setTriggerSource(CLA_TASK_1, CLA_TRIGGER_TINT1); CLA_setTriggerSource(CLA_TASK_2, CLA_TRIGGER_SOFTWARE); CLA_enableTasks(CLA1_BASE, (CLA_TASKFLAG_1|CLA_TASKFLAG_2)); // Configuring Background task CLA_mapBackgroundTaskVector(CLA1_BASE,(Uint16)&Cla1BackgroundTask); CLA_disableHardwareTrigger(CLA1_BASE); CLA_setTriggerSource(CLA_TASK_8, CLA_TRIGGER_SOFTWARE); CLA_enableBackgroundTask(CLA1_BASE); CLA_startBackgroundTask(CLA1_BASE); // Main cpu start CLA task CLA_enableIACK(CLA1_BASE); CLA_forceTasks(CLA1_BASE, CLA_TASKFLAG_2); } __attribute__((interrupt("background"))) void Cla1BackgroundTask ( void ) { while(1) { //CLA_TEST1_TOG(); index++; if( CpuTimer0Regs.TCR.bit.TIF ==1) { CpuTimer0Regs.TCR.bit.TIF =1; } } }
另外请您参考例程 cla_ex1_background_task
C2000Ware_3_03_00_00\device_support\f28004x\examples\cla
// // The background task will be triggered by software; it shares // the same trigger source as task 8. Disable the hardware triggering // mechanism for the background task (if it is enabled) and then // set the trigger source for task 8 to 0 indicating a software // trigger. // // Enable the background task and start it. Enabling the background // task disables task 8. // Cla1Regs._MVECTBGRND = (uint16_t)&Cla1BackgroundTask; #pragma diag_warning=770 Cla1Regs._MCTLBGRND.bit.TRIGEN = 0U; DmaClaSrcSelRegs.CLA1TASKSRCSEL2.bit.TASK8 = 0U; //Software Cla1Regs._MCTLBGRND.bit.BGEN = 1U; Cla1Regs._MCTLBGRND.bit.BGSTART = 1U;
user6368808 说:加了volatile后可以看到BackgroundTask确实有执行
谢谢您的反馈
user6368808 说:这个BackgroundTask中可以向其他claTask1_7一样调用内联函数吗?
可以的,BackgroundTask只支持调用内联函数