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.

TMS320F280049C: Reset of circular buffer FSI communication using DMA

Part Number: TMS320F280049C

Hi,

I have a question concerning the FSI communication between multiple F28004x control cards. I want to send and receive 8 words frame using DMA, I did these settings in the lead device :

    FSI_setTxFrameType(FSITXA_BASE, FSI_FRAME_TYPE_NWORD_DATA);
    FSI_setTxSoftwareFrameSize(FSITXA_BASE, nWords); // nWords = 8
    FSI_setTxDataWidth(FSITXA_BASE, nLanes);
    FSI_setTxUserDefinedData(FSITXA_BASE, txUserData);
    FSI_setTxFrameTag(FSITXA_BASE, txDataFrameTag);
    FSI_setRxSoftwareFrameSize(FSIRXA_BASE, nWords); // nWords = 8
    FSI_setRxDataWidth(FSIRXA_BASE, nLanes);

I configured DMA to uptade TX buffer. I have a question about reseting the RX and TX circular buffer, currently I'm resetting them in the DMA_ISR but is it necessary to do it or it will restart automaticly to beginning after the 8th word because we specified the frame size as 8 words?

And if it is necessary to do it, can we do it with another way than by the CPU, using the DMA or something else?

Thank you in advance for your answer !

  • Hi,

    I have a question about reseting the RX and TX circular buffer, currently I'm resetting them in the DMA_ISR but is it necessary to do it or it will restart automaticly to beginning after the 8th word because we specified the frame size as 8 words?

    It will only reset back to the beginning by itself after 16 words are transmitted out. So you have the two options below since you're using 8 word frames:

    1. Reset the buffer pointer in software after each frame TX, using only the first 8 word slots of the buffer in this case.
    2. Configure the DMA to wrap after moving 16 words and use the full 16 word buffer size.
      1. DMA will move 8 words into the 1st half of the FSI TX buffer (1st frame), and then 8 more words into the 2nd half of the FSI TX buffer (2nd frame). The FSI TX buffer pointer will wrap back around by itself without additional software in this case.

    Best,

    Kevin

  • Hi Kevin Allen,

    Thank you very much for your reply,

    Configure the DMA to wrap after moving 16 words and use the full 16 word buffer size.
    1. DMA will move 8 words into the 1st half of the FSI TX buffer (1st frame), and then 8 more words into the 2nd half of the FSI TX buffer (2nd frame). The FSI TX buffer pointer will wrap back around by itself without additional software in this case.

    The thing is that in my case I only want to send one 8 words frame at every ePWM period in which the data to send is updated by DMA before the next sending of a frame. And I would like to avoid reseting the buffer pointer in software, I'm thinking about reseting it by DMA when TX finishes transfert. Do you know any other best way to do it?

    Thank you, best regards,

    Alfayed

  • Hi Alfayed,

    You can do what I mentioned in #2. The DMA will move 8 words and then an FSI packet will be transmitted, then the DMA will move 8 more words into the next 8 buffer slots and an FSI packet will be transmitted. The FSI transmit buffer pointer will reset back to the start after the 2nd packet all by itself.

    You'll need to configure the DMA to perform two 8 word transfers to the FSI TX buffer before wrapping back around to the start. I think this is the best way to avoid additional software control.

    Best,

    Kevin