# Vitis vision core fails on PYNQ V2.5.1

**URL:** <https://discuss.pynq.io/t/vitis-vision-core-fails-on-pynq-v2-5-1/1822>\
**Category:** Support\
**Created:** [October 1, 2020, 12:40am UTC](https://discuss.pynq.io/t/vitis-vision-core-fails-on-pynq-v2-5-1/1822 "2020-10-01T00:40:39Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![dimiter](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dimiter](https://discuss.pynq.io/u/dimiter)\
**Post date:** [November 27, 2020, 1:30pm UTC](https://discuss.pynq.io/t/vitis-vision-core-fails-on-pynq-v2-5-1/1822/17 "2020-11-27T13:30:54Z")

</div>

@rock @cathalmccabe

I solved this by following what you guys have done. Using custom axis type and custom MAT to stream functions instead of  
xf::cv::AXIvideo2xfMat(\_src, src\_mat);  
xf::cv::xfMat2AXIvideo(src\_mat, \_dst);

The issue is indeed the PYNQ DMA code is not compatible with the sidebands and tuser signal.  
It gets stuck on the receive side.

struct axis\_t {  
ap\_uint\<8\> data;  
ap\_int\<1\> last;  
};

/\*  
Unpack a AXI video stream into a xf::cv::Mat\<\> object  
\*input: AXI\_video\_strm  
\*output: img  
\*/  
template \<int TYPE, int ROWS, int COLS, int NPPC\>  
int AXIstream2xfMat(hls::stream\<axis\_t\> & AXI\_video\_strm, xf::cv::Mat\<TYPE, ROWS, COLS, NPPC\>& img) {  
axis\_t pixelpacket;  
int res = 0;

```
int rows = img.rows;
int cols = img.cols;
int idx = 0;

assert(img.rows <= ROWS);
assert(img.cols <= COLS);

loop_row_axi2mat: for (int i = 0; i < rows; i++) {
	loop_col_axi2mat: for (int j = 0; j < cols; j++) {
			// clang-format off
    		#pragma HLS loop_flatten off
    		#pragma HLS pipeline II=1
			// clang-format on
			AXI_video_strm >> pixelpacket;
	        img.write(idx++, pixelpacket.data);
	}
   }
return res;

```

}

You can test this using a simple passthrough functions like axiconv on Vitis vision.

---

_[View the full topic](https://discuss.pynq.io/t/vitis-vision-core-fails-on-pynq-v2-5-1/1822)._
