cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
5,720 Views
Registered: ‎04-04-2016

Problem with using VDMA to write image in ddr

I'm trying to test the VDMA IP through a simple design that consists in reading an image from ddr, converting it using the YCrCb transformation and then use VDMA again to write the image in another address.

I monitored the ddr memory using sdk tools and the application is writing data in the result address however it is not an image or at least it is not whole.

Here is how an image should look like when I stored the source image in ddr:

22.PNG

and here is the result I'm getting:

11.PNG

Here is the block design I built:

design.PNG

And here is the sdk standalone application I used to test it:

 

#include <stdio.h>
#include <unistd.h>
#include <xil_cache.h>
#include "platform.h"
#include "ps7_init.h"
#include "xil_io.h"
#include "xscugic.h"
#include "xparameters.h"
int main()
{	init_platform();
        Xil_DCacheDisable();
        usleep(100000);
        // MM2S
        Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0x00, 0x008B);                // enable run, circular_park, GenlockEn, GenlockSrc
    	Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0x5C, 0x01000000);        // Start address of the 1st frame(3 frames in all)
        Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0x60, 0x02000000);        // Start address of the 2nd frame(3 frames in all)
        Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0x64, 0x03000000);        // Start address of the 3rd frame(3 frames in all)
        Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0x58, 0x08CA);                // Stride number
        Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0x54, 0x08CA);                // number of bytes per line(640 x 3)
        Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0x50, 0x01C2);                // number of lines per frame(480)
        //S2MM
        xil_printf("Starting S2MM");
        Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0x30, 0x108B);                // enable run, circular_park
        Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0xAC, 0x04000000);        // Start address of the 1st frame(3 frames in all)
        Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0xB0, 0x05000000);        // Start address of the 2nd frame(3 frames in all)
        Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0xB4, 0x06000000);        // Start address of the 3rd frame(3 frames in all)
        Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0xA8, 0x08CA);                // Stride number
        Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0xA4, 0x08CA);                // number of bytes per line(640 x 3)
        Xil_Out32(XPAR_AXI_VDMA_0_BASEADDR + 0xA0, 0x01C2);                // number of lines per frame(480)
    return 0;
}

Does somebody know what I did wrong?

0 Kudos