cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
chance189
Participant
Participant
532 Views
Registered: ‎07-07-2019

TPG to DP Baremetal Design

Hello,

I'm trying to create a test design to validate PL to PS-DP, via video DMA on the ZCU104. I am reusing the software written in this github: <https://github.com/gtaylormb/ultra96v2_imx219_to_displayport>, specifically for the VDMA, DP, and TPG driver interactions.

When I try to program the design from xsdb, with the attached tcl file, I get the error:

Failed to download /home/chance189/Desktop/FPGA_Projs/Example_Projs/ZCU104_Example_Projs/DisplayPort_Example/VDMA_To_DP/Vitis_SW/dptx_tpg_prj/Debug/dptx_tpg_prj.elf
Memory write error at 0x0. Cannot read sctlr_el3. Cannot read r0. Cortex-A53 #0: EDITR not ready

 

When I run the program in Vitis via debug mode, it successfully programs the device from the elf file, however, I see that I get stuck in the SyncAbortHandler. I'm not sure how to debug the design.

bd.png
0 Kudos
10 Replies
watari
Professor
Professor
517 Views
Registered: ‎06-16-2013

Hi @chance189 

 

It might be helpful for you.

 

https://www.xilinx.com/support/answers/72210.html

 

Best regards,

chance189
Participant
Participant
461 Views
Registered: ‎07-07-2019

Hello @watari 

 

Thank you for the quick reply. I saw that answer, and have used it to solve the programming via xsdb, however, the main issue is the PS system hanging after programming. I've found the line that causes the issue in the displayport initialization.

Here is the displayport_init I'm using, attempting to use live video input.

int displayport_init() {
	XDpPsu_Config *dppsu_config;
	XAVBuf avbuf;
	XDpDma_Config *dpdma_config;

	if ( (dppsu_config = XDpPsu_LookupConfig(XPAR_PSU_DP_DEVICE_ID)) == NULL) {
		xil_printf("XDpPsu_LookupConfig() failed\r\n");
		return XST_FAILURE;
	}
	XDpPsu_CfgInitialize(&dppsu, dppsu_config, dppsu_config->BaseAddr);
	XAVBuf_CfgInitialize(&avbuf, dppsu_config->BaseAddr, XPAR_PSU_DP_DEVICE_ID);
	if ( (dpdma_config = XDpDma_LookupConfig(XPAR_PSU_DPDMA_DEVICE_ID)) == NULL) {
		xil_printf("XDpDma_LookupConfig() failed\r\n");
		return XST_FAILURE;
	}
	XDpDma_CfgInitialize(&dpdma, dpdma_config);

	if (XDpPsu_InitializeTx(&dppsu) != XST_SUCCESS) {
		xil_printf("XDpPsu_InitializeTx() failed\r\n");
		return XST_FAILURE;
	}

	XDpDma_SetQOS(&dpdma, 11);
	if (XAVBuf_SetInputLiveVideoFormat(&avbuf, INPUT_VIDEO_FORMAT) != XST_SUCCESS) {
		xil_printf("XAVBuf_SetInputLiveVideoFormat() failed\r\n");
		return XST_FAILURE;
	}
	//This line is causing the issue
	XAVBuf_EnableVideoBuffers(&avbuf, 1);
	if (XAVBuf_SetOutputVideoFormat(&avbuf, INPUT_VIDEO_FORMAT) != XST_SUCCESS) {
		xil_printf("XAVBuf_SetOutputVideoFormat() failed\r\n");
		return XST_FAILURE;
	}

	XAVBuf_InputVideoSelect(&avbuf, XAVBUF_VIDSTREAM1_LIVE, XAVBUF_VIDSTREAM2_NONE);
	XAVBuf_ConfigureOutputVideo(&avbuf);
	XAVBuf_SetBlenderAlpha(&avbuf, 0, 0); 	// Disable the global alpha
	XDpPsu_CfgMsaEnSynchClkMode(&dppsu, 0);
	XAVBuf_SetAudioVideoClkSrc(&avbuf, XAVBUF_PL_CLK, XAVBUF_PS_CLK);
	XAVBuf_SoftReset(&avbuf);

	xil_printf("Displayport initialized\r\n");

	return XST_SUCCESS;
}

The issue is caused by XAVBUF_EnableVideoBuffers. If I comment this line out, the rest of the program runs fine, and the Displayport says its initialized. The problem is that no data is shown via the Displayport TX. I've run the DPDMA sample design, so I know the PS-GTR DP Tx works fine. On my previous design, I didn't include the live input, but even with that selected, I am not able to get any data.

dptx_tpg.png
0 Kudos
watari
Professor
Professor
430 Views
Registered: ‎06-16-2013

Hi @chance189 

 

There are a lot of wrong in your design.

So, I strongly read @florentw 's Xilix Video series (https://forums.xilinx.com/t5/Video-and-Audio/Xilinx-Video-Series/td-p/849583) to understand video stream and related IPs.

Also, I strongly recommend to refer UG1085, especially read Functional Description from 952 to 970.

 

https://www.xilinx.com/support/documentation/user_guides/ug1085-zynq-ultrascale-trm.pdf#page=952


Hope this helps,

 

Best regards,

chance189
Participant
Participant
381 Views
Registered: ‎07-07-2019

Hello @watari 

Thank  you for the pointer, @florentw 's tutorials are excellent, and basically completed the design for me! I was able to tie both the TPG and VTC to the same clock, and the Axi to video out locked, giving me Displayport video! Block diagram is attached.

Note when debugging, something weird happened again with the Xavbuf driver.

Here is my displayport init driver declaration modified from the example.

int displayport_init() {
	u32 Status;
	XDpPsu_Config *dppsu_config;
	XAVBuf avbuf;
	XDpDma_Config *dpdma_config;

	if ( (dppsu_config = XDpPsu_LookupConfig(XPAR_PSU_DP_DEVICE_ID)) == NULL) {
		xil_printf("XDpPsu_LookupConfig() failed\r\n");
		return XST_FAILURE;
	}
	XDpPsu_CfgInitialize(&dppsu, dppsu_config, dppsu_config->BaseAddr);
	XAVBuf_CfgInitialize(&avbuf, dppsu_config->BaseAddr, XPAR_PSU_DP_DEVICE_ID);
	if ( (dpdma_config = XDpDma_LookupConfig(XPAR_PSU_DPDMA_DEVICE_ID)) == NULL) {
		xil_printf("XDpDma_LookupConfig() failed\r\n");
		return XST_FAILURE;
	}
	XDpDma_CfgInitialize(&dpdma, dpdma_config);

	if (XDpPsu_InitializeTx(&dppsu) != XST_SUCCESS) {
		xil_printf("XDpPsu_InitializeTx() failed\r\n");
		return XST_FAILURE;
	}

	Status = XDpDma_SetGraphicsFormat(&dpdma, RGBA8888);
	if (Status != XST_SUCCESS) {
			return XST_FAILURE;
	}
	/* Set the format graphics frame for Video Pipeline*/
	Status = XAVBuf_SetInputNonLiveGraphicsFormat(&avbuf, RGBA8888);
	if (Status != XST_SUCCESS) {
			return XST_FAILURE;
	}

	XDpDma_SetQOS(&dpdma, 11);
	if (XAVBuf_SetInputLiveVideoFormat(&avbuf, INPUT_VIDEO_FORMAT) != XST_SUCCESS) {
		xil_printf("XAVBuf_SetInputLiveVideoFormat() failed\r\n");
		return XST_FAILURE;
	}

	//xil_printf("Quick test to see what this u8 value is %d.\r\n", avbuf.AVMode.NonLiveVideo->Mode); //Also hangs here
	//XAVBuf_EnableVideoBuffers(&avbuf, 1); //Issue line
	if (XAVBuf_SetOutputVideoFormat(&avbuf, INPUT_VIDEO_FORMAT) != XST_SUCCESS) {
		xil_printf("XAVBuf_SetOutputVideoFormat() failed\r\n");
		return XST_FAILURE;
	}

	XAVBuf_InputVideoSelect(&avbuf, XAVBUF_VIDSTREAM1_LIVE, XAVBUF_VIDSTREAM2_NONE);
	XAVBuf_ConfigureOutputVideo(&avbuf);
	XAVBuf_SetBlenderAlpha(&avbuf, 0, 0); 	// Disable the global alpha
	XDpPsu_CfgMsaEnSynchClkMode(&dppsu, 0);
	XAVBuf_SetAudioVideoClkSrc(&avbuf, XAVBUF_PL_CLK, XAVBUF_PS_CLK);
	XAVBuf_SoftReset(&avbuf);

	xil_printf("Displayport initialized\r\n");

	return XST_SUCCESS;
}

The problem is with the XAVBuf_EnableVideoBuffers(&avbuf, 1); line, when called, it will create a memory fault, which places the Zynq in the SyncAbortHandler. When running in debug I found that the function call hangs on this line:

u8 NumPlanes = InstancePtr->AVMode.NonLiveVideo->Mode;

With the error: "Size 4 bytes, cannot read target memory, memory fault at <Addr I don't remember>, memory fault at VA 0x82.

Do you have any pointers on what could be causing this issue?

Thanks again for all of your help

success_bd.png
0 Kudos
tim_severance
Scholar
Scholar
356 Views
Registered: ‎03-03-2017

@chance189 Did you figure out what was causing you to get stuck in the Xil_SyncAbortHandler?   I am experiencing this in my DP 1.4 TX design, but strangely it only occurs once my code size gets larger.   For instance the example design as-is works just fine, but once I add in some more code to help display some debug information the code always ends up stuck in the Xil_SyncAbortHandler and I am having a hard time figuring out how to debug this.

Thanks.

Tim

0 Kudos
watari
Professor
Professor
349 Views
Registered: ‎06-16-2013

Hi @chance189 

 

Did you make sure whether color format between non line and line are supported or not ?

 

Best regareds,

0 Kudos
chance189
Participant
Participant
317 Views
Registered: ‎07-07-2019

Hello @tim_severance ,

I read your post. I believe you're dealing with the DP IP core in fabric? I am working on the ZCU104, on the PS side Displayport. The SyncAbortHandler is triggered in my case due to a region of memory that can't be read specifically:

InstancePtr->AVMode.NonLiveVideo->Mode;

where InstancePtr is of type AvBuf.

@watari 

Could you elaborate on what that means/where I could find that information? I have followed the example design and matched it's initialization in the project. Without the 

XAVBuf_EnableVideoBuffers(&avbuf, 1);

the project works fine, however, I am basing this off of an example that has that line in the DP initialization code. I'm wondering why it isn't working on my design.

Thanks,

Chance

 

0 Kudos
tim_severance
Scholar
Scholar
274 Views
Registered: ‎03-03-2017

@chance189 Thanks for the quick response.   You are correct I am using the DP 1.4 TX IP in PL fabric.

Any tips on how you determined what line of code was causing the problem?

Thanks!

Tim

0 Kudos
chance189
Participant
Participant
271 Views
Registered: ‎07-07-2019

Hello @tim_severance 

I ended up doing the bad way of debugging via print statements, and noticed one line of the print statements didn't occur. I set a break point before the print statement, and stepped through until I got into SyncAbortHandler. Ran it again and checked the variables in that statement, at which point I found the error status in the tooltip associated with that element.

The parts of interest I'm talking about are specifically in the debug window. You set breakpoints by double clicking to the right of the statement you want to stop on, and the step into is positioned on the top toolbar by the start, stop and disconnect icons.

tooltip.JPG
0 Kudos
tim_severance
Scholar
Scholar
269 Views
Registered: ‎03-03-2017

@chance189 Ok, I wondered if that was the case.   I will do the same!

Thanks.

Tim

0 Kudos