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.
user6154541 说:好的,非常感谢,我刚测试了,claisr7 和claisr8都能进入。
若是解决您的问题,请点击“确认此为答案”
user6154541 说:task7 和task8与claisr7和claisr8是什么关系?task7和task8是用的汇编,请问task7和task8是什么一直在运行吗?还是和claisr7和claiscla8一样在cla的中断触发源到来之后运行?
该问题和最开始的帖子不同,我会将该帖子拆分为新帖以便于查看
您好,我配置的是EPWM3中断触发cla task1,软件触发cla task8。在BSP_HRPWM.c中EPWM3配置了中断源,在BSP_CLA.c中配置了cla task1的中断触发源为EPWM3,cla task8为软件触发,并强制触发cla task8一次。InitFlash函数在f28004x_sysctrl.c中初始化,cla的具体配置都在BSP_CLA.c程序文件里边。想截图给您看看,但是不知道这个怎么粘贴图片。
参考 280049 TRM 的 5.4.2 Typical CLA Initialization Sequence可知
CLA 的初始化流程
对照您的初始化流程,没有看到Enable CLA tasks/interrupts等
可以参考例程内的写法
// // Map the ISR to the CLA end-of-task interrupt. // Interrupt_register(INT_CLA1_1, cla1Isr1);
//***************************************************************************** // //! Registers a function to be called when an interrupt occurs. //! //! \param interruptNumber specifies the interrupt in question. //! \param handler is a pointer to the function to be called. //! //! This function is used to specify the handler function to be called when the //! given interrupt is asserted to the processor. When the interrupt occurs, //! if it is enabled (via Interrupt_enable()), the handler function will be //! called in interrupt context. Since the handler function can preempt other //! code, care must be taken to protect memory or peripherals that are accessed //! by the handler and other non-handler code. //! //! The available \e interruptNumber values are supplied in //! <tt>inc/hw_ints.h</tt>. //! //! \note This function assumes that the PIE has been enabled. See //! Interrupt_initModule(). //! //! \return None. // //***************************************************************************** static inline void Interrupt_register(uint32_t interruptNumber, void (*handler)(void)) { uint32_t address; // // Calculate appropriate address for the interrupt number // address = (uint32_t)PIEVECTTABLE_BASE + (((interruptNumber & 0xFFFF0000U) >> 16U) * 2U); // // Copy ISR address into PIE table // EALLOW; HWREG(address) = (uint32_t)handler; EDIS; }
改成CLA_TRIG_EPWM2INT就可以了。您原来是CLA_TRIG_EPWM3INT,而程序中又没有使能EPWM3INT,所以不能触发CLA
//
// Set the EPWM3 as the trigger for task 1
//
DmaClaSrcSelRegs.CLA1TASKSRCSEL1.bit.TASK1 = CLA_TRIG_EPWM2INT;;