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.

TMS320F28375D: USB function interferes with SPI communication

Part Number: TMS320F28375D
Other Parts Discussed in Thread: C2000WARE

In this customer application, SPI is communicating at 1Mbps and a Timer0 interrupt is polling the FIFO. Once in a while the buffer is overflown; after debugging the problem we came to the conclusion that the USB is suspending interrupts and causing the issue. Since the USB is compiled as a library, I am looking for suggestions on how to handle the problem. Is there a way for the USB not to suspend interrupts and therefore not interfere with the SPI functions?

Thank you!

  • Hi Lenio,

    Is USB also used in the customer application ?  USB Lib will enable/disable interrupts related to USB events. Can you let us know which interrupt is getting suspended?

    Best Regards

    Siddharth

  • It is Timer0, running on FreeRTOS. Yes, USB is being used in the application. 

  • I received an update from the customer stating that Timer0 interrupt seems to being preempted by a function in the USB stack. The USB in and of itself should be lower priority than Timer0, so I need help understanding why any of its operation would preempt Timer0. This has been verified by adding a GPIO assertion in the beginning and in the end of Timer0 ISR. The FIFO overflow coincides with a longer Timer0 ISR duration.

    Thank you!

  • Customer has made some additional modifications to the code and also clarified few aspects.

    The setup actually uses SCI and not SPI as I had originally stated. (SCI-B). The baud is 1Mbps. The USB is used to communicate to a tablet. The SCI communication works without issues if the tablet isn't connected, in other words, it does not matter whether USB is enabled or not, what matters is whether USB is having traffic. The problem is the same as before: the buffer is getting full. 

    The modification was to remove the Timer0 interrupt and use a regular RX interrupt. The RX interrupt is happening after the FIFO gets full.

    Let me know if you have any ideas on how to debug the issue.

    Thank you!

  • Hi Lenio,

    I had a look at the USB library source code and could not find any code which suspends the interrupts.

    Request you to check with the customer on handling of the USB interrupt. One reason maybe that the USB ISR is taking long time and hence other interrupts are missed.

    Also, the USB Library source is included in the C2000Ware package under the <C2000WareInstallDir>/libraries/communication/f2837xd.

    Best Regards

    Siddharth