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.

AM5728: SPI issues

Part Number: AM5728


Hi Support,

using PRSDK 4.0 my customer is facing issues with SPI, in particular:

  • I need two single-channel DMA-mode SPI's working simultaneously on a single AM5728 device (currently on a GP EVM). Namely, the SPI3 is master, SPI4 is slave.
  • Using a modified PDK's example from: 
    ~/ti/pdk_am57xx_1_0_7/packages/MyExampleProjects/MCSPI_SlaveMode_MasterExample_idkAM572x_armExampleProject/
    I'm currently able to configure SPI3 into master DMA mode, SPI4 into slave non-DMA mode only...
  • What I'm missing now, is the knowledge in which files and how to configure SPI4's DMA channels?

Can you kindly help me solving these issues?

Thanks and regards,

Alberto

  • Alberto,

    As I indicated earlier the Processor SDK RTOS release has EDMA and non EDMA implementation example of the SPI driver usecase. Inorder to check how to configure the EDMA for a SPI instance, trace the MACRO SPI_DMA_ENABLE inside the MCSPI slave example provided in the directory:
    pdk_am57xx_1_0_7\packages\ti\drv\spi\example\mcspi_slavemode\src

    Regards,
    Rahul
  • Hi, Rahul

    Is there a similar sample code for am335x running Linux?

    BR
    Yang
  • Yang,

    My understanding is SPI slave EDMA implementation is currently only supported in the RTOS SDK. I will ping my colleagues in the Processor SDK Linux team to confirm this understanding and provide the correct guidance on this issue.

    Regards,
    Rahul
  • Hi, Rahul

    Great, thanks.

    Yang
  • Rahul,

    please let me konw asap if EDMA mode is supported also under Linux or only when using TI-RTOS. Customer is in fact stopped and waiting for that.

    Thanks,

    regards,

    Alberto

  • Alberto,

    As I indicated the the EDMA implementation for the SPI driver is supported in Processor SDK RTOS. For Processor SDK Linux, I don`t think the SPI slave driver implementation is supported.
    processors.wiki.ti.com/.../Linux_Core_SPI_User's_Guide

    Regards,
    Rahul
  • Rahul,

    I met customer and I have accurate situation now.
    They need to implement SPI on AM572x with our EVM running Processor RTOS. What they need is to implement SPI4 with EDMA.
    Actually DMA XBAR is supporting only SPI3 (pins 14 and 15) and not SPI4 (pins 70 and 71).
    Can you kindly provide inputs on how to enable SPI4 with EDMA on AM572x EVM?

    Thanks for your support,
    Alberto
  • Alberto,

    Can you clarify where in the TRM are you seeing the DMA XBAR supporting only SPI3 and not SPI4 ?? Are you looking at Table 16-6 ??

    Regards,
    Rahul
  • Hi Rahul,

    thanks for your and Alberto's help. Perhaps we can now continue without Alberto's intermediary to save his time.

    We were refering to table 16-87, i. e. the default EDMA mappings. There are mappings for SPI1,2,3, but not for SPI4.-

    It must be remapped with XBAR, this is clear to us. However, we are not sure about the right set of API calls with respect to all the components around:

    - how should we choose the right EDMA channel to map the crossbar to?

    - what other system parts must be re-configured, in order to get SPI4 running in DMA mode (assuming that we can already run it in non-DMA mode)?

    - what API calls should be used to achieve these?

    We have tried to select the target EDMA channel arbitrarily with no success so far..

    CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA, 70, CSL_XBAR_INST_DMA_EDMA_DREQ_17);

    CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA, 71, CSL_XBAR_INST_DMA_EDMA_DREQ_18);


    Could you please  point out, what are we missing?

    Thanks

    Ivan

  • Raul, team,

    Can you please provide a feedback?
    Thanks
    Alberto
  • Sorry, I was side tracked on this issue. The EDMA XBAR mapping is handled in the edma3 LLD sample driver (edma3/drv/sample/src), SPI UART test code does not do any configuration, have you taken a look at the sample driver in EDMA LLD.

    Also, in this case the MCSPI interrupt triggers the EDMA event so should the hook up from CSL perspective be:
    CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA, 70, 1+ CSL_EDMA3_CHA0_MCSPI3_RX);
    CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA, 71, 1+ CSL_EDMA3_CHA0_MCSPI3_TX);

    An example of this has been demonstrated in MCASP AM57xx driver in Configure_XBAR in file pdk_am57xx_1_0_7\packages\ti\drv\mcasp\example\evmAM572x\src\Audio_evmInit.c

    Let us know if this helps.

    Regards,
    Rahul