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!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor abhi1893
Visitor
1,553 Views
Registered: ‎02-13-2018

How to read/ write from Zynq 702 PS to DDR3 SDRAM using Xilinx SDK

I am a newbie to Xilinx SDK. I am trying to build an application which takes input from UART and sends the data to DDR3 using only PS(no PL involved). Is there any example/reference I can consult? I am unable to find any examples in the SDK documentation  for the same.

Tags (4)
0 Kudos
5 Replies
Scholar hbucher
Scholar
1,550 Views
Registered: ‎03-22-2016

Re: How to read/ write from Zynq 702 PS to DDR3 SDRAM using Xilinx SDK

@abhi1893 What DDR3? PS (ARM) side or PL (FPGA) side? 

If PS-side, from the PS perspective the UART is (often) mapped to stdin and stdout - so nothing new to you here.

And the DDR3 PS-side is just another memory. Get its base address in the Address Editor but be careful not to write on top of your executable.

So all you need to do is read from stdin and write to that base address (plus offset). 

 

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
0 Kudos
Visitor abhi1893
Visitor
1,545 Views
Registered: ‎02-13-2018

Re: How to read/ write from Zynq 702 PS to DDR3 SDRAM using Xilinx SDK

DDR3 on the PS side.

 

What function do I need to use for wrting to the base address of DDR3?

0 Kudos
Scholar hbucher
Scholar
1,529 Views
Registered: ‎03-22-2016

Re: How to read/ write from Zynq 702 PS to DDR3 SDRAM using Xilinx SDK

@abhi1893 Nothing, just regular C.

 

 

int* array = (int*)MY_BASE_ADDRESS;
while ( 1 ) { 
   u32 val = < read from stdin >;
   array[pos] = val;
   pos += 4;
}
Or fill up a buffer and memcpy() it. Up to you.
vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
Visitor abhi1893
Visitor
1,521 Views
Registered: ‎02-13-2018

Re: How to read/ write from Zynq 702 PS to DDR3 SDRAM using Xilinx SDK

Thank you. Will the same method be applicable when reading from the memory as well?

 

0 Kudos
Scholar hbucher
Scholar
1,518 Views
Registered: ‎03-22-2016

Re: How to read/ write from Zynq 702 PS to DDR3 SDRAM using Xilinx SDK

@abhi1893 Everything behaves as memory.

By the way, you can also dump a file from the host into the PS memory using XSCT (debug console) without any programming on the PS side using the command 'mwr' - see page 25 on UG1208

https://www.xilinx.com/support/documentation/sw_manuals/xilinx2016_2/ug1208-xsct-reference-guide.pdf

 

 

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
0 Kudos