Part Number:OMAP-L138
Hi, iam using OMAPL138 in my project where i need to receive the incomming frames from the FPGA which is connected to OMAP using VPIF. FPGA is sending the continous frames(RAW DATA (256x256)) to DSP.
When i read the data sheet it is mentioned that in RAW CAPTURE mode there is no need to configure the CnHCFG, CnVCFG0, CnVCFG1, and CnVSIZE registers. Iam unable to receive any data on VPIF buffers. Iam using channel 0&1 for receiving the data frames. I have taken an example code from OMAPL138_StarterWare_1_10_04_01 and made the changes according to my requirement. When my frame size is720*576(PAL resolution) Iam able to receive some data in my buffers but when i configure the frame size to 256*256 iam unable to receive any data in the buffers. Iam using the following code
#define VBUF_SIZE (256 * 64)
#define VBUF_ALIGN (8)
unsigned char chromaTop0[VBUF_SIZE], chromaBottom0[VBUF_SIZE],
lumaTop0[VBUF_SIZE], lumaBottom0[VBUF_SIZE];
unsigned char chromaTop1[VBUF_SIZE], chromaBottom1[VBUF_SIZE],
lumaTop1[VBUF_SIZE], lumaBottom1[VBUF_SIZE];
static void SetUpVPIFRx(void) {
/* Disable interrupts */
VPIFInterruptDisable(SOC_VPIF_0_REGS, VPIF_FRAMEINT_CH1);
VPIFInterruptDisable(SOC_VPIF_0_REGS, VPIF_FRAMEINT_CH0);
/* Disable capture ports */
VPIFCaptureChanenDisable(SOC_VPIF_0_REGS, VPIF_CHANNEL_1);
VPIFCaptureChanenDisable(SOC_VPIF_0_REGS, VPIF_CHANNEL_0);
/* Interrupt after capturing the bottom field of every frame */
VPIFCaptureRawIntlineConfig(SOC_VPIF_0_REGS, 64);
VPIFCaptureIntframeConfig(SOC_VPIF_0_REGS, VPIF_CHANNEL_0, VPIF_FRAME_INTERRUPT_BOTTOM);
VPIFCaptureCapmodeModeSelect(SOC_VPIF_0_REGS, VPIF_CHANNEL_0, VPIF_CAPTURE_RAW);
VPIFCaptureRawDatawidthConfig(SOC_VPIF_0_REGS, VPIF_RAW_EIGHT_BPS);
VPIFCaptureIntrprogModeSelect(SOC_VPIF_0_REGS, VPIF_CHANNEL_0, VPIF_CAPTURE_INTERLACED);
VPIFCaptureFieldframeModeSelect(SOC_VPIF_0_REGS, VPIF_FRAME_BASED);
VPIFCaptureHancEnable(SOC_VPIF_0_REGS, VPIF_CHANNEL_0);
/* Capturing Raw Data*/
VPIFCaptureModeConfig(SOC_VPIF_0_REGS, VPIF_RAW, VPIF_CHANNEL_0, 0, (VPIFVbufParam*) 0);
VPIFCaptureFBConfig(SOC_VPIF_0_REGS, VPIF_CHANNEL_0, VPIF_TOP_FIELD, VPIF_LUMA, (unsigned int) &lumaTop0[0], 256);
VPIFCaptureFBConfig(SOC_VPIF_0_REGS, VPIF_CHANNEL_0, VPIF_TOP_FIELD, VPIF_CHROMA, (unsigned int) &chromaTop0[0], 256);
VPIFCaptureFBConfig(SOC_VPIF_0_REGS, VPIF_CHANNEL_0, VPIF_BOTTOM_FIELD, VPIF_LUMA, (unsigned int) &lumaBottom0[0], 256);
VPIFCaptureFBConfig(SOC_VPIF_0_REGS, VPIF_CHANNEL_0, VPIF_BOTTOM_FIELD, VPIF_CHROMA, (unsigned int) &chromaBottom0[0], 256);
}
static void SetupIntc(void) {
/* Setup DSP or ARM interrupt controller */
#ifdef _TMS320C6X
/* Initialize the DSP interrupt controller */
IntDSPINTCInit();
/* Register ISR to vector table */
IntRegister(C674X_MASK_INT5, VPIFIsr);
/* Map system interrupt to DSP maskable interrupt */
IntEventMap(C674X_MASK_INT5, SYS_INT_VPIF_INT);
/* Enable DSP maskable interrupt */
IntEnable(C674X_MASK_INT5);
/* Enable DSP interrupts */
IntGlobalEnable();
}
static void VPIFIsr(void) {
unsigned int temp;
#ifdef _TMS320C6X
IntEventClear(SYS_INT_VPIF_INT);
#else
IntSystemStatusClear(SYS_INT_VPIF);
#endif
temp = VPIFInterruptStatus(SOC_VPIF_0_REGS, VPIF_ERROR_INT | VPIF_FRAMEINT_CH1 | VPIF_FRAMEINT_CH0);
VPIFCaptureFBConfig(SOC_VPIF_0_REGS, VPIF_CHANNEL_0, VPIF_TOP_FIELD, VPIF_LUMA, (unsigned int) &lumaTop0[0], 256);
VPIFCaptureFBConfig(SOC_VPIF_0_REGS, VPIF_CHANNEL_0, VPIF_TOP_FIELD, VPIF_CHROMA, (unsigned int) &chromaTop0[0], 256);
VPIFCaptureFBConfig(SOC_VPIF_0_REGS, VPIF_CHANNEL_0, VPIF_BOTTOM_FIELD, VPIF_LUMA, (unsigned int) &lumaBottom0[0], 256);
VPIFCaptureFBConfig(SOC_VPIF_0_REGS, VPIF_CHANNEL_0, VPIF_BOTTOM_FIELD, VPIF_CHROMA, (unsigned int) &chromaBottom0[0], 256);
/* clear interrupt */
VPIFInterruptStatusClear(SOC_VPIF_0_REGS, VPIF_FRAMEINT_CH0);
/* if error interrupt occurs, report error */
if ((temp & VPIF_ERROR_INT)) {
error_flag = 1;
}
void VPIF_Init(void) {
// Power on VPIF
PSCModuleControl(SOC_PSC_1_REGS, HW_PSC_VPIF, PSC_POWERDOMAIN_ALWAYS_ON, PSC_MDCTL_NEXT_ENABLE);
// Initializing ARM/DSP INTC
SetupIntc();
// Setup VPIF pinmux & Initialize VPIF
VPIFPinMuxSetup();
SetUpVPIFRx();
VPIFDMARequestSizeConfig(SOC_VPIF_0_REGS, VPIF_REQSIZE_TWO_FIFTY_SIX);
// VPIFDMARequestSizeConfig(SOC_VPIF_0_REGS, VPIF_REQSIZE_SIXTY_FOUR);
VPIFEmulationControlSet(SOC_VPIF_0_REGS, VPIF_FREE);
}
Please have a look at the code once and correct me if iam wrong anywhere and suggest me what settings to be made in order to receive the data.