AnsweredAssumed Answered

I get an error setting the PPI interface via the adi_ppi driver

Question asked by rgd@dvt on Jul 11, 2016
Latest reply on Jul 18, 2016 by Jithul_Janardhanan

Problem with debugging EPPI:

I wrote my own part for using the PPI driver to set it up. The green marked line below jumps to the  adi_eppi_setFSMode (little further below. I tried all kind of things with the handle (therefore it looks a bit strange now), but all give the same result. The line with pDevice = (ADI_EPPI *) hDevice; inadi_eppi_setFSMode results in the value 0x00000080 for pDevice. This is also the value of hDevice.

 

My function looks like:

 

static ADI_EPPI_RESULT ConfigPPI(OV4682_INFO *pDevInfo)

{

        uint32_t                nHPeriod;   /* Horizontal period */

        uint32_t                nVPeriod;   /* Vertical Period */

        ADI_EPPI_HANDLE *hHandle;

        /*ADI_EPPI_HANDLE **/hHandle = pDevInfo->hPPIDevice;

        OV4682_FRAME_INFO *pFrameInfo;// = malloc(sizeof(OV4682_FRAME_INFO)); /* Pointer to frame information */

        pFrameInfo = &pDevInfo->oFrameInfo; /* Pointer to frame information */

    do

{

if(adi_eppi_SetFSMode(hHandle , ADI_EPPI_FS_MODE2) != ADI_EPPI_SUCCESS)break; //( hHandle, ADI_EPPI_FS_MODE2)                                                     /* Set the frame sync mode (1, 2, or 3 frame syncs) */

        if(adi_eppi_SetITUMode(hHandle, ADI_EPPI_GENERAL_PURPOSE) != ADI_EPPI_SUCCESS)break;                                             /* Set transfer mode to Non ITU mode (2 or 3 frame syncs) */

if(adi_eppi_SetFSPolarity(pDevInfo->hPPIDevice, ADI_EPPI_FS1HI_FS2HI) != ADI_EPPI_SUCCESS)break;                                                  /* Set frame sync polarity (Active high) */

if(adi_eppi_SetDataLength(pDevInfo->hPPIDevice, ADI_EPPI_16BIT) != ADI_EPPI_SUCCESS)break;                                                               /* Set the data length */

        if(adi_eppi_SetDmaTransferSize(pDevInfo->hPPIDevice,(ADI_EPPI_DMA_TRANSFER_SIZE) pDevInfo->eDMATxSize) != ADI_EPPI_SUCCESS)break;/* Set the DMA transfer size */

if(adi_eppi_SetClkPolarity(pDevInfo->hPPIDevice, ADI_EPPI_RISECLK_RISEFS ) != ADI_EPPI_SUCCESS)break;                                           /* Set Frame sync and clock polarity */

if(adi_eppi_SetHorizontalDelay(pDevInfo->hPPIDevice, OV4682_HPULSE_WIDTH) != ADI_EPPI_SUCCESS)break;                                           /* Set horizontal delay (number of clock cycles to delay after assertion of FS1 before transmitting data)  */

if(adi_eppi_SetVerticalDelay(pDevInfo->hPPIDevice,0u) != ADI_EPPI_SUCCESS)break;                                                                               /* Set vertical delay (Delay in terms of number of lines to wait before transmitting the data) */

        if(adi_eppi_SetLinesPerFrame( pDevInfo->hPPIDevice, pFrameInfo->nLinesPerFrame ) != ADI_EPPI_SUCCESS)break;                              /* Set lines per frame (including horizontal front and back porch) */

        if(adi_eppi_SetVerticalCount(pDevInfo->hPPIDevice,pFrameInfo->nLinesPerFrame) != ADI_EPPI_SUCCESS)break;                                     /* Set number of active lines per frame */

if(adi_eppi_SetSamplesPerLine(pDevInfo->hPPIDevice,((pFrameInfo->nPixelsPerLine + pFrameInfo->nHBlanking) * OV4682_BYTES_PER_PIXEL)) != ADI_EPPI_SUCCESS)break; /* Set number of pixels per line */

if(adi_eppi_SetHorizontalCount( pDevInfo->hPPIDevice,(pFrameInfo->nPixelsPerLine * OV4682_BYTES_PER_PIXEL) ) != ADI_EPPI_SUCCESS)break;/* Set number of pixels per line */

if(adi_eppi_SetPack( pDevInfo->hPPIDevice, true ) != ADI_EPPI_SUCCESS)break;                                                                                   /* Enable packing mode */

        if(adi_eppi_StreamingEnable(pDevInfo->hPPIDevice, true) != ADI_EPPI_SUCCESS)                                                                                        /* Enable streaming DMA mode */

if(adi_eppi_RepetiveBufferEnable(pDevInfo->hPPIDevice, true) != ADI_EPPI_SUCCESS)break;                                                                  /* Enable frame repeat mode for video */

return ADI_EPPI_SUCCESS; /* All the APIs are successful return success */

} while(0);

       return ADI_EPPI_FAILURE;

}

 

 

// this is from adi_ppi_bf6xx.c

ADI_EPPI_RESULT adi_eppi_SetFSMode(ADI_EPPI_HANDLE const hDevice, ADI_EPPI_FS_MODE eFsMode)

{

    /* assume a return code */

    ADI_EPPI_RESULT Result = ADI_EPPI_SUCCESS;

    /* EPPI Device */

    ADI_EPPI     *pDevice;

    /* register value */

    uint32_t RegValue;

 

    /* debug build only */

#ifdef ADI_DEBUG

    /* validate device handle */

    if(ValidateEppiHandle(hDevice) != ADI_EPPI_SUCCESS)

    {

        return ADI_EPPI_INVALID_HANDLE;

    }

#endif

 

pDevice = (ADI_EPPI *) hDevice; //

 

    /* read register */

    RegValue = pDevice->pRegs->EPPI_CONTROL;

    /* clear field bits from register */

 

When I run the step of the grey line I get the following message in my console window:

 

Loading application: "C:\DVT-projecten\projects\NVDI camera\rev06\Blackfin\rev_1_1\D4480_r1_1\Debug\D4480_r1_1.dxe"

Load complete.

 

A non-recoverable error or exception has occurred.

Description:   A data CPLB miss has occurred without a corresponding CPLB entry.

General Type:  RunTimeError

Specific Type: DCPLBMissWithoutReplacement

  Error PC:      0x11a027b4

 

 

 

 

With the example FrameCaptureToFile from ADI I get the same errore message:

This is from the function : uint32_t SubmitEmptyVideoFrame(void):

 

uint32_t SubmitEmptyVideoFrame(void)

{

    /* Return code */

    ADI_MT9M114_RESULT eResult;

 

    /* IF (we've an empty video frame) */

    if (pVideoBufToSubmit->bIsEmpty)

{

/* IF (Sensor can accept more frame) */

        if (NumBufsInUse <= 1)

 

With the debugger I just made the step on the grey line. In my console window I get now:

 

Loading application: "C:\DVT-projecten\projects\NVDI camera\rev06\Blackfin\rev_1_0\FrameCaptureToFile\Debug\FrameCaptureToFile.dxe"

Load complete.

 

A non-recoverable error or exception has occurred.

Description:   A data CPLB miss has occurred without a corresponding CPLB entry.

General Type:  RunTimeError

Specific Type: DCPLBMissWithoutReplacement

  Error PC:      0x11a05404

 

 

Any help is appreciated

Outcomes