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.

AM5726: Using MCASP on DSP RTOS with ARM Linux

Part Number: AM5726
Other Parts Discussed in Thread: SYSBIOS

Hi,

I am trying to setup a MCASP channel on the DSP1 core of our AM5726. I have tried the "MCASP_Audio_evmAM572x_c66ExampleProject" and succesfully modified it for my requirements (changed the clock speed, edma configuraiton etc.)

Now I want to have an application running on DSP1 with MCASP and EDMA along with the Linux running on A15. When I try this, it appears that the application gets stuck at the line

"hEdma = edma3init(EDMACC_NUM, &edmaResult);"

I am guessing this is because both the Linux and DSP1 is trying to access the same resources. Since the Linux part is not going to use any MCASP channels, I think my fix should be easy. What are the changes I should do in my Device Tree or in my DSP1 app so that I can use a MCASP channel with EDMA on DSP1? I want to use MCASP3 -> AXR0 and AXR1 with 4.096 MHz Clock.

Edit: After changing the EDMACC_NUM from 0 to 1 the code no longer gets stuck at the line given above. However, now the trace output displays the following messages:

[      0.020] [t=0x00e5364e] ti.sysbios.family.c64p.EventCombiner: ERROR: line 235: E_unpluggedEvent: Event# 75 is unplugged
[      0.020] ti.sysbios.family.c64p.EventCombiner: line 235: E_unpluggedEvent: Event# 75 is unplugged
[      0.020] xdc.runtime.Error.raise: terminating execution

What could be the cause here?

Thanks in advance,

  • Hi, 

    I have managed get the code working with no errors. The ACLKX and FSX signals are working fine. However, I can't send or receive anything from AXR0 and AXR1. I am guessing the issue is related to my EDMA and Xbar configuration but I am not sure.

    Can you help me identify the issue here?

    Thanks,

    Talha

  • Hello,

    Can you please state how you got rid of the error.

    [      0.020] [t=0x00e5364e] ti.sysbios.family.c64p.EventCombiner: ERROR: line 235: E_unpluggedEvent: Event# 75 is unplugged
    [      0.020] ti.sysbios.family.c64p.EventCombiner: line 235: E_unpluggedEvent: Event# 75 is unplugged
    [      0.020] xdc.runtime.Error.raise: terminating execution

    I am currently stuck there too.

    Thanks

  • Hi Hermann,

    Unfortunately I am not sure what I changed. I have started from scratch. I think I have disabled everything related to MCASP on the linux side and that removed the error. However, I still cannot receive or transmit anything.

    Can anybody help me with this?

  • Hello, I got rid of the "Event# 75 is unplugged" error and got my system working.

    I think it was the Configure_XBAR() function. I ported the software from an earlier SDK which had a different configuration. The current one needs all McASPs configured, even if not used.

        CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,128,1+CSL_EDMA3_CHA_MCASP0_RX);
    	CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,129,1+CSL_EDMA3_CHA_MCASP0_TX);
    	CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,130,1+CSL_EDMA3_CHA_MCASP1_RX);
    	CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,131,1+CSL_EDMA3_CHA_MCASP1_TX);
    	CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,132,1+CSL_EDMA3_CHA_MCASP2_RX);
    	CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,133,1+CSL_EDMA3_CHA_MCASP2_TX);
    	CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,134,1+CSL_EDMA3_CHA_MCASP3_RX);
    	CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,135,1+CSL_EDMA3_CHA_MCASP3_TX);
    	CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,136,1+CSL_EDMA3_CHA_MCASP4_RX);
    	CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,137,1+CSL_EDMA3_CHA_MCASP4_TX);
    	CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,138,1+CSL_EDMA3_CHA_MCASP5_RX);
    	CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,139,1+CSL_EDMA3_CHA_MCASP5_TX);
    	CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,140,1+CSL_EDMA3_CHA_MCASP6_RX);
    	CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,141,1+CSL_EDMA3_CHA_MCASP6_TX);
    	CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,142,1+CSL_EDMA3_CHA_MCASP7_RX);
    	CSL_xbarDmaConfigure(CSL_XBAR_DMA_CPU_ID_EDMA,143,1+CSL_EDMA3_CHA_MCASP7_RX);

    I also added the event combiner module to my dsp.cfg, the same way as the example does it.

    Further the Mcasp_ChanParams and Mcasp_HwSetupData  must be consistent within itself and with the used codec. Otherwise it will produce strange errors. You have to consult the datasheet and walk through all the register configurations.

    I also had the case when I could not send or receive anything. This was a pinmux problem.

    I use rx-tx synchronous and the McASP is clocked by the codec.

    	{MCASP2_ACLKX, (M0 | PIN_INPUT | VIRTUAL_MODE10)},	/* A19 mcasp2_aclkx.mcasp2_aclkx */
    	{MCASP2_FSX, (M0 | PIN_INPUT | SLEWCONTROL | VIRTUAL_MODE10)},	/* A18 mcasp2_fsx.mcasp2_fsx */
    	{MCASP2_AXR2, (M0 | PIN_INPUT | SLEWCONTROL | VIRTUAL_MODE10)},	/* C15 mcasp2_axr2.mcasp2_axr2 */
    	{MCASP2_AXR3, (M0 | PIN_INPUT | SLEWCONTROL | VIRTUAL_MODE10)},	/* A16 mcasp2_axr3.mcasp2_axr3 */

    You might have to recompile the bootloader, MLO.

    Depending on the length an format of your audio samples you might need to rotate them before sending or after receiving.

    I use 16bit samples MSB first. Therefore I have to rotate them right  by 16 on the tx side. Otherwise there would be no output.

    Also check your caching (Cache_inv).

    And reboot your device after you changed the configuration. The driver does not seem to reset everything by itself.

    BR.