UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Problems with petalinux and baremetal app which uses DMA

Reply
Highlighted
Visitor
Posts: 12
Registered: ‎08-16-2017

Problems with petalinux and baremetal app which uses DMA

 

Hi all,

 

We are working with ZC702 FPGA platform. We have petalinux running in CPU0 whereas a baremetal application is running in CPU1. This baremetal application works with DMA (not CDMA).

 

When we use the baremetal application alone everything works fine: DMA and interrupts are working. However, when using petalinux for CPU0 and baremetal for CPU1 (via openAMP library, remote_proc) we are having some issues, because DMA is not working, data is not being copied to DDR and we are having errors.

 

Anyone knows what can be happening? There's anyhting we have to configure when using petalinux along with a baremetal application which utilizes DMA? Is petalinux taking control over DMA and this is the cause our application is not running properly?

 

Any help will be appreciated. Thanks.

 

Regards,

David

Xilinx Employee
Posts: 14
Registered: ‎05-10-2017

Re: Problems with petalinux and baremetal app which uses DMA

David,

 

Which version of petalinux are you using and what are the errors you are seeing?

Visitor
Posts: 12
Registered: ‎08-16-2017

Re: Problems with petalinux and baremetal app which uses DMA

Hi @jovitac, thank you for your response. We are using Petalinux 2016.3.

 

It seems DMA is not reading, our buffer is initializated to known values, but data is not being updated in DDR because its values never change. However, if we executed this code standalone (without petalinux) everything works fine.

Visitor
Posts: 12
Registered: ‎08-16-2017

Re: Problems with petalinux and baremetal app which uses DMA

Hi again,

 

We caught an interrupt from DMA in the SGDMA_interrupt_handler function, and it give us an IRQ_ERROR....this is the content of the registers:

Dump registers 40400030:
Control REG: 64017012
Status REG: 00010219
Cur BD REG: 00000000
Tail BD REG: 00128300

Thanks, regards,

David

Xilinx Employee
Posts: 14
Registered: ‎05-10-2017

Re: Problems with petalinux and baremetal app which uses DMA

Could you please attach your device-tree? Do the demo apps work?

Visitor
Posts: 12
Registered: ‎08-16-2017

Re: Problems with petalinux and baremetal app which uses DMA

Hi @jovitac, I attached the device-tree. Yes, the demo apps work.

 

Thank you again,

David

Xilinx Employee
Posts: 14
Registered: ‎05-10-2017

Re: Problems with petalinux and baremetal app which uses DMA

Make sure your kernel base address is set to higher address  0x10000000

Set memory split to 2G/2G

Enable high memory support.

 

Please see Chapter 3, Setting up Petalinux with OpenAMP.

 

Hope this helps

 

Visitor
Posts: 12
Registered: ‎08-16-2017

Re: Problems with petalinux and baremetal app which uses DMA

Thanks @jovitac, we have everything configured like you suggest us. But we still have the DMA problem. We have tried to add in the device tree a node to shared memory between linux and baremetal, in the following way:

 

	reserved-memory {
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		/* global autoconfigured region for contiguous allocations */
		linux,cma@3F000000{
			compatible = "shared-dma-pool";
			reusable;
			size = <0x4000000>;
			alignment = <0x2000>;
			linux,cma-default;
		};
       }

Maybe the problem is that shared memory between both cores must be configured as DMA compatible or something related to this issue.

 

Any clues?

 

Thank you in adcance,

David