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.

RTOS/TMS320F28379D: How to clear ECAP interrupt flags in SYSBIOS?

Part Number: TMS320F28379D
Other Parts Discussed in Thread: SYSBIOS, C2000WARE

Tool/software: TI-RTOS

Hello everybody,

Before SYSBIOS, I used ecap via C2000Ware lib and I could clear ecap interrupt flags after each ecap interrupt like below;

ECap2Regs.ECCLR.bit.CEVT1 = 1;
ECap2Regs.ECCLR.bit.INT = 1;
PieCtrlRegs.PIEACK.all = PIEACK_GROUP4;

But now I used C2000Ware lib with SYSBIOS and when I look ECCLR bits in debug mode, I can not clear flags by the method that I show above. I tried hwi clear, enable,restore functions( Hwi_clearInterrupt, Hwi_enableInterrupt, Hwi_restorePIEIER,Hwi_clearPIEIER etc.) but it does not work. Do you have any suggestion about fully usage of ECAP with SYSBIOS?

  • Those registers should all still behave the same way even with SYS/BIOS. Are you saying that when you place a breakpoint in the Hwi function and step through the code, you can't see the flags being cleared in the CCS registers view?

    Whitney
  • Yes absolutely. I still use Ecap clear  bit the same way even with SYS/BIOS but when I place a breakpoint in the Hwi function and step through the code, I can't see the flags being cleared in the CCS registers view.

    Despite of I can't see the flags being cleared in the CCS registers view, the counter which I put in hwi_function is increase. I added counter in the hwi_function to see how many times I have entered the hwi function. After the counter reaches almost 150-160,  the counter does not change. Because hwi does not occured(system does not enter hwi_function).  Then I paused the system in debug mode and I saw system entered abort function and logs said that "unplugged interrupt".

  • Hi everybody,

    I resolved the problem. The problem is that I tried the clear ecap interrupt flags inside of hwi function. As I understood, we can not clear the flags which related to hwi function itself. So we have to use seperate function to clear the flags like swi, task or idle function. I create each function types and I tried all fucntions one by one and I could clear ecap flags successfully. I follow these steps;

    1) Create ecap hwi function
    2) Use post method to clear flag (like swi_post ...)
    3) Clear ecap flags in post function