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.

ISDK CPSW driver interrupt issue

I am using the AM335x ISDK V1.1.0.3 and am experiencing an issue with the CPSW driver. My application requires that the DMA service an interrupt every 1.5ms. If the NDK (CPSW) is running, I am getting DMA receive overflow errors which indicates that my DMA ISR is not handling the interrupts fast enough. If the NDK (CPSW) is not running, my DMA works with no errors. I have tracked the issue down to the cpsw_ethdriver.c file. The functions CpswHwPktTxNext() and Cpsw_HwPktPoll() both globally disable interrupts by calling CPSW_DISABLE_INTERRUPTS() before doing some work. The problem is that their work could take an undefined amount of time to complete before CPSW_RESTORE_INTERRUPTS() is called. I believe this is why my DMA ISR is being starved. In these functions, I have replaced CPSW_DISABLE_INTERRUPTS() with Disable_EMAC_Interrupts() and replaced CPSW_RESTORE_INTERRUPTS() with Enable_EMAC_Interrupts(). This change should only disable the CPSW CPSW_RX_PULSE_INTNUM and  CPSW_TX_PULSE_INTNUM interrupts without having to globally disable interrupts while the functions complete their work. Are there any potential issues that I am overlooking?

  • Hello,

    Thanks a lot for the feedback. The point you raised seems to be correct and I do not think there will be any other potential issues as an effect of this change.

    Let us know if you face any further issues.

    Regards,
    Vinesh

  • I started having transmission issues after implementing my workaround. Sometimes the transmission would stop and sometimes I would get a data exception. It turns out that the functions Disable_EMAC_Interrupts() and Enable_EMAC_Interrupts() are not implemented correctly. They do NOT disable or enable the CPSW TX and RX interrupts. If you take a look at Interrupt_disable() and Interrupt_enable() (in intmgmt.c), these functions will only enable/disable the interrupt if sysEvtCount is set to 1 and sysEvtId[0] is set to the interrupt number. Could someone from TI verify this? Thanks.