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.

AM5718: DSP核使用MCSPI无法触发EDMA中断

Part Number: AM5718

TI的工程师您好,我参考了TI的SPI EDMA传输例程,在使用轮询的方式下MCSPI1能够回环传输数据,但是在使用EDMA的时候,始终无法触发中断,SPI部分代码如下:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <xdc/std.h>
#include <xdc/cfg/global.h>
#include <xdc/runtime/System.h>
#include <xdc/runtime/Error.h>
#include <xdc/runtime/Diags.h>
#include <xdc/runtime/Log.h>
#include <xdc/runtime/Assert.h>
#include <xdc/runtime/Registry.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/knl/Clock.h>
#include <ti/sysbios/hal/Hwi.h>
#include <ti/ipc/Ipc.h>
#include <ti/ipc/MessageQ.h>
#include <ti/ipc/MultiProc.h>
#include <stdio.h>
#include <ti/csl/example/utils/common/inc/app_utils.h>
#include <ti/csl/soc.h>
#include <ti/csl/hw_types.h>
#include <ti/csl/csl_edma.h>
#include <ti/csl/arch/csl_arch.h>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

我在单独使用EDMA在内存中传输数据时能够触发中断,但是为什么变成MCSPI事件触发就无法成功了呢?

期待您的宝贵意见!谢谢!

  • 请详细说明一下是在哪个例程上做了哪些修改。

  • 例程:processor_sdk_rtos_am57xx_06_03_02_08\pdk_am57xx_1_0_18\packages\ti\csl\example\mcspi\mcspiMasterSlave\mcspiMasterSlave_spi1_spi2.c

    修改部分:1、static int EDMA3IntConfigure(void);  2、SOC_EDMA_TPCC_BASE_VIRT换成CSL_DSP_DSP_EDMA_CC_REGS

    修改原因:1、找不到IntRegister等函数。2、程序运行失败

    也参考了MCSPI_BasicExample_Dma_idkAM571x_c66xTestProject的方式,但是程序会卡在edma3init,因此没有采用这种方式。

    参考帖子:https://e2e.ti.com/support/processors-group/processors/f/processors-forum/922081/tda2hg-mcspi-edma-rx-event-can-t-receive/3432812?tisearch=e2e-sitesearch&keymatch=MCSPI%2525252520EDMA#3432812

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/651588/am5728-rtos-issues-with-spi?tisearch=e2e-sitesearch&keymatch=MCSPI%2525252520EDMA#

    尝试了很多种方式,也看了很多论坛的帖子,没有找到可以使用的方式,如果这种方式不能够使用的话,您能提供一个例程吗?

  • 好的,稍后我会升级到英文论坛。

  • 你好,发布到英文论坛了吗

  • 您好,Nancy,我使用LLD的方式(MCSPI_BasicExample_Dma_idkAM571x_c66xTestProject)实现了EDMA传输,解决方式是将edmainit的edma3Id改为1,但是又回到了我之前一个帖子的问题(https://e2echina.ti.com/support/processors/f/processors-forum/215638/am5718-dsp-spi),最大只能使用3Mhz了(使用超过3Mhz的CLK时在示波器能看到输出波形,数据量小的时候可以进入回调函数,但是无法传输数据,而数据量大的时候会卡在spi_transfer,也不会进入中断回调函数),部分测试代码如下:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /****************************************************************************************************************/
    /****************************************test_spi_LLD************************************************************/
    /****************************************************************************************************************/
    #include <string.h>
    /* XDCtools Header files */
    #include <xdc/std.h>
    #include <xdc/cfg/global.h>
    #include <xdc/runtime/System.h>
    #include <stdio.h>
    #include <ti/sysbios/knl/Task.h>
    /* BIOS Header files */
    #include <ti/sysbios/BIOS.h>
    #include <xdc/runtime/Error.h>
    /* TI-RTOS Header files */
    #include <ti/drv/spi/SPI.h>
    #include <ti/drv/spi/soc/SPI_soc.h>
    #include <ti/drv/spi/src/SPI_osal.h>
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    所以目前有两个问题:

    1、CSL的方式如何才能触发EDMA中断?

    2、LLD的方式为什么不能实现48Mhz传输?

  • 你好,Nancy,很抱歉,就在刚刚回复你过后,我实现了LLD方式48Mhz传输,在分配内存前增加了 #pragma DATA_ALIGN (txBuf, 32),但是每次只能传输32字节,这是在手册上规定的吗,可我在手册上没有看到,还需要注意哪些地方才能传输更大的数据呢?

  • 应该没有字节数的限定,这部分内容我没有测试过,我认为可能是与EDMA部分的配置有关系。

    https://www.ti.com/lit/ug/sprugs5b/sprugs5b.pdf

    https://e2echina.ti.com/support/processors/f/processors-forum/194970/edma3-sysbios

  • 好的,我再研究下,谢谢!

  • 谢谢你,Nancy,我在使用了04版本的RTOS SDK过后,这部分问题解决了,没有字节数的限制。

  • 好的,感谢分享!

  • 非常抱歉,最近测试出,之前触发的只是SPI传输中断,并不是DMA中断,如果在cfg文件中调用Spi.Setting.useDma="true";就无法再触发回调函数了,也就是说,DMA传输并没有成功。

x 出现错误。请重试或与管理员联系。