Post Go back to editing

MDMA and SPU configuration

Category: Software
Product Number: SC753

I'm using the SC573 Ezkit, and am using a project that's derived from the ADC_DAC_Playbook example, which outputs audio from Sharc core 1. I have added simple MDMA functionality, with the ARM core as the master and Sharc 1 as the slave.

I have discovered that once the SPU is intialised (on the Sharc, as per which is a part of the ADC/DAC example), MDMA doesn't work correctly. Although the receive interrupt fires on the Sharc, the received data is all zeros. Conversely, when the SPU isn't initialized (which causes the SPORTs not to work), MDMA works ok. I have tried enabling the "Master secure" mode on the ARM, but it makes no difference.

First question is whether the "all zeros" MDMA transfer behavior is normal when the SPU isn't configured correctly?

Second question, am I right in thinking the if the SPU is initialized, I need to enable the secure master/slave on the ARM and Sharc? The snippets below make no difference.

Third question, why is it necessary to initialize the SRU to use the SPORT in the first place?

ARM (MDMA master):

    if(adi_spu_EnableMasterSecure(hSpu, MDMA0_SRC_DMA8_SPU_PID, true) != ADI_SPU_SUCCESS)
    {
        printf("Failed to enable Master secure for MDMA 0 Source\n");
        return (ADI_SPU_FAILURE);
    }

    /* Make MDMA0 Destination to generate secure transactions */
    if(adi_spu_EnableMasterSecure(hSpu, MDMA0_DST_DMA9_SPU_PID, true) != ADI_SPU_SUCCESS)
    {
        printf("Failed to enable Master secure for MDMA 0 Destination\n");
        return (ADI_SPU_FAILURE);
    }


Sharc (MDMA slave):

#define LSMDMA0_DDE8_ID 			88
#define LSMDMA0_DDE9_ID 			89

/* Initialize SPU Service */
if(adi_spu_Init(0u, SpuMemory, NULL, NULL, &hSpu) != ADI_SPU_SUCCESS)
{
DBG_MSG("Failed to initialize SPU service\n");
return (ADI_SPU_FAILURE);
}

//snipping the SPORT configurations

	/* MDMA stream 0 SRC channel */
	if(adi_spu_EnableSlaveSecure(hSpu, LSMDMA0_DDE8_ID, true) != ADI_SPU_SUCCESS)
	{
		DBG_MSG("Failed to enable Slave secure for DMA stream 0 SRC channel\n");
		return (ADI_SPU_FAILURE);
	}

	/* MDMA stream 0 DST channel */
	if(adi_spu_EnableSlaveSecure(hSpu, LSMDMA0_DDE9_ID, true) != ADI_SPU_SUCCESS)
	{
		DBG_MSG("Failed to enable Slave secure for DMA stream 0 DST channel\n");
		return (ADI_SPU_FAILURE);
	}

Thanks in advance!

Thread Notes