I am using zed board for fram buffer read ip to read data from ddr memory and diplaying a color in rgb format but unfortunally the color is not diplay correct. 1/3 portion is diplay corect .
#include"stdio.h"
#include"xvidc.h"
#include "xil_printf.h"
#include"xparameters.h"
#include "xv_frmbufrd_l2.h"
#include "xscugic.h"
#include"xil_io.h"
#include"xstatus.h"
#include"xil_cache.h"
#include"xv_frmbufrd.h"
#include "xtime_l.h"
#include <math.h>
#include <stdlib.h>
#define HEIGHT 720
#define WIDTH 1280
#define STRIDE (WIDTH * 3)
u8* frameptr;
u8 frameBuffer[STRIDE * HEIGHT];
int main()
{
frameptr =(u8*)frameBuffer;
u32 i;
xil_printf("address of ptr %x\r\n", frameptr);
xil_printf("address of buffer %x\r\n", frameBuffer);
for(i =0; i< STRIDE * HEIGHT;i=i+3)
{
frameptr[i] = 0x00; //blue
//xil_printf("Blue %x\r\n",frameptr[i]);
frameptr[i+1] = 0xff;//red
//xil_printf("Red \r\n",frameptr[i+1]);
frameptr[i+2] = 0x00;//green
//xil_printf("Green \r\n",frameptr[i+2]);
}
XV_frmbufrd_WriteReg(0x43C00000, XV_FRMBUFRD_CTRL_ADDR_HWREG_FRM_BUFFER_V_DATA,(u32)frameptr);
XV_frmbufrd_WriteReg(0x43C00000,XV_FRMBUFRD_CTRL_ADDR_HWREG_VIDEO_FORMAT_DATA,XVIDC_CSF_MEM_RGB8);
XV_frmbufrd_WriteReg(0x43C00000, 0x20,STRIDE);
XV_frmbufrd_WriteReg(0x43C00000, 0x18,HEIGHT);
XV_frmbufrd_WriteReg(0x43C00000, 0x10,WIDTH);
XV_frmbufrd_WriteReg(0x43C00000, 0x08,0x00);
XV_frmbufrd_WriteReg(0x43C00000, 0x0c,0x00);
XV_frmbufrd_WriteReg(0x43C00000, 0x04,0x00);
XV_frmbufrd_WriteReg(0x43C00000, 0x0000,0x81);
return 0;
}
kindly tell me where i am doing mistake.