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.

TMS320F28P550SJ: How to make spi work with dma

Part Number: TMS320F28P550SJ
Other Parts Discussed in Thread: LAUNCHXL-F28P55X, C2000WARE

Hi Experts,

With Launchxl-F28P55x, I select "spi_ex5_loopback_dma" from C2000Ware_5_02_00_00 to run under CCS V12. But it failed in DAM (line 202). I changed to 2nd board, it still failed.

By contrast, similar example code (spi_ex3_loopback_dma) running on F280049C launchpad works fine.  

As it is the example code, I lost.

Would you please verify it ?

Thanks,

Jeffrey Jin

  • Hi Jeffrey,

    Thank you for your question. Can you please tell me what specific error you see when you try to run the example?

    Thanks,

    Ira

  • Hi Ira,

    Please take a look of this example code from "spi_ex5_loopback_dma.c ":

    // DMA Channel 6 ISR
    //
    __interrupt void INT_mySPI0_RX_DMA_ISR(void)

    {
            uint16_t i;

            DMA_stopChannel(mySPI0_RX_DMA_BASE);
            Interrupt_clearACKGroup(INT_mySPI0_RX_DMA_INTERRUPT_ACK_GROUP);

           //
           // Check for data integrity
           //
           for(i = 0; i < 128; i++)
          {
                  if (rData[i] != i)
                  {
                         // Something went wrong. rData doesn't contain expected data.
                         ESTOP0;
                   }
           }

            done = 1;
            return;
    }

    If DMA works, it will transfer sData[] to rData[] via spi loopback. As here, sData[] = 0, 1, 2, 3, ....

    If rData[] are not as 0, 1, 2, 3, .. it will ESTOP. 

    The result is rData[] are all 0.

    Thanks,

    Jeffrey

  • Hi Jeffrey,

    Thank you for your patience. I was able to replicate your issue on my end. I tried running the same example from C2000Ware_5_05_0_0 and C2000Ware_6_0_0_0 and they were working fine. I was able to see the sdata in rdata. I would recommend upgrading to a newer version of C2000Ware where this example has been fixed.

    Thanks,

    Ira

  • Hi Ira,

    The issue is rData[] all 0 after running. 

    Thanks,

    Jeffrey 

  • Hi Jeffrey,

    Did you try it with the same example from C2000Ware_5_05_00_00? With this I was able to see the correct rdata[] after running it.

    Thanks,

    Ira

  • Hi Ira,

    Ok, I will follow up. On the other hand, it works on example in bitfield.

    Thanks,

    Jeffrey