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: Issuing Adding SPI with DMA to the Ethernet/IP example

Part Number: MCU-PLUS-SDK-AM243X

Hi all,

I am trying to add SPI with DMA to the "ethernetip_adapter_generic_device_mii_demo_am243x-lp_r5fss0-0_freertos_ti-arm-clang" example.

I add SPI in the syscfg and copy "mcspi_loopback_dma.c" form the SPI example:

I'd like to use DMA mode and callback mode. However, when DMA is included, the program is trapped in

when initializing. The functions called before entering this handler are:

CMN_OS_init ();



               retVal = Udma_eventRegister 


                      HwiP_construct(&eventHandle->hwiObject, &hwiPrms); (udma_event.c line:1075)

Actually, including DMA (packet) alone would cause the problem, even without SPI.

Checking "Skip global event registration" in UDMA setting would make is problem happen later in the main task:





         I2C_open(instCnt, &gI2cParams[instCnt]);



Any idea what's the cause of this problem? 



  • Hi Hang,

    Have you tested the DMA+Callback mode in mcspi_loopback_dma example?

  • Hi QJ and Hang,

    I am encountering the very similar problem.

    I have tested the DMA+Callback mode in mcspi_loopback_dma example and it behaves as follows:

    the first time you load the program,the counsole will show "[MCSPI] Loopback example DMA mode started ...".

    the second time without touching any one of the switchs(MCU_PORz,MCU_RESETz,SoC_RESET_REQz),the counsole will show"ASSERT: 0.3654s: mcspi/v0/dma/udma/mcspi_dma_udma.c:MCSPI_udmaInitTxCh:351: UDMA_SOK == retVal failed !!!".The program is trapped in

    However,if you trigger one of the switches and load the program again,the counsole will show like the first time.

    so,whether the phenomenon is normal?

  • Hi Wang,

    Yes, me and my customer has tested this example with DMA and Callback

  • Hi Hang,

    Can you share your working CCS project of DMA + callback mode in mcspi_loopback_dma example?

  • Hi Wang,

    Sure. Note that there are some minor modifications in the TX and RX loop.


    passward: 4EME\c9R

    Meanwhile, allow me to share the EIP example here as well in case you want to reproduce my problem. If you debug this project, you will find it stuck at initiation and never reaches the main task.


    password: nLyYy2|6



  • Thanks Hang for sharing the projects.

  • From your code, you don't call the mcspi_loopback_dma function in the EI_APP_TASK_main(). If DMA is used, the memory shared by DMA and CPU should be configured as non-cacheable or cacheable with write-through.

  • Hi Wang,

    Thank you for the information. I have not added the loopback function yet, since the program trapped in initialization, which is in CMN_OS_init() and is even before EI_APP_TASK_main() is created. I think the program never reaches the return of CMN_OS_init(), because the break point set at the next line of CMN_OS_init() is never triggered. 

    Is it possible to reproduce the problem using the project I shared? You may also reproduce the problem by simply adding SPI with DMA and callback(you may use blank call back function) in the syscfg to the EIP example.



  • Hi Hang,

    I did a test this morning. Yes, I can reproduce the issue. I will spend some time tomorrow to debug it.  

  • Hi Hang,

    I am sorry for late response. I missed it since the thread was locked. 

    Now, I don't have the solution for DMA with callback in McSPI example.