Dear team:
The initialization of the CLA is as follows:
void CLLLC_HAL_setupCLA(void) { // // setup CLA to register an interrupt // #if CLLLC_ISR1_RUNNING_ON == CLA_CORE memcpy((uint32_t *)&Cla1ProgRunStart, (uint32_t *)&Cla1ProgLoadStart, (uint32_t)&Cla1ProgLoadSize ); // // first assign memory to CLA // MemCfg_setLSRAMMasterSel(MEMCFG_SECT_LS0, MEMCFG_LSRAMMASTER_CPU_CLA1); MemCfg_setLSRAMMasterSel(MEMCFG_SECT_LS1, MEMCFG_LSRAMMASTER_CPU_CLA1); MemCfg_setLSRAMMasterSel(MEMCFG_SECT_LS2, MEMCFG_LSRAMMASTER_CPU_CLA1); MemCfg_setLSRAMMasterSel(MEMCFG_SECT_LS3, MEMCFG_LSRAMMASTER_CPU_CLA1); MemCfg_setLSRAMMasterSel(MEMCFG_SECT_LS4, MEMCFG_LSRAMMASTER_CPU_CLA1); MemCfg_setLSRAMMasterSel(MEMCFG_SECT_LS5, MEMCFG_LSRAMMASTER_CPU_CLA1); MemCfg_setLSRAMMasterSel(MEMCFG_SECT_LS6, MEMCFG_LSRAMMASTER_CPU_CLA1); MemCfg_setLSRAMMasterSel(MEMCFG_SECT_LS7, MEMCFG_LSRAMMASTER_CPU_CLA1); MemCfg_setCLAMemType(MEMCFG_SECT_LS0, MEMCFG_CLA_MEM_DATA); MemCfg_setCLAMemType(MEMCFG_SECT_LS1, MEMCFG_CLA_MEM_DATA); MemCfg_setCLAMemType(MEMCFG_SECT_LS2, MEMCFG_CLA_MEM_DATA); MemCfg_setCLAMemType(MEMCFG_SECT_LS3, MEMCFG_CLA_MEM_DATA); MemCfg_setCLAMemType(MEMCFG_SECT_LS4, MEMCFG_CLA_MEM_PROGRAM); MemCfg_setCLAMemType(MEMCFG_SECT_LS5, MEMCFG_CLA_MEM_PROGRAM); MemCfg_setCLAMemType(MEMCFG_SECT_LS6, MEMCFG_CLA_MEM_PROGRAM); MemCfg_setCLAMemType(MEMCFG_SECT_LS7, MEMCFG_CLA_MEM_PROGRAM); // // Suppressing #770-D conversion from pointer to smaller integer // The CLA address range is 16 bits so the addresses passed to the MVECT // registers will be in the lower 64KW address space. Turn the warning // back on after the MVECTs are assigned addresses // #pragma diag_suppress = 770 CLA_mapTaskVector(CLA1_BASE , CLA_MVECT_1, (uint16_t)&Cla1Task1); CLA_mapTaskVector(CLA1_BASE , CLA_MVECT_2, (uint16_t)&Cla1Task2); CLA_mapTaskVector(CLA1_BASE , CLA_MVECT_3, (uint16_t)&Cla1Task3); CLA_mapTaskVector(CLA1_BASE , CLA_MVECT_4, (uint16_t)&Cla1Task4); CLA_mapTaskVector(CLA1_BASE , CLA_MVECT_5, (uint16_t)&Cla1Task5); CLA_mapTaskVector(CLA1_BASE , CLA_MVECT_6, (uint16_t)&Cla1Task6); CLA_mapTaskVector(CLA1_BASE , CLA_MVECT_7, (uint16_t)&Cla1Task7); CLA_mapBackgroundTaskVector(CLA1_BASE, (uint16_t)&Cla1BackgroundTask); #pragma diag_warning = 770 CLA_enableIACK(CLA1_BASE); CLA_enableTasks(CLA1_BASE, CLA_TASKFLAG_ALL); CLA_enableHardwareTrigger(CLA1_BASE); CLA_setTriggerSource(CLA_TASK_8, CLLLC_ISR2_TRIG_CLA); CLA_enableBackgroundTask(CLA1_BASE); CLA_setTriggerSource(CLA_TASK_1, CLLLC_ISR2_TRIG_CLA);//CLA_TRIGGER_ADCB1);//CLLLC_ISR1_TRIG_CLA); #endif }
In the process of using CLA, my client found that when he used BackgroundTask to program as follows, there would be a compilation error.
__attribute__((interrupt("background"))) void Cla1BackgroundTask ( void ) { #ifdef BUCK_CONTROL_RUNNING_ON_CLA BUCK_runIsr(); #ifdef BUCK2_ENABLE BUCK2_runIsr(); #endif #ifdef BUCK3_ENABLE BUCK3_runIsr(); #endif #ifdef BUCK4_ENABLE BUCK4_runIsr(); #endif #endif if(CLAtest == 1) { CLLLC_HAL_setProfilingGPIO2();//GPIO22置高 CLAtest = 0; } else { CLLLC_HAL_resetProfilingGPIO2();//GPIO22置低 CLAtest = 1; } }
When he put the same task content in Task1, the program can run normally.
__attribute__((interrupt)) void Cla1Task1 ( void ) { #if(CLA_DEBUG == 1) __mdebugstop(); #endif #ifdef BUCK_CONTROL_RUNNING_ON_CLA BUCK_runIsr(); #ifdef BUCK2_ENABLE BUCK2_runIsr(); #endif #ifdef BUCK3_ENABLE BUCK3_runIsr(); #endif #ifdef BUCK4_ENABLE BUCK4_runIsr(); #endif #endif if(CLAtest == 1) { CLLLC_HAL_setProfilingGPIO2();//GPIO22置高 CLAtest = 0; } else { CLLLC_HAL_resetProfilingGPIO2();//GPIO22置低 CLAtest = 1; } }
What's the problem?
Best regards