cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ntropy
Adventurer
Adventurer
14,445 Views
Registered: ‎09-16-2009

Spartan 6 or Spartan 3E

LOOKING FOR HELP!!!!

 

I've been working on the same project for about 3 months now and have gotten no where.  I'm trying to create a communitcation betwen my PC and FPGA board.  I would like to send packets of data with information.  My initial idea is just to have some type of gui on the computer that will send "Hello World" to the board and the board can respond.  This would give me access to send and receive data back and forth.  Any help would appreciated and step by step as you can see thats what I need at this point.

0 Kudos
Reply
43 Replies
mcgett
Xilinx Employee
Xilinx Employee
14,335 Views
Registered: ‎01-03-2008

So what have you tried to implement in the last 3 months?  and why did your attempts fail?
------Have you tried typing your question into Google? If not you should before posting.
Too many results? Try adding site:www.xilinx.com
0 Kudos
Reply
jprovidenza
Voyager
Voyager
14,307 Views
Registered: ‎08-30-2007

WHat type of electrical interface are you trying to use between the PC and the FPGA?

Printer Port?  RS232?  USB?  Ethernet?

 

RS232 is probably the easiest, but alo the slowest.

 

You need to be a bit more specific about what your requirements are.  High Speed? Long

cable between devices? 

 

Good Luck

 

John Providenza

 

0 Kudos
Reply
ntropy
Adventurer
Adventurer
14,307 Views
Registered: ‎09-16-2009

Well I purchased the new Spartan 6 board in which prior to purchase I created a webcase and asked if the GUI was provide and later found out that it isn't.  My initial goal was to obtain the new board and edit the reference design example that is pre-loaded on the board (UG523 (v1.1) pg14).  Once I obtain the code I found that the code is in Verilog in which I have no experience with.  I also later found out that I need EDK to further edit any of the additional example designs that are on the Xilinx website for the ethernet connection, such as example provided in the UG523 Getting Started Guide (pgs 7-13).  If you are willing to provide any help, it would be greatly appreciated.
0 Kudos
Reply
ntropy
Adventurer
Adventurer
14,305 Views
Registered: ‎09-16-2009

I want to send ethernet packets (TCP/IP) back and forth to the computer via ethernet RJ45 connector.  The connection length is physically a short distance.

0 Kudos
Reply
jprovidenza
Voyager
Voyager
14,300 Views
Registered: ‎08-30-2007

I think you have an interesting learning opportunity in front of you.  You need to remember

that FPGAs are basically a bunch of logic gates and, in the case of newer FPGAs like the

Spartan6, some macro blocks.

 

So to make a change, you need to understand how to design logic that gets converted to

gates by a synthesizer (or you can directly decribe the logic with schematics).  Two 

common design languages for designing hardware Verilog and VHDL.   Simulators exist

for both languages so you can test your designs before actually turning them into gates and

downloading them into the FPGA.

 

You may also need to learn about programming the PicoBlaze processor since it is used in the

sample design, but you don't need the EDK for that.

 

These are not tough problems, but if you're new to FPGAs and h/w design in general, this could be

a ambitious starter project.

 

John Providenza

 

0 Kudos
Reply
ntropy
Adventurer
Adventurer
14,296 Views
Registered: ‎09-16-2009

My first project was using the Spartan 3E starter kit board in which I took the design example "Frequency Counter" and edited to my application. I made changes to the code to add additional counters to add new sources to be monitored. I edited the Picoblaze Assembler code to have the LCD display the desired information. Now I want to convert the project to the Spartan 6 board. Since the Spartan 6 board does not have the LCD, I would like to have the information display on the computer. I need to send the information, such as the frequency, to the computer via ethernet connection. I understand the logic gates (enough that I've was able to edit the Spartan 3E design project), however when it comes to sending information in packets and how the board communicates to the board--I'm lost.
0 Kudos
Reply
mcgett
Xilinx Employee
Xilinx Employee
14,275 Views
Registered: ‎01-03-2008

It sounds like you are attempting some simple designs, but trying to make it very complicated.

 

If you just want to see the results of your Frequency counters, then I would suggest that you add a ChipScope VIO core on the output of the counters and then you can display the results in ChipScope.  ChipScope can display a wide variety of radix formats include converting signed/unsigned values that are scaled, offset and with different precisions.  I have similar design that take a 20-bit value, multiple by 0.0016 and then displays the results with 3 digits of precision. 

 

Ethernet and TCP/IP has a lot of overhead and is complicated.  If you don't have EDK I would not suggest that you go down this path any further.

 

The SP601 includes a USB-to-UART CP2103 controller.  You could use this to pass your data back and forth. I believe that the PicoBlaze examples include an RS-232 example that you can start from.

------Have you tried typing your question into Google? If not you should before posting.
Too many results? Try adding site:www.xilinx.com
0 Kudos
Reply
cfgmgr
Contributor
Contributor
14,267 Views
Registered: ‎09-28-2009

If you really want to go the ethernet communication route, then I would suggest that you download the EDK (there is a 30-day trial version).  It will save you a lot of effort.

 

With the EDK, you could build up a system that uses the ethernet port and your custom IP for reading counters.  Then, with the SDK, you could generate a Microblaze lwIP "echoserver" test application, which you could use as a starting point to develop your own TCP/IP or UDP communication with your PC.  The next step would be to get your custom IP to communicate it's results to the Microblaze application so that the FPGA board could send the counter values over ethernet.  You could do this via PLB, FSL or master/slave registers.  

 

It will take some time, but that will definitely be easier than trying to roll our own ethernet support. 

 

-bill

 

0 Kudos
Reply
amar_sistla
Visitor
Visitor
14,034 Views
Registered: ‎01-04-2010

hello sir,

    i am a b.tech student.

    Now i have a similar project as yours(as that of 'ntropy').I have to communicate data from the pc to the board using the ethernet port. I m an amateur in this project. CAN I GET STEP BY STEP GUIDELINES WITH THIS PROJECT. OR ANY MOST SUITABLE LINK. please.

 •••••••••

0 Kudos
Reply
amar_sistla
Visitor
Visitor
10,245 Views
Registered: ‎01-04-2010

hello sir,

    i am a b.tech student.

I have to communicate data from the pc to the board using the ethernet port. I m an amateur in this project. CAN I GET STEP BY STEP GUIDELINES ON THIS PROJECT. OR ANY MOST SUITABLE LINK. like can u please tell me completely about this project. or a link where i could get information right from the basics. please sir.

 •••••••••

0 Kudos
Reply
cfgmgr
Contributor
Contributor
10,244 Views
Registered: ‎09-28-2009

Which board are you using?  Will you be using the EDK?

We may need a bit more information before we can be of much help!

0 Kudos
Reply
ntropy
Adventurer
Adventurer
10,236 Views
Registered: ‎09-16-2009

I was able to down load the EDK/SDK 30 day trial, however unable to creat the LightWeidht IP (IwIP) as referenced in XILINX document XAPP1026 due to it not being an option in the SDK -- not compatible with the Spartan 6 board.  Does anyone have any example programs to send TCP/IP messages using EDK/SDK??
0 Kudos
Reply
amar_sistla
Visitor
Visitor
10,226 Views
Registered: ‎01-04-2010

i am using SPARTAN 3A kit and coding with vhdl ..

 

0 Kudos
Reply
cfgmgr
Contributor
Contributor
10,220 Views
Registered: ‎09-28-2009

I used a 3E starter kit, but I imagine it's probably similar for the 3A.  Since you really didn't say, I am assuming that you are using the EDK.  Develop your own ethernet IP without the EDK can be done, but it's more work.  These steps are based on EDK Version 11.3:

 

It's a two-part process:  You use "XPS" to develop the "hardware platform", and you use the "SDK" to develop C code to run on that platform. 

 

Part 1:  XPS -

1) Launch XPS and use the wizard to create a new BSB project base on your board type

2) Choose a single processor system (1 microblaze processor)

3) Choose 16K of local memory, leave the system clock frequency at the default.  Do not enable floating point unit

4) On the "peripheral configuration screen", de-select (REMOVE) most of the default peripherals (e.g. you don't need LEDs, buttons, flash, dip switches, etc).  I kept only the Ethernet MAC  and the SDRAM, the RS232_DCE, dlmb_cntrl and ilmb_cntrlr. Also, make sure to check the "enable interrupts" properties for the Ethernet MAC.

5) On the same screen, ADD the "xps_timer" peripheral, and check the "use interrupt" property of the timer.

6) On the next screen, you can decide if you want instruction or data caches.  Not really needed for this demo, but definitely needed in a real-world scenario if you want any kind of performance...

7) Keep hitting the "Next" button until you reach the "Finish" button.  You are now done with the wizard.

 

At this point, click on the "Project" menu item and click on "Export Hardware Design to SDK"; Choose "Export and Launch SDK" option.

Now wait...   and wait..... and wait....  while the project builds.    You might have time for lunch.  These tools are extremely slow... A whole lot of warnings will scroll by.  You can ignore these for now.  You should NOT get any errors; warnings you can ignore for now, but errors cannot be ignored.

 

If all goes well, eventually, the SDK will launch.  You will use the SDK to write your C-code that runs on the Microblaze processor.

 

Part 2: The SDK:

1) In the SDK, right click on the Microblaze_0 object,  select "New", then "other", then select a "standalone" type of software platform.

2) Next right-click on the new software platform object you just created, and go to teh "Software Platform settings" menu option.

3) At the bottom of the software platfor settings screen, check the "lwip" library.  This will cause teh platform to rebuild and include the "lwip" library.

4) Next, right-click on the software platform object, and select "New|Project|Managed Make C application project".   From this dialog box, select the "lwIP Echo Server" application.

5) The application will compile.

 

At this point, you can download the application to the test board.  The echo server will use TCP/IP address 192.168.1.10, port 7;  10Mbit ot 100Mbit only - Gigabit doesn't work;

Connect up the ethernet cable (use a crossover cable if you are not using a network switch), start up a hyperterm session and it should all just work.  

 

I hope this helps.

 

-bill

 

 

ntropy
Adventurer
Adventurer
10,214 Views
Registered: ‎09-16-2009

Thank you cfgmgr  for your step by step instructions.  I was able to go through them with out any problems except for at the end.  When I go to run, select Run=>Debug As=>1 Debug on Hardward, I receive an error stathing "Launch failed no binaries."  How do I solve this problem??  Once again, thank you for your help.
0 Kudos
Reply
cfgmgr
Contributor
Contributor
10,205 Views
Registered: ‎09-28-2009

Make sure you have your "echo" application object selected when right-click and try to debug.

If that doesn;t work, try regenerating the .ELF file by either changing one of the source files (e.g. add a blank line to main.c),

or by right-clicking on the application object, and selecting "Generate Linker Script".

0 Kudos
Reply
amar_sistla
Visitor
Visitor
10,190 Views
Registered: ‎01-04-2010

thanks a lot cfgmgr.. i vl try implementing it the same way and will update as my project progresses ..

thanks a tonne for the step by step explanation 

0 Kudos
Reply
ntropy
Adventurer
Adventurer
10,180 Views
Registered: ‎09-16-2009

Going through the steps as specified, I'm encoutering an error when the Software Platform adds the lwip library in SDK.  The follwoing errors are received:

 

ERROR:EDK:3193 - issued from TCL procedure "lwip_elite_hw_drc" line 5

lwip130 () - xps_ethernetlite core Ethernet_MAC does not have its interrupt

connected to interrupt controller. lwIP operates only in interrupt mode, so

please connect the interrupt port to the interrupt controller.

 

ERROR:EDK:1191 - Error(s) while running DRCs for processor microblaze_0.

make: *** [microblaze_0/lib/libxil.a] Error 2

make: Target `all' not remade because of errors.

 

Any advice would be helpful.

0 Kudos
Reply
cfgmgr
Contributor
Contributor
10,177 Views
Registered: ‎09-28-2009

In XPS:

1)  make certain that you enabled interrupts on the ethernet MAC  (see earlier - Part 1, step 4)

2)  make sure that you added a timer to your project, and enabled the interrupts for that as well (Part 1, step 5)

 

0 Kudos
Reply
ntropy
Adventurer
Adventurer
9,084 Views
Registered: ‎09-16-2009

Thank you for the help.  I was able to run the program and the serial out I receive is:

 

 

-----lwIP TCP echo server ------
TCP packets sent to port 6001 will be echoed back
Board IP: 192.168.1.10
Netmask : 255.255.255.0
Gateway : 192.168.1.1
tcp echo server started @ port 7

 

Where would I be able to have a user input a send and receive message to echo to/from the board?

 

0 Kudos
Reply
cfgmgr
Contributor
Contributor
9,082 Views
Registered: ‎09-28-2009

Use a terminal emulation application like HyperTerm or equivalent - (HyperTerm comes with Windows XP). 

Setup Hyperterm to use the WinSock (instead of a COM port).  Set the host IP address to the board's address (e.g. 192.168.1.10), and set the port number to port 7.

Then, whatever you type into Hyperterm should get sent to the FPGA board, and the board will echo the characters back to you. 

 

0 Kudos
Reply
ntropy
Adventurer
Adventurer
9,078 Views
Registered: ‎09-16-2009

I received the following error when I tried to connect via HyperTerminal:

 

"Unable to connect to 192.168.1.10 port 7"

0 Kudos
Reply
cfgmgr
Contributor
Contributor
9,066 Views
Registered: ‎09-28-2009

Check the obvious things:

 

1) Make sure the FPGA board is running the app before attempting to connect.   

2) Make sure you can ping 192.168.1.10.  If you can't ping it, hyperterm wont work either.  If you can't ping, make sure that 192.168.1.10 is reachable from your PC  - (e.g. is your PC  address in this range?)

3) Is there a switch or hub in the network path?  If you connect directly from your PC to the board, I would suggest a crossover cable.

4) Make sure your PC isn't trying to negotiate a connection at 1GB.  The FPGA board is 10/100 only.

 

Keep trying - the app does work!

0 Kudos
Reply
ntropy
Adventurer
Adventurer
9,059 Views
Registered: ‎09-16-2009

Bill,

I've gone through the items listed and have the follow results:

 

1) Make sure the FPGA board is running the app before attempting to connect.   

                     Com port (rs232 serial port) displays output message.  XMD indicates Running.

 

2) Make sure you can ping 192.168.1.10.  If you can't ping it, hyperterm wont work either.  If you can't ping, make sure that 192.168.1.10 is reachable from your PC  - (e.g. is your PC  address in this range?)

                     I tried ping the IP address, but the message indicates that "Destination host unreachable"

                    

3) Is there a switch or hub in the network path?  If you connect directly from your PC to the board, I would suggest a crossover cable.

                     The current setup is the PC connected directly to the FPGA with a crossover cable.

 

4) Make sure your PC isn't trying to negotiate a connection at 1GB.  The FPGA board is 10/100 only.

                     Speed is 100.Mbps

 

Once again your help is greatly appreciated.

 

 

0 Kudos
Reply
cfgmgr
Contributor
Contributor
9,035 Views
Registered: ‎09-28-2009

Ntropy,

 

If you are getting "Destination host unreachable" then this usually indicates that your PC address is not in the same address range as the device you are trying to "ping".  To figure out what your IP address is on a Windows PC, open a DOS box (command prompt) and type "ipconfig" (on a Linux box, I think the command is "ifconfig").  Look at your address - I'll bet it's not quite in the range of "192.168.1.X".

 

Try changing your PC's NIC address to something like "192.168.1.2".  If you can't change your PC's address, then you can always change the address that the FPGA board supplies, so that it's in the range of your PC.  To do that, just go in the echoserver code (main.c), and change the lines that assign the IP address (look for a line that reads something like IP4_ADDR(&ipaddr, 192, 168,1,10)).  Just change it to a value that is in the range of your PC.  For example, if your PC address is 172.16.0.36, then try changing the FPGA address to 172.16.0.40 - you get the idea.

 

-bill

 

 

   

 

 

0 Kudos
Reply
rajatsen
Visitor
Visitor
7,590 Views
Registered: ‎02-23-2011

Hi everyone..we are working hard on this echoserver for a week long.i have gone through all the steps as being mentioned by bill.All the steps are working fine.I have downloaded it to the board.But as i am opening the hyperterminal,the same old message displays "Unable to connect to 172.16.1.100 port 7". i had changed the ip address of the board so to match my pc is range which is "172.16.1.99".I am using spartan 3E.any sort of help will be highly appreciated.

0 Kudos
Reply
janfure
Visitor
Visitor
7,522 Views
Registered: ‎12-13-2010

2 things to check:

1. is it the wired network card or the wireless one that has address 172.16.1.99? Use 'ipconfig /all' in the command prompt to check.
2. Depending on your network card, you might need a crossover cable or a switch to reach the spartan board. If that is your problem, the icon representing your ethernet card will say not connected.

Jan
0 Kudos
Reply
aarunach
Visitor
Visitor
7,275 Views
Registered: ‎04-25-2011

Hi,

 

We are trying to establish a connection between the host computer and Spartan 3E Starter kit (Rev D) using the in-built lwIP stack.

 

The IP addresses of the the host computer and the FPGA has been changed appropriately (192.168.1.10 for FPGA and 192.168.1.11 for PC). When the application is run on SDK, we get the following message on Hyperterminal:

 

 

-----lwIP TCP echo server ------
TCP packets sent to port 6001 will be echoed back
Board IP: 192.168.1.10
Netmask : 255.255.255.0
Gateway : 192.168.1.1
tcp echo server started @ port 7

 

 

The LED on either end seem to glow properly. However, we consistently get a "Destination host unreachable" message when we try to ping or telnet to FPGA's IP address 192.168.1.10.

 

We haven't changed any of the Phy or Mac configurations.

Could you please let us know what could be the problem? Really appreciate your help in this regard.

 

Thanks!

0 Kudos
Reply
cfgmgr
Contributor
Contributor
7,269 Views
Registered: ‎09-28-2009

Hmmm... it certainly SOUNDS like you did everything right...

Since there are two potential sources of problems (the PC and the FPGA board),
I guess I would first try ruling out 1/2 of the sources by connecting your PC
to another PC that has been set to the same IP address as the FPGA card.
If you can get a telnet session going between these two PCs, then it would appear
that the problem is with the FPGA board.  If not, then the problem is on the PC
side.

If you suspect that it's the FPGA side, go back to teh previous posts and carefully
retrace the steps. Especially make sure that you have interrupts enabled on FPGA
card, make sure you have a timer assigned, etc.  Try using a crossover cable, etc.

Also, try downloading a copy of Wireshark - that can sometimes help.  When you
look in wireshark, you should be able to see the FPGA board send out a gratuitous
ARP packet when the application first starts up.  If you don't see that, then
you may need to dig down a bit deeper to see if you missed any steps during the
project setup. 

Finally, there are a some debuig options that you can enable in lwip to help
trace the program execution.     

0 Kudos
Reply