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.

CC3220SF-LAUNCHXL: How to enable SPI DMA?

Part Number: CC3220SF-LAUNCHXL
Other Parts Discussed in Thread: CC3220SF

Hi,

    I read at UART Echo TI-RTOS Example Program that to enable DMA, just set TI_DRIVERS_UART_DMA at predefined symbols. How do I set DMA for SPI? Also, which code file has this TI_DRIVERS_UART_DMA?

    I am trying to implement SPI DMA driver for NeoPixel Ring RGB leds.

-kel

  • Hi Kel,

    DMA should be enabled on SPI when you cross the minDmaTransferSize threshold attribute defined in CC3220SF_LAUNCHXL.c. Please be sure that you are using CC3220 SDK 1.60, as there is a known SPI + DMA issue in v1.50.

    All CC3220-specific TI Drivers implementation are available in the peripheral folders in source/ti/drivers.

    Best regards,
    Sarah
  • Hi Sarah,

    Thanks for your reply. I am still learning how to implement SPI DMA. How do I "cross the minDmaTransferSize threshold attribute"? If I increase the value by +1 would that SPI DMA will be enabled?

    -kel
  • Hi Kel,

    Yes, if you complete a SPI transfer larger than the threshold minimum, the device will automatically use DMA. You can change the threshold minimum as well.

    Best regards,
    Sarah
  • Hi Sarah,

    I am using AWS IoT Plugin and it only *officially* works with SDK 1.4 although I am using it with 1.5 with no problems so far.

    What is the SPI DMA bug you speak of? Is there a work around I can use without updating the SDK to 1.6?  Unfortunately, the AWS IoT examples won't compile with 1.6.

  • Update:

    The problem I was having with SPI DMA transfers was that when I set minDmaTransferSize = 1 (in order to force use of the DMA), only the first frame would be transferred. It seems like the DMA interrupt wasn't telling the SPI hardware to send the next frame.

    When I set minDmaTransferSize to something larger than the message I'm trying to send, the SPI driver went into polling mode and everything worked correctly.

    I looked into the differences between the SPI and DMA drivers in Simplelink SDK version 1.50.00.06 and 1.60.00.04.

    UDMACC32XX.c - No Change
    UDMACC32XX.h - No Change
    SPICC32XXDMA.c - Different
    SPICC32XXDMA.h - No Change

    Added the new SPICC32XXDMA.c to my project and SPI DMA works now.
  • Hi ironman,

    Copying SPICC32XXDMA.c and .h from v1.60 into your project will resolve the issue. There was a bug introduced in v1.50 that stopped the SPI DMA transfer prematurely, and the fix was included in v1.60.

    Best regards,
    Sarah