Skip to content

Commit

Permalink
* added example usage of echo server
Browse files Browse the repository at this point in the history
* added more troubleshooting tips
* removed unnecessary code from autoneg process
  • Loading branch information
fpgadeveloper committed May 13, 2021
1 parent 124262a commit 77f81a2
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 19 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -12,3 +12,4 @@ Vitis/boot/
Vitis/embeddedsw/
PetaLinux/*_axieth/
docs/build/
Vitis/RemoteSystemsTempFiles/
Expand Up @@ -592,13 +592,6 @@ unsigned int get_phy_speed_88E1510(XAxiEthernet *xaxiemacp, u32 phy_addr)
XAxiEthernet_PhyWrite(xaxiemacp, phy_addr, IEEE_1000_ADVERTISE_REG_OFFSET,
control);

XAxiEthernet_PhyWrite(xaxiemacp, phy_addr, IEEE_PAGE_ADDRESS_REGISTER, 0);
XAxiEthernet_PhyRead(xaxiemacp, phy_addr, IEEE_COPPER_SPECIFIC_CONTROL_REG,
&control);
control |= (7 << 12); /* max number of gigabit attempts */
control |= (1 << 11); /* enable downshift */
XAxiEthernet_PhyWrite(xaxiemacp, phy_addr, IEEE_COPPER_SPECIFIC_CONTROL_REG,
control);
XAxiEthernet_PhyRead(xaxiemacp, phy_addr, IEEE_CONTROL_REG_OFFSET, &control);
control |= IEEE_CTRL_AUTONEGOTIATE_ENABLE;
control |= IEEE_STAT_AUTONEGOTIATE_RESTART;
Expand Down
45 changes: 43 additions & 2 deletions docs/source/echo_server.rst
Expand Up @@ -72,8 +72,20 @@ USB-UART of the development board to your PC and run a console program such as
* Microblaze designs: 9600 baud
* Zynq and ZynqMP designs: 115200 baud

How to change the Ethernet port targetted by the application
============================================================
IP address
==========

By default, the echo server attempts to obtain an IP address from a DHCP server. This is useful
if the echo server is connected to a network. Once the IP address is obtained, it is printed out
in the UART console output.

If instead the echo server is connected directly to a PC, the DHCP attempt will fail and the echo
server's IP address will default to 192.168.1.10. To be able to communicate with the echo server
from the PC, the PC should be configured with a fixed IP address on the same subnet, for example:
192.168.1.20.

Change the targetted port
=========================

The echo server example design currently can only target one Ethernet port at a time.
Selection of the Ethernet port can be changed by modifying the defines contained in the
Expand All @@ -85,5 +97,34 @@ to one of the following values:
* Ethernet FMC Port 2: ``XPAR_AXIETHERNET_2_BASEADDR``
* Ethernet FMC Port 3: ``XPAR_AXIETHERNET_3_BASEADDR``

Example usage
=============

Ping the port
-------------

The echo server can be "pinged" from a connected PC, or if connected to a network, from
another device on the network. The UART console output will tell you what the IP address of the
echo server is. To ping the echo server, use the ``ping`` command from a command console of a PC
that is connected to the echo server (either directly or via network).

Example command: ``ping 192.168.1.10``

Connect with telnet
-------------------

We can also connect to the echo server using telnet and confirm that it is sending back (echoing) the data
that we are sending it. From the command prompt of a PC on the same network as the echo server, run the
following command:

Example command: ``telnet 192.168.1.10 7``

The first argument of the telnet command specifies the IP address of the device to connect to (in our case
the echo server). The last argument in the command specifies the port number, which should be 7 for the
echo server.

In the blank screen that opens after running the command, you can type letters and they will be sent to the
echo server and be echoed back.


.. _Putty: https://www.putty.org
52 changes: 42 additions & 10 deletions docs/source/troubleshooting.rst
Expand Up @@ -2,18 +2,50 @@
Troubleshooting
===============

Build failures
==============

Check the following if the project fails to build or generate a bitstream:

1. **Are you using the correct version of Vivado for this version of the repository?**
Check the version specified in the Requirements section of the README.md file. Note that this project is regularly maintained to the latest
version of Vivado and you may have to refer to an earlier commit of this repo if you are using an older version of Vivado.
1. | **Are you using the correct version of Vivado for this version of the repository?**
| Check the version specified in the Requirements section of the README.md file. Note that this project is regularly maintained to the latest
version of Vivado and you may have to refer to an earlier commit of this repo if you are using an older version of Vivado.
2. | **Did you correctly follow the Build instructions in this readme file?**
| All the projects in the repo are built, synthesised and implemented to a bitstream before being committed, so if you follow the
instructions, there should not be any build issues.
3. | **Did you copy/clone the repo into a short directory structure?**
| Vivado doesn't cope well with long directory structures, so copy/clone the repo into a short directory structure such as
``C:\projects\``. When working in long directory structures, you can get errors relating to missing files, particularly files
that are normally generated by Vivado (FIFOs, etc).
PetaLinux issues
================

Ports not working
-----------------

Check the following if you are unable to get ports working in PetaLinux.

#. | **Check the interface-to-port assignment for your design**
| The assignment of interfaces (eg. eth0, eth1, eth2, etc) to ports (eg. Ethernet FMC port 0, 1, 2 and 3) is specific to the design that
you are using. The interface to port assignment is documented `here <https://axieth.ethernetfmc.com/en/latest/petalinux.html#port-configurations>`_.
#. | **Each port must be assigned to a different subnet**
| If you assign interface eth0 to IP address 192.168.1.10, then you must use a different subnet for the IP address of eth1, eth2 and eth3.
Multiple ports that are managed under Linux must be assigned to different subnets, or they will not work.
An example address assignment would be eth0=192.168.1.10, eth1=192.168.2.10, eth2=192.168.3.10, eth3=192.168.4.10.
Dropped pings/packets
---------------------

2. **Did you correctly follow the Build instructions in this readme file?**
All the projects in the repo are built, synthesised and implemented to a bitstream before being committed, so if you follow the
instructions, there should not be any build issues.
No dropped packets are to be expected with our example designs. If you are experiencing dropped packets of any kind, this can be an indication
of one of the following issues:

3. **Did you copy/clone the repo into a short directory structure?**
Vivado doesn't cope well with long directory structures, so copy/clone the repo into a short directory structure such as
``C:\projects\``. When working in long directory structures, you can get errors relating to missing files, particularly files
that are normally generated by Vivado (FIFOs, etc).
* Timing in the FPGA design is not optimal (check for timing errors in the Vivado design)
* Timing of the RGMII interface is not optimal (can be due to the FPGA design or the PHY configuration)

We ensure that there are no timing errors or issues on all of our designs before making a release, so typically this problem occurs on
custom designs where the timing issues have not yet been optimized. Please `contact us <https://opsero.com/contact-us/>`_ for support
if you are experiencing dropped packets.

0 comments on commit 77f81a2

Please sign in to comment.