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.

SK-AM62: Unexpected Errors in McASP1 and McASP2 When Changing McASP0 Transmit High Clock Parent

Part Number: SK-AM62

Tool/software:

Hello Team,

Changing the Transmit High Clock Parent of McASP0 unexpectedly caused errors in McASP1 and McASP2, which should not have been affected.

When McASP0's Transmit High Clock Parent was set to AUDIO_EXT_REFCLK0, all operations (submitTx, submitRx, startTx, startRx) for McASP1 and McASP2 returned SUCCESS.
※Project name: mcasp0-2_AUDIO_EXT_REFCLK0

playback wakeup!!
MCASP_submitTx 0 0 0 0 0 0
MCASP_submitRx 0 0 0 0 0 0
MCASP_start
MCASP start status -3
-1 -2 0 0 0 0

However, after changing McASP0's Transmit High Clock Parent to AUDIO_EXT_REFCLK1, all operations (submitTx, submitRx, startTx, startRx) for McASP1 and McASP2 returned Error.
※Project name: mcasp0_AUDIO_EXT_REFCLK1_mcasp1-2_AUDIO_EXT_REFCLK0

ERROR: Drivers_mcaspOpen:296: MCASP open failed for instance 0 !!!
playback wakeup!!
MCASP_submitTx -1 -1 -1 -1 -1 -1
MCASP_submitRx -1 -1 -1 -1 -1 -1
MCASP_start
MCASP start status -6
-1 -1 -1 -1 -1 -1

How can I make all operations (submitTx, submitRx, startTx, startRx) return SUCCESS for McASP1 and McASP2 when McASP0's Transmit High Clock Parent is set to AUDIO_EXT_REFCLK1, and McASP1 and McASP2 are set to use AUDIO_EXT_REFCLK0?

I would like to use different clock sources for McASP0 and McASP1/McASP2, so I do not want to unify them under a single clock source.

By the way, when clock supply from AUDIO_EXT_REFCLK1 is available, all McASP instances in both projects return SUCCESS for all operations (submitTx, submitRx, startTx, startRx).

playback wakeup!!
MCASP_submitTx 0 0 0 0 0 0
MCASP_submitRx 0 0 0 0 0 0
MCASP_start
MCASP start status 0
0 0 0 0 0 0

SDK Used:
mcu_plus_sdk_am62x_10_01_00_33

(38c0b99e-9d94-47c7-8fc8-14d80afdd29f)

  • It seems that the issue is caused by obj->isOpen being set to 0 in MCASP_getHandle within mcasp.c, but I’m not sure what is causing this.

    MCASP_Handle MCASP_getHandle(uint32_t index)
    {
    MCASP_Handle handle = NULL;
    /* Check index */
    if(index < gMcaspConfigNum)
    {
    MCASP_Object *obj;
    obj = gMcaspConfig[index].object;

    if(obj && (TRUE == obj->isOpen))
    {
    /* valid handle */
    handle = obj->handle;
    }
    }
    return handle;
    }

  • Hi Satoshi,

    Thank you for sending out the sample code. I tried  compiling your sample code. It is giving me some error like - 

    {PROJECT_ROOT}/AWECore/Lib cannot be found.

    Can you confirm if you haven't missed 'AWECore' folder in the zip or if the 'AWECore/lib' is necessary for the project?

    Regards,
    Ritapravo
  • Sorry, AWECore is not needed. You can simply remove it from the property link.


  • I recreated the project to try again. If you still encounter an error saying that 'AWECore/lib' cannot be found, please remove the AWECore-related linker settings from Properties > Build > GNU Linker > Libraries.

    0513.mcasp_issue_2.zip

  • Hi Satoshi,

    Thank you for the update. I am looking at the code and will come back to you in some time.

    Regards,
    Ritapravo

  • Hi Ritapravo,

    I’ve resolved the issue on my end. Unlike the attached project, I implemented the following approach:

    void Drivers_open(void)
    {
    
        Drivers_uartOpen();
        Drivers_mcaspOpen(MCASP1);
        Drivers_mcaspOpen(MCASP2);
        Drivers_udmaOpen();
    
    }
    
    void Drivers_mcaspOpen(uint32_t mcaspNum)
    {
        int32_t  status = SystemP_SUCCESS;
    
    
        gMcaspHandle[mcaspNum] = NULL;   /* Init to NULL so that we can exit gracefully */
    
    
        /* Open all instances */
    
        if(!gMcaspOpenParams[mcaspNum].skipDriverOpen)
            {
            gMcaspHandle[mcaspNum] = MCASP_open(mcaspNum, &gMcaspOpenParams[mcaspNum]);
            if(NULL == gMcaspHandle[mcaspNum])
                {
                DebugP_logError("MCASP open failed for instance %d !!!\r\n", mcaspNum);
                    status = SystemP_FAILURE;
            }
        }
    
        if(SystemP_FAILURE == status)
        {
            /* Exit gracefully */
            Drivers_mcaspClose();
        }
    
        return;
    }
    
    void main()
    {
        Drivers_open();
        Drivers_mcaspOpen(MCASP0_A2B1);
    }

    As a result, although the initial Open calls for McASP1 and McASP2 succeeded, the final Open call for McASP0 failed. This triggered a Close operation for all McASP instances. Consequently, by the time I attempted to retrieve all McASP handles, none of them were in an Open state.

    Since the issue has been resolved, I’m okay with closing this thread.

  • Hi Satoshi,

    Thanks for the confirmation update. Just wanted to know - opening the McASP0 instance [Drivers_mcaspOpen(MCASP0_A2B1)] after McASP1 and McASP2 solved the problem for you?

    Regards,
    Ritapravo

  • Hi Ritapravo,

    Yes, the issue has been resolved.

    After successfully initializing McASP1 and McASP2, the initialization of McASP0 failed. As part of the error handling process, all McASP instances were closed, which turned out to be the root cause of the problem.

    This issue occurred because I based my implementation on the auto-generated source code, which led to this behavior.

  • Hi Satoshi,

    Thank you for the update. Closing this thread.

    Regards,
    Ritapravo