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.

CC2340R5: SPI DMA transfer fail

Part Number: CC2340R5

Hi,

When i do a stress test in external flash with read/write, i had encountered an SPI DMA transfer issue.

The test flow as below:

while (1) {
    //adc check vbat and thermistor
    //ble scan(work as observer) and store to flash
    //sleep 10s
}

During store to flash, functions call as below:
NVS_write() with flag NVS_WRITE_PRE_VERIFY -> NVSSPI25X_write() -> doWriteVerify() -> doRead() -> extFlashSpiRead() -> SPI_transfer() -> SPILPF3DMA_transfer()

Since the SPILPF3DMA_hwAttrs.minDmaTransferSize = 10 and doRead() will read 256 bytes, so it it will use DMA for transfer.

When the issue occurs, MCU send SPI read command but it didn't create any CLK of SPI to read data from external flash, as below:
(sorry i don't unknow why i cannot uplaod the picture here, maybe i can try to uplaod it on the commet)

And we try to debug it, we found that, when this issue occurs, it also run to function primeTransfer() and execute below codes, but no any CLK of SPI happen:

 if (!object->manualStart)
{
        enableSPI(handle);
        /* Enable DMA to generate interrupt on SPI peripheral */
        enableDMA(hwAttrs->baseAddr, SPI_DMACR_TXEN | SPI_DMACR_RXEN);
        UDMALPF3_channelEnable(hwAttrs->rxChannelBitMask | hwAttrs->txChannelBitMask);
}

More information:
1. We use SDK simplelink_lowpower_f3_sdk_8_40_02_01
2. When the issue occurs, the SPI send in polling work well, but send in DMA alway fail
3. When debuging in fail case, after executed enableDMA(hwAttrs->baseAddr, SPI_DMACR_TXEN | SPI_DMACR_RXEN); the register REQDONE of DMA is 0x00000000, but in normal case, it will be 0x00000001. I am not sure if this infromation will be helpful for or not.

Please help to check it, we appreciate any freeback from you.

BR,
Edwin

  • Sorry i try to upload the above mentioned picture here, but the website always said
    "We apologize, but an unexpected issue prevented the page you requested from being available. We've logged the issue so the site administrator can resolve the problem."

  • Hi Edwin,

    Thank you for posting the details of your SPI DMA failure.  I am already in communication with   who has alerted us to this condition you are reporting.  Please allow us additional time to understand the issue.  It would be appreciated if you could provide any code examples or instructions for which TI could replicate the behavior.

    I have also had difficulty in posting images to the E2E forum for the past two days.  Please allow time for the web developers to diagnose and fix the problem.

    Regards,
    Ryan

  • Hi Ryan,

    Thanks for your response.

    I had provide some pseudocode to Shuyang and he implement a test demo.
    In my opinion, it would be better if we can have a meeting to debug it remotely on my side, becasue i can reproduce this issue and i am not sure if you can reproduce on your side.

    BR,
    Edwin

  • Hi Edwin,

    Please speak with Shuyang about this topic.  From what I gather he has been able to replicate the issue and is already engaged with the TI Drivers R&D Team to diagnose and ultimately resolve the behavior.

    Regards,
    Ryan