cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
reaiken
Explorer
Explorer
854 Views
Registered: ‎07-18-2011

VDMA into Video Mixer locks up MicroBlaze only in 48-bit RGB mode

Jump to solution

I am seeing a strange problem when connecting the VDMA output directly to the Video Mixer IP, in an Artix-7-100 device, using Vivado 2018.3.

I have the Video Mixer IP configured for an RGB streaming input and output, 2 pixels per clock as shown below, and the VDMA is configured for 1280x720:

 

Mixer config RGB streamingMixer config RGB streaming

VDMA config 48-bitVDMA config 48-bit

 

If I configure the VDMA for 48-bit RGB as shown above, and drive that directly into the Video Mixer IP, the Microblaze locks up when the VDMA is started after configuring everything.   It locks up on the XAxiVdma_DmaStart(...) function.

If I configure the VDMA for 32-bit Y/CrCb, and run that into a VPSS IP block to convert it to 48-bit RGB, then into the Video Mixer, or if I simply use an AXI4-Stream Subset Converter to make the VDMA 32-bit stream a 48-bit stream and run that into the Video Mixer, everything configures fine and the MicroBlaze doesn't lock up when the VDMA is started.

If I disconnect the VDMA from the Video Mixer, the VDMA will also configure and start fine without locking up the MicroBlaze in either 32-bit or 48 bit mode.

I made a test project with just a read-only VDMA and a Video Mixer, which illustrates the problem:

 

test_mix_vdmatest_mix_vdma

It seems like there is some memory contention in my program between the VDMA and Video Mixer that causes the MicroBlaze to go off into the weeds when configuring 2 pixel-per-clock 48-bit RGB, but not when configuring 2 pixel-per-clock 32-bit Y/CbCr.     It happens even if the Video Mixer SW is not confgured in the code, or if the Video Mixer IP is held in reset when configuring and starting the VDMA.  

When I step through with the debugger into the XAxiVdma_DmaStart function, I get this error message in the dissasembly window : "Memory read error at 0x80000ECC. MicroBlaze instruction insert overrun"

If I run everything from BRAM, the problem doesn't occur, it only happens when the linker is set up to run from DDR3.

Tcl script below if you want to test this.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
florentw
Moderator
Moderator
697 Views
Registered: ‎11-09-2015

HI @reaiken 

Can you try direct register programming as per my video series to configure the VDMA?

Thanks


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**

View solution in original post

0 Kudos
8 Replies
florentw
Moderator
Moderator
789 Views
Registered: ‎11-09-2015

Hi @reaiken 

Are you making sure you are not using the same memory space for the VDMA, VIdeo Mixer and Processor code?

One suggestion I made on my Video Series 24: Using the AXI VDMA in Triple Buffer Mode, is to set the available DDR memory for the processor in the linker script. Else you do not really know what the processor will use and if it will not ovelap with your frame buffers.

Then once you have defined that, you just need to be careful about the addresses you use for the Video Mixer and Video Frame buffer.

Regards


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
reaiken
Explorer
Explorer
769 Views
Registered: ‎07-18-2011

@florentw 

I did try changing the linker script, based on your (excellent!) video series, but either I did it incorrectly, or it didn't help, it still locks up.   The Microblaze linker doesn't have a PS section like your Zynq example, so I added a vid_ memory section for video memory as follows, and left all the section memory mapping assigned to mig_7series_0_memaddr:

 

 

linker.jpg

 

In my program, I define the memory base address as follows, so there is a 0x00010000 codespace and a VID_BUFFER_ADDRESS above that. 

When  i initialize my VDMA, I set the address to VID_BUFFER_ADDRESS, which starts at 0x80010000:

 

 

Address_defs.jpg

Is that the correct way to do this?   The VideoMixer IP doesn't use any DDR3, so I can't assign it independently.  Or is there some other way to do that in the linker script?

Thanks!

 

0 Kudos
florentw
Moderator
Moderator
762 Views
Registered: ‎11-09-2015

Hi @reaiken 

Yes the way you are doing seems correct.

Can you try to run the microblaze in step by step in debug mode to see if it always fails at the same command or not? There might be something we are missing.

Thanks and Regards


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
reaiken
Explorer
Explorer
759 Views
Registered: ‎07-18-2011

@florentw 

Yes, when I step through with the debugger into the XAxiVdma_DmaStart function, I get this error message in the dissasembly window : "Memory read error at 0x80000ECC. MicroBlaze instruction insert overrun" always at the same XAxiVdma_DmaStart function.

0 Kudos
florentw
Moderator
Moderator
698 Views
Registered: ‎11-09-2015

HI @reaiken 

Can you try direct register programming as per my video series to configure the VDMA?

Thanks


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**

View solution in original post

0 Kudos
aoifem
Moderator
Moderator
660 Views
Registered: ‎11-21-2018

Hi @reaiken 

If your question is answered or your issue is solved, please kindly mark the response which helped as a solution (click on "Accept as solution" button below the reply).

 

If this is not solved/answered, please reply in the topic giving more information on your current status.

 

Thanks and Regards,

Aoife
Product Application Engineer - Xilinx Technical Support EMEA


**~ Got a minute? Answer our Vitis HLS survey here! ~**

**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
reaiken
Explorer
Explorer
597 Views
Registered: ‎07-18-2011

Sorry for the late reply, I had to finish the project to meet a shpiment deadline, so I coded it up with 16-bit Y/CbCr instead of 24-bit RGB.

Yes, if I directly program the registers lusing the code below, it works.  The problem comes in when using the API calls.

memAddr = (Vdma_Main.BaseAddr + OFFSET_VDMA_MM2S_CONTROL_REGISTER);
Xil_Out32(memAddr , 0x0000008B);
memAddr = (Vdma_Main.BaseAddr + OFFSET_VDMA_MM2S_FRAMEBUFFER1);
Xil_Out32(memAddr , VID_BUFFER_ADDRESS);
memAddr = (Vdma_Main.BaseAddr + OFFSET_VDMA_MM2S_FRAMEBUFFER2);
Xil_Out32(memAddr , VID_BUFFER_ADDRESS+VID_FRAMESIZE);
memAddr = (Vdma_Main.BaseAddr + OFFSET_VDMA_MM2S_FRAMEBUFFER3);
Xil_Out32(memAddr , VID_BUFFER_ADDRESS+VID_FRAMESIZE+VID_FRAMESIZE);
memAddr = (Vdma_Main.BaseAddr + OFFSET_VDMA_MM2S_FRMDLY_STRIDE);
Xil_Out32(memAddr , 0x00000F00); // Stride = 3840
memAddr = (Vdma_Main.BaseAddr + OFFSET_VDMA_MM2S_HSIZE);
Xil_Out32(memAddr , 0x00000F00); // Read side 1280x720 RGB = 3*1280 = 3840 bytes per line
memAddr = (Vdma_Main.BaseAddr + OFFSET_VDMA_MM2S_VSIZE);
Xil_Out32(memAddr , 0x000002D0); // Read side 1280x720 RGB = 720 lines

When I get time to take another look at it, I'll do a register dump  comparing both methods and see if I can see anything different that might cause the code to lock up when the VDMA is started.

 

 

0 Kudos
florentw
Moderator
Moderator
588 Views
Registered: ‎11-09-2015

HI @reaiken 

I would try to remove all the optimizations in SDK and see if that help. Might be the compiler optimizing too much code.

Let me know if you find anything.

Regards


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos