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: MCASP 回环测试失败

Part Number: AM5718

TI的工程师您好,我在使用AM5718的DSP核测试MCASP回环程序时遇到了一个问题,时钟线能输出我设置的频率对应的波形,同步线也一样,但是AXR引脚无法输出波形,接收缓冲区也无法接收到数据,设置的回调函数也无法触发,我在传输后查看TXSTAT和RXSTAT寄存器的值分别是0x171和0x175,也就是传输出现了错误,我在论坛上看了很多帖子,同时也查看了很多手册,没有找到哪里出了问题,希望您能帮我解答疑惑。

部分测试程序如下:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
* bsp_mcasp.c
*
* Created on: 2022310
* Author: lhy0611
*/
/* XDCtools Header files */
#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 <xdc/runtime/IHeap.h>
#include <xdc/runtime/Memory.h>
/* BIOS Header files */
#include <ti/sysbios/BIOS.h>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

期待您的回复,感谢!

  • 请问测试的是以下链接中的哪个例程?

    software-dl.ti.com/.../index_device_drv.html

  • 感谢回复,我是用的例程是DeviceLoopback_ExampleProject。

  • 您好,这是使用例程的输出:

    1.021] Error waiting for packets!
    [ 1.021]
    [ 1.021] Total frames sent: 0
    [ 1.021] Total frames received: 0
    [ 1.021]
    [ 1.021] ******************* Transmit Watch dog stats ****************
    [ 1.021] ------------ Error stats --------------
    [ 1.021] ***** isClkFailErr : 0
    [ 1.021] ***** isDMAErr : 0
    [ 1.021] ***** isSyncErr : 0
    [ 1.021] ***** retVal : -1
    [ 1.021] ***** isRcvOvrRunOrTxUndRunErr : 1
    [ 1.021]
    [ 1.021]
    [ 1.021] ******************* Receive Watch dog stats ****************
    [ 1.021] ------------ Error stats --------------
    [ 1.021] ***** isClkFailErr : 1
    [ 1.021] ***** isDMAErr : 0
    [ 1.021] ***** isSyncErr : 0
    [ 1.021] ***** retVal : -1
    [ 1.021] ***** isRcvOvrRunOrTxUndRunErr : 0
    [ 1.021]
    [ 1.021] Deleting Rx channel
    [ 1.021] Deleting Tx channel
    [ 1.021] UnBinding Mcasp
    [ 1.021] TEST FAIL: Test quit after sending 0 frames and receiving 0 frames.
    [ 1.021]
    [ 1.021] TEST FAIL: Ramp test never found sync on rx for Serializer=0, timeslot=0
    [ 1.021]
    [ 1.021] TEST FAIL: Ramp test never found sync on rx for Serializer=0, timeslot=1
    [ 1.021]
    [ 1.021] TEST FAIL:Some tests have failed

  • 好的,我帮您升级到英文论坛,会有相关专家给你提供支持。

    e2e.ti.com/.../am5718-mcasp-loopback-failed

  • 好的  感谢帮助,那边没有回复,您能帮我滴一下吗?

  • 好的,请耐心等待。

  • 您好,我尝试在不调用任何MCASPAPI的情况下,只配置MCASP3的时钟,对MCASP_TXBUFn寄存器进行写入和读取,但是在写入后读取寄存器的值仍然为0,而这个寄存器是可读可写权限的,这令我实在是感到不可思议。

    测试方法如下:

    for(i = 0;i < 4;i++)
    {
        HW_WR_REG32(0x48468200+4*i, 0x123);
        uint32_t regVal = HW_RD_REG32(0x48468200+4*i);
        System_printf("HW_RD_REG32:0x%x\r\n", regVal);
        Task_sleep(1000);
    }

    测试结果如下:

    HW_RD_REG32:0x0

    HW_RD_REG32:0x0

    HW_RD_REG32:0x0

    HW_RD_REG32:0x0

    这是为什么呢?

    期待您的解答,谢谢!

  • 您好,我收集了测试程序日志结果如下:

    [ 725.226282] omap_hwmod: mmu0_dsp1: _wait_target_disable failed
    [ 725.232193] omap-iommu 40d01000.mmu: 40d01000.mmu: version 3.0
    [ 725.240410] omap-iommu 40d02000.mmu: 40d02000.mmu: version 3.0
    [ 725.264981] omap_hwmod: mmu1_dsp1: _wait_target_disable failed
    [ 725.278081] omap_hwmod: mmu0_dsp1: _wait_target_disable failed
    [ 725.285865] remoteproc remoteproc2: stopped remote processor 40800000.dsp
    [ 725.293926] remoteproc remoteproc2: releasing 40800000.dsp
    [ 725.299993] omap-rproc 40800000.dsp: assigned reserved memory node dsp1_cma@99000000
    [ 725.315241] remoteproc remoteproc2: 40800000.dsp is available
    [ 725.328306] remoteproc remoteproc2: powering up 40800000.dsp
    [ 725.341552] remoteproc remoteproc2: Booting fw image dra7-dsp1-fw.xe66, size 5876360
    [ 725.358015] omap_hwmod: mmu0_dsp1: _wait_target_disable failed
    [ 725.363922] omap-iommu 40d01000.mmu: 40d01000.mmu: version 3.0
    [ 725.369916] omap-iommu 40d02000.mmu: 40d02000.mmu: version 3.0
    [ 725.394526] virtio_rpmsg_bus virtio1: rpmsg host is online
    [ 725.400078] remoteproc remoteproc2: registered virtio1 (type 7)
    [ 725.406077] omap-iommu 40d02000.mmu: iommu fault: da 0x46000000 flags 0x0
    [ 725.406084] remoteproc remoteproc2: crash detected in 40800000.dsp: type mmufault
    [ 725.406093] omap-iommu 40d02000.mmu: 40d02000.mmu: errs:0x00000002 da:0x46000000 pgd:0xd4361180 *pgd:px00000000
    [ 725.445954] remoteproc remoteproc2: remote processor 40800000.dsp is now up
    [ 725.455786] virtio_rpmsg_bus virtio1: creating channel rpmsg-proto addr 0x3d
    [ 725.465537] remoteproc remoteproc2: handling crash #1 in 40800000.dsp
    [ 725.477006] remoteproc remoteproc2: recovering 40800000.dsp
    [ 725.505384] omap_hwmod: mmu1_dsp1: _wait_target_disable failed
    [ 725.518459] omap_hwmod: mmu0_dsp1: _wait_target_disable failed
    [ 725.529416] remoteproc remoteproc2: stopped remote processor 40800000.dsp
    [ 725.536379] remoteproc remoteproc2: powering up 40800000.dsp
    [ 725.551553] remoteproc remoteproc2: Booting fw image dra7-dsp1-fw.xe66, size 5876360
    [ 725.568137] omap_hwmod: mmu0_dsp1: _wait_target_disable failed
    [ 725.574043] omap-iommu 40d01000.mmu: 40d01000.mmu: version 3.0
    [ 725.580027] omap-iommu 40d02000.mmu: 40d02000.mmu: version 3.0
    [ 725.604589] virtio_rpmsg_bus virtio1: rpmsg host is online
    [ 725.614004] remoteproc remoteproc2: registered virtio1 (type 7)
    [ 725.619962] omap-iommu 40d02000.mmu: iommu fault: da 0x46000000 flags 0x0
    [ 725.619968] remoteproc remoteproc2: crash detected in 40800000.dsp: type mmufault
    [ 725.619977] omap-iommu 40d02000.mmu: 40d02000.mmu: errs:0x00000002 da:0x46000000 pgd:0xed925180 *pgd:px00000000
    [ 725.658050] remoteproc remoteproc2: remote processor 40800000.dsp is now up
    [ 725.667794] virtio_rpmsg_bus virtio1: creating channel rpmsg-proto addr 0x3d

    似乎是有抢占资源的问题,您能帮我分析下原因吗?

    感谢!

  • 您好,我查询到这个remoteproc remoteproc2: crash detected in 40800000.dsp: type mmufault出现的原因是可能资源表没有配置正确,但是我按照手册配置过后输出结果依然是这样,是配置出了什么问题吗?

    config.bld如下:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /*
    * Copyright (c) 2013-2015, Texas Instruments Incorporated
    * All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * * Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * * Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the distribution.
    *
    * * Neither the name of Texas Instruments Incorporated nor the names of
    * its contributors may be used to endorse or promote products derived
    * from this software without specific prior written permission.
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    资源表配置如下:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /*
    * Copyright (c) 2017, Texas Instruments Incorporated
    * All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * * Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * * Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the distribution.
    *
    * * Neither the name of Texas Instruments Incorporated nor the names of
    * its contributors may be used to endorse or promote products derived
    * from this software without specific prior written permission.
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    感谢!

  • 您好,我将资源表修改后不再出现mmufault,TXTSTAT的值为0x50,但RXSTAT的值仍然为0x154出错状态,资源表如下:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /*
    * Copyright (c) 2017, Texas Instruments Incorporated
    * All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * * Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * * Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the distribution.
    *
    * * Neither the name of Texas Instruments Incorporated nor the names of
    * its contributors may be used to endorse or promote products derived
    * from this software without specific prior written permission.
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    您能告诉我一点解决问题的思路吗?

    感谢!

  • 您好,我通过修改寄存器初始化的配置,实现了STAT的值为0x50没有错误,但是在内部回环模式下接收buff里面数据仍然全是0,还缺少了什么配置吗?

    寄存器初始化配置如下:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    Mcasp_HwSetupData mcaspRcvSetup = {
    /* .rmask = */0xFFFFFFFF,
    /* All the data bits are to be used */
    /* .rfmt = */0x000080b0,
    /* 0 bit delay from framsync
    * MSB first
    * No extra bit padding
    * Padding bit (ignore)
    * slot Size is 24
    * Reads from DMA port
    * NO rotation
    */
    /* .afsrctl = */0x00000193, /* 3-slot TDM mode,
    * Frame sync is one word
    * Internally generated frame sync
    * Falling edge is start of frame
    */
    /* I2S MODE*/
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    /* .aclkrctl = */0x000000a0,   //这里是不是要设置为0x000000a3  与发送时钟一致?测试后没有作用
    /* .ahclkrctl = */0x00008000  //这里是不是要设置为0x00008003 与发送时钟一致?

    我参考了这个帖子 https://e2e.ti.com/support/processors-group/processors/f/processors-forum/916088/am5728-mcasp-data-not-being-received?tisearch=e2e-sitesearch&keymatch=RCKFAIL#  ,但没有理解到TRM手册上的24.6.1的这几句话:

    The device have integrated eight McASP modules with:
    • McASP1 and McASP2 supporting up to 16 channels with independent TX/RX clock/sync domain
    • McASP3 through McASP8 modules supporting up to 4 channels with independent TX/RX clock/sync
    domain

    McASP module includes the following main features:
    • Two modules (McASP1 and McASP2) supporting up to 16 channels each and independent TX/RX
    clock/sync domains.
    • Six modules (McASP3, McASP4, McASP5, McASP6, McASP7, and McASP8) supporting up to 4
    channels each and unified clock/sync domain.

    这样描述是否有冲突,是独立的还是统一的时钟同步?我按照帖子的做法配置了不同步的方式,并配置了rx时钟寄存器分频与tx时钟寄存器分频一致,但是并没有找到如何配置MCASP3_ACLKR引脚和MCASP3_FSR引脚,因为我并没有找到这两个引脚,修改后的寄存器初始化配置如下:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    Mcasp_HwSetupData mcaspRcvSetup = {
    /* .rmask = */0xFFFFFFFF,
    /* All the data bits are to be used */
    /* .rfmt = */0x000080b0,
    /* 0 bit delay from framsync
    * MSB first
    * No extra bit padding
    * Padding bit (ignore)
    * slot Size is 24
    * Reads from DMA port
    * NO rotation
    */
    /* .afsrctl = */0x00000193, /* 3-slot TDM mode,
    * Frame sync is one word
    * Internally generated frame sync
    * Falling edge is start of frame
    */
    /* I2S MODE*/
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    引脚以及时钟配置如下:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    void McASP3_Enable(void)
    {
    //uint32_t regVal = 0U;
    // Choose SYS_CLK2 (22.5792 MHZ) as source for ABE_PLL REF CLK
    HW_WR_FIELD32(
    CSL_DSP_CKGEN_PRM_REGS+CSL_CKGEN_PRM_CM_CLKSEL_ABE_PLL_SYS_REG,
    CSL_CKGEN_PRM_CM_CLKSEL_ABE_PLL_SYS_REG_CLKSEL,
    CSL_CKGEN_PRM_CM_CLKSEL_ABE_PLL_SYS_REG_CLKSEL_SEL_SYS_CLK1);//0x4ae0 6118
    /* Reprogram ABE DPLL for 451.584 MHz output on PER_ABE_X1_GFCLK line */
    // step 1: disable the PLL, if enabled (ex: via GEL)
    while (HW_RD_FIELD32(
    CSL_DSP_CKGEN_CM_CORE_AON_REGS+CSL_CKGEN_CM_CORE_AON_CM_CLKMODE_DPLL_ABE_REG,
    CSL_CKGEN_CM_CORE_AON_CM_CLKMODE_DPLL_ABE_REG_DPLL_EN)
    == CSL_CKGEN_CM_CORE_AON_CM_CLKMODE_DPLL_ABE_REG_DPLL_EN_DPLL_LOCK_MODE)
    HW_WR_FIELD32(
    CSL_DSP_CKGEN_CM_CORE_AON_REGS+CSL_CKGEN_CM_CORE_AON_CM_CLKMODE_DPLL_ABE_REG,
    CSL_CKGEN_CM_CORE_AON_CM_CLKMODE_DPLL_ABE_REG_DPLL_EN,
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    期待您的解答,感谢!

  • 可否总结一下您目前需要咨询的问题,我帮您继续升级,谢谢!

  • 感谢回复!

    好的,目前MCASP能够实现时钟引脚、同步引脚、AXR发送引脚能够输出波形,但是不管是内部回环还是外部IO短接,始终收不到数据。

    问题1:缺少了什么配置?

    问题2:如何可以在不重新调用mcaspSubmitChan的情况下重新自动传输?也就是连续传输模式。

    谢谢!

  • 您好,我已经实现回环传输数据。

    因为我在不关闭通道的情况下时钟线会一直输出,而数据线和同步线只是在调用mcaspSubmitChan的时候才有波形,而我希望MCASP一直传输数据,在传输完成后自动更改缓冲区地址并重新传输(不再第二次调用mcaspSubmitChan函数)

    目前剩下的问题:MCASP如何自动连续传输数据?

    期待您的意见,感谢!

  • 您好,我更换了一种方式,已经实现了连续传输。

    部分程序如下:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /*
    * Copyright (C) 2013-2017 Texas Instruments Incorporated - http://www.ti.com/
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the
    * distribution.
    *
    * Neither the name of Texas Instruments Incorporated nor the names of
    * its contributors may be used to endorse or promote products derived
    * from this software without specific prior written permission.
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    感谢您的帮助!