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.

MCU-PLUS-SDK-AM243X: SPI DMA fail when transfer large size 4096

Part Number: MCU-PLUS-SDK-AM243X

Tool/software:

Hi  experts,

      When using the mcspi dma mode to communicate with peripherals, there is a problem if the transfer size is large.

         Set size = 128, normal.

         Set size = 4096, MCSPI_transfer() without return. Debug and found that only triggered MCSPI_udmaIsrTx().

     Import example project "mcspi_loopback_dma" and modify APP_MCSPI_MSGSIZE to 4096 can recurring the problem.

  • Hello,

    I am looking at your queries and you may expect reply in one or two days.

    Regards,

    Anil.

  • Hello ,

    I am able to reproduce  the issue and found that if we change the DMA size to 4096 bytes, then DMA transfer will not happen.

    I need to debug further the issue .

    My suggestion is that now split the DMA transactions two times.

    For example, you need to transfer 4096*2 bytes then call the MCSPI transfer two times with different source buffers.

    As per the SOC level, the MCSPI can support transfer to 16 * 2048 bytes in X - F FIFO mode. So, there is no problem to send more than 4096 bytes.

    I feel that this could be problem with software side and need to be debug further .

    Please look at the TRM below.

    Can you please confirm how many bytes you wanted to transfer from DMA ?

    Regards,

    Anil.

  • Hi Anil,

         We have tried to split 4096 to 2*2048 before, and test does work. But this issue makes us worry about whether there are some unknown DMA bugs, resulting in a stress test or specific scenario that still triggers issues. So we hope that the cause of this problem can be clarified. Currently we're using the polled mode, but we hope DMA mode to be safe so we can swith to dma mode at any time.

  • Hello liang luo,

    I understood your concern.

    But this MCSPI with DMA driver is matured one and most of the customers are using it .

    Unfortunately that most of the customers use not used beyond 4096 bytes.

    My suggestion is that please go with the DMA by triggering DMA twice to transfer 4096 bytes.

    I need to debug further why there is a limit at 4096 bytes. Once I get the solution, will update here. 

    Regards,

    Anil.

  • Hi Anil,

    Any update? Expect the issue to be confirm soon.

    Although the polled/interrupt mode meets our application, and we're also doing a 2048 bytes DMA stress test, as it may be used along with system loading adding for different application. 

  • Hello,

    I have already tired in my setup  to complete 4096 bytes with X and Y parameters configurations and still the DMA transaction is not completed.

    So, we need to debug further and as of now my suggestion is please go with 2048 bytes for two times to trigger to make the 4096 bytes transfer.

    I can raise the bug internally to fix this issue in MCU+SDK.

    Regards,

    Anil.

  • Hello Anil,

    Is there any new progress?

  • Hello ,

    I have already tired in my setup  to complete 4096 bytes with X and Y parameters configurations and still the DMA transaction is not completed.

    So, we need to debug further and as of now my suggestion is please go with 2048 bytes for two times to trigger to make the 4096 bytes transfer.

    I can raise the bug internally to fix this issue in MCU+SDK.

    As I mentioned above,  raised the bug internally to fix these issues in the MCU+SDK.

    Typically, these releases may take 3 Months' time. Meanwhile, Please try to adopt the above solution (Split two transfers) and proceed further.

    I can debug the issue on my side as well. If I get any solution, I can provide the solution.

    Regards,

    Anil.

  • Thanks,  we are trying to use the 2048-byte, and hope to identify the root cause of the issue soon.

  • Yes, sure you can go with the above solution.

    I will update the status once it is fixed in the MCU+SDK.

    Regards,

    Anil.

  • Hello Future readers ,

    I am closing this thread and raised the bug to fix these issues in the MCU+SDK.

    So, if you want to go with 4096 bytes, split the DMA TX two times to fix this issue temporarily .

    Regards,

    Anil.