Hi,
I am developing for C6678 DSP.
Srio_start fails with "Error: Initializing CPPI for SRIO CPDMA" error on all cores except #0. I did investigation and found bug in the function (srio_drv.c in PDK):
Srio_DrvHandle Srio_start (Srio_DrvConfig* ptr_cfg)
{
Srio_DriverInst* ptr_srioDrvInst;
uint8_t isAllocated;
int32_t result;
Cppi_CpDmaInitCfg srioCPDMACfg;
void* multiCoreCSInfo;
int16_t txQueueNum;
/* Basic Parameter Validation: Ensure that a valid configuration block was passed */
if (ptr_cfg == NULL)
return NULL;
/* Allocate memory for the SRIO driver instance. */
ptr_srioDrvInst = (Srio_DriverInst *)Srio_osalMalloc (sizeof(Srio_DriverInst));
if (ptr_srioDrvInst == NULL)
return NULL;
/* Initialize the allocated block of memory */
memset ((void *)ptr_srioDrvInst, 0, sizeof(Srio_DriverInst));
/* Copy the configuration block into the driver instance */
memcpy ((void *)&ptr_srioDrvInst->cfg, (void*)ptr_cfg, sizeof(Srio_DrvConfig));
/* Setup the SRIO CPDMA Configuration and open the SRIO CPDMA instance; this needs to be done
* for each instance also; since this can be done on each core. */
srioCPDMACfg.dmaNum = Cppi_CpDma_SRIO_CPDMA;
if (Cppi_open (&srioCPDMACfg) == NULL)
{
Srio_osalLog ("Error: Initializing CPPI for SRIO CPDMA\n");
return NULL;
}
....
srioCPDMACfg is a structure on stack that is not initialized fully (contains memory rubbish) and is passed to Cppi_open function, which in turn uses all the field of the structure and may fail if they are not ok:
Cppi_Handle Cppi_open (Cppi_CpDmaInitCfg *initCfg)
{
......
if (initCfg->writeFifoDepth > 32)
{
Cppi_osalCsExit (key);
return NULL;
}
.....
The problem exists in PDK for both KeyStone I and II. Can you confirm the bug?
Regards,
Andrey Lisnevich