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 tommysand
Visitor
4,043 Views
Registered: ‎03-13-2017

Ethernet for Data Transfer from DDR3 to PC : Zedboard

Hey! 

I need to transfer data from the board to the PC using Ethernet. I want to read a set of data from the DDR3 memory whose memory location will be specified by me(at the program itself). I already tried lwIP and it works fine. But now I need to receive data alone from a specific memory location in the PS part.

 

Please help me.

I'm new to the field so please bear with me! :(

 

I would really appreciate it if you could suggest step by step procedures as I'm clearly a newbie.

 

Regards,

Tom

0 Kudos
17 Replies
Teacher muzaffer
Teacher
4,019 Views
Registered: ‎03-31-2012

Re: Ethernet for Data Transfer from DDR3 to PC : Zedboard

@tommysand Are you using PS or PL to transmit data over ethernet? If PS, you just can create a socket and do a send with the address you have. If PL, what does your PL design look like? You can setup a dma transfer from DDR (over say HP0) and have the data sent to Ethernet. 

- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
0 Kudos
Visitor tommysand
Visitor
3,905 Views
Registered: ‎03-13-2017

Re: Ethernet for Data Transfer from DDR3 to PC : Zedboard

Hey.

I'm transferring the data from the PS part!

I'm using a python socket at the computer to receive the data but I have no clue at how to transfer the data from the PS to the Computer using Ethernet.

Additionally the data is from the start of this address (0xa000000) and I need to enable the Ethernet module to read values from this location. Can you please tell me clearly how to do it in steps (I'm a noob and I don't have previous knowledge on such stuff and I'm trying to learn :( )

Please help me :(

0 Kudos
Teacher muzaffer
Teacher
3,892 Views
Registered: ‎03-31-2012

Re: Ethernet for Data Transfer from DDR3 to PC : Zedboard

@tommysand again you just need to create a socket and do a send on it with the pointer of the data as a parameter.

- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
0 Kudos
Visitor tommysand
Visitor
3,889 Views
Registered: ‎03-13-2017

Re: Ethernet for Data Transfer from DDR3 to PC : Zedboard

Hey.. 

Thanks a lot.

 

But can you please tell me how to create the socket and how to run it and how to work with it. Can you please guide me in step by step procedure :( because you might have clearly known by now that I am starting to learn just now.

Please help.

Please.... It will be really helpful. :)

 

Thanks. 

0 Kudos
Teacher muzaffer
Teacher
3,883 Views
Registered: ‎03-31-2012

Re: Ethernet for Data Transfer from DDR3 to PC : Zedboard

@tommysand check out sites like this: http://www.programminglogic.com/example-of-client-server-program-in-c-using-sockets-and-tcp/

- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
0 Kudos
Visitor tommysand
Visitor
3,881 Views
Registered: ‎03-13-2017

Re: Ethernet for Data Transfer from DDR3 to PC : Zedboard

Thanks.

This program is run in the system right?

This program is used to receive the data from the IP address specified.

But what I want is a program to run at the board or a set of functions and commands to run at the board to specify the address to the Ethernet controller from which it needs to send the data.

This program is a simple Client Socket code. This is run to read data from the Ethernet port once the data is transferred through the ethernet.

But I personally don't think this is the answer. Please state if you think otherwise.

0 Kudos
Teacher muzaffer
Teacher
3,876 Views
Registered: ‎03-31-2012

Re: Ethernet for Data Transfer from DDR3 to PC : Zedboard

@tommysand this page has two programs, one (client) runs on the pc and receives the data the server (running on the zynq) sends. You say you have a python version of the client and it seems like you need the server to run on the zynq (using lwip). 

- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
0 Kudos
Visitor tommysand
Visitor
3,855 Views
Registered: ‎03-13-2017

Re: Ethernet for Data Transfer from DDR3 to PC : Zedboard

Okay. Thanks.

I have two questions.

1) How do I execute the server in the Zynq?

2) Also in the server program, how do I instruct the code to read the data from the specific memory address in the PS and send it via the ethernet?

3) Also, should I have to run the server code(c code) along with the other codes in the lwip application project ( which I run in the SDK environment)?

Thanks a lot. Please reply.

0 Kudos
Teacher muzaffer
Teacher
3,853 Views
Registered: ‎03-31-2012

Re: Ethernet for Data Transfer from DDR3 to PC : Zedboard

@tommysand

>> I have two questions.

>>3) Also, should I have to run the server code(c code) along with the other codes in the lwip application project ( which I run in the SDK environment)?

 

I think you have a counting problem in addition to programming ;-)

 

In any case, you need to make the server program as part of the LWIP application project. Usually one makes a main loop and executes items one after another ie receive data from source, process a little bit, send result over socket, repeat.

 

>> 2) Also in the server program, how do I instruct the code to read the data from the specific memory address in the PS and send it via the ethernet?

http://man7.org/linux/man-pages/man2/send.2.html says:

 

       ssize_t send(int sockfd, const void *buf, size_t len, int flags);

here buf is the address you have and len is the size of the data to which buf points.

- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
0 Kudos
Visitor tommysand
Visitor
3,268 Views
Registered: ‎03-13-2017

Re: Ethernet for Data Transfer from DDR3 to PC : Zedboard

Lol!

Sorry about that. I had two questions in my mind when I started typing my reply and the third question just popped up.

Thanks. Will it be okay if I upload the complete server c code by tomorrow so that you can just look it up and tell me if it's correct or not?

And also I'll be disturbing this post for a while. Please don't go anywhere! :') 

Thanks a tonne for all the inconvenience caused.

Don't go anywhere. I might ask you if I have trouble while executing.

Thanks again. and Don't go yet!

0 Kudos
Visitor tommysand
Visitor
3,268 Views
Registered: ‎03-13-2017

Re: Ethernet for Data Transfer from DDR3 to PC : Zedboard

  ssize_t send(int sockfd, const void *buf, size_t len, int flags);

And where should I post this line in the server code? Instead of sending the message there, I need to write this code and execute.

I mean, instead of these two lines in the example code,

 

 strcpy(buffer,"Hello World\n");   

 send(newSocket,buffer,13,0);

 

I need to have the one mentioned above right? 

0 Kudos
Teacher muzaffer
Teacher
3,265 Views
Registered: ‎03-31-2012

Re: Ethernet for Data Transfer from DDR3 to PC : Zedboard

@tommysand the highlighted line is the function description.

what you need is to modify the server code to suit your purposes, ie:

 

instead of 

 

 strcpy(buffer,"Hello World\n");   

 send(newSocket,buffer,13,0);

 

have

 

 buffer = 0xa0000000; // or what ever the pointer you have

 int size = 100; // or what ever the size of the data you have

 send(newSocket,buffer, size,0);

 

- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
0 Kudos
Visitor tommysand
Visitor
3,263 Views
Registered: ‎03-13-2017

Re: Ethernet for Data Transfer from DDR3 to PC : Zedboard

Thanks a lot!

I'll come back to this post again and I'll reply if I have any query.

Please stay tuned to this post boss!
I definitely need your help.

0 Kudos
Visitor tommysand
Visitor
3,262 Views
Registered: ‎03-13-2017

Re: Ethernet for Data Transfer from DDR3 to PC : Zedboard

By the way.. in the function description..

what is the ssize_t?

 

Should I use this or should I use just send( the code you posted)?

0 Kudos
Teacher muzaffer
Teacher
3,260 Views
Registered: ‎03-31-2012

Re: Ethernet for Data Transfer from DDR3 to PC : Zedboard

@tommysand size_t is a type which can hold the largest number which is needed for size (say of an array etc.) It's usually the same thing as an unsigned int. For ethernet data, you won't have a problem with int instead but it might be worth defining len size_t instead.

- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
0 Kudos
Visitor tommysand
Visitor
3,258 Views
Registered: ‎03-13-2017

Re: Ethernet for Data Transfer from DDR3 to PC : Zedboard

Okay okay..

Thanks..

I shall try with both!

Thanks a lot!

0 Kudos
Visitor tommysand
Visitor
3,116 Views
Registered: ‎03-13-2017

Re: Ethernet for Data Transfer from DDR3 to PC : Zedboard

Hey.

 

I have a few doubts on this issue.

I showed it to my mentor and he was like, the work is correct but I had to make to compatible with the lwIP application that is running already. As in for that, I need to add "pbuf" and the functions need to be changed for that accordingly.

Can you help me with that? 
Really sorry ! 

Please help me

0 Kudos