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.

CCS/TM4C1294NCPDT: TM4C1294NCPDT

Part Number: TM4C1294NCPDT
Other Parts Discussed in Thread: EK-TM4C1294XL

Tool/software: Code Composer Studio

Hey, 

I am trying to execute the example code for TM4C1294NCPDT SPI code. But while executing it shows DMA error. 

It will be so helpful if you can help out to solve this.

I am using "spiloopback_EK_TM4C1294XL_TI" example project from resource explorer

  • Hi Srinivasan,

    Are you using a EK_TM4C1294XL Launchpad? Did you make any changes to the out of the box spiloopback example? Which version of TI-RTOS for TivaC are you using?

    Todd

  • Hey Todd, 

    Thanks for the reply. I didn't change anything in the spiloopback code. 

    Ti-RTOS version: 2.16.00.08

  • Srinivasan,

    The output shown above does not match the spiloopback example.  The first two lines do, the beginning of the third seems to be truncated, and the next three don’t match the output from any TI-RTOS example.

    Have you built and run the unmodified spiloopback example?  If that doesn’t work, what output do you get?  

    Also, have you checked that the four wires necessary for the spiloopback example are connected as described in “Tiva EK-TM4C1294XL Settings and Resources” in the TI-RTOS 2.16 for TivaC Getting Started Guide?

    Thanks,
    Scott

  • Hey Scott, 

    Thanks for the reply.

    When I run the unmodified code its working. 

    Actually i only one change. I changed the data from unsinged char array to unsigned long. If i change to unsigned long it shows error 

    Error:

    Thanks and regards, 

    Srinivasan

  • Srinivasan,

    By changing masterTxBuffer from an array to an unsigned long, you are essentially defining a pointer, and “0xEE0000” is not a valid memory address.  

    In masterTaskFxn() this address of 0xEE0000 is placed into a SPI_Transaction structure and passed to SPI_transfer():

        /* Initialize master SPI transaction structure */
        masterTransaction.count = SPI_MSG_LENGTH;
        masterTransaction.txBuf = (Ptr)masterTxBuffer;
        masterTransaction.rxBuf = (Ptr)masterRxBuffer;

        /* Initiate SPI transfer */
        transferOK = SPI_transfer(masterSpi, &masterTransaction);

    The result is a DMA error due to the bad buffer address.

    Regards,
    Scott

  • Hey Scott, 

    Thanks for the reply. I understood the fact of changing the datatype from array to unsigned long, but "0xEE0000" is not an address. It's the data I want to send via SPI to another device. 

    If changing the datatype is the issue, how do i solve that ?

    Regards,

    Srinivasan.

  • masterTxBuffer is an array (buffer) of characters that are to be transferred.  This buffer address is specified in the SPI_Transaction structure that is passed to SPI_transfer(), as shown in the above snippet.  If you want to change the characters that are sent this example, you should change the contents of the character array, to the sequence of bytes to be sent.  You should also change the transfer count for the number of characters to be sent, in other words set the proper ‘masterTransaction.count’ in the SPI_Transaction structure.

    Regards,
    Scott