[^commitgit]:You should only use our package or proper release (tagged commit).
The **master** branch might have the latest source but only offer support for tagged release. The other branches are normally used for development and are not stable.
> ***Notes:*** The next commands provided by this tutorial will be executed within the
current directory (*spec-sw* is the root directory).
The **master** branch might have the latest source but support is only offered for tagged release. The other branches are normally used for development and are not stable.
Structure of the WR-NIC
-----------------------
Structure of the spec-sw project
---------------------------------
Most of the information on how the project is structured can be find in the [spec-sw.pdf] in the `/doc` folder,
however we are going to briefly resume it:
...
...
@@ -232,69 +215,74 @@ of the carrier being used (e.g. SPEC, SVEC, ...)
[^fmc-bus]:More information about the fmc-bus can be found within [fmc-bus.pdf] in the `doc/` folder.
[^lm32inc]:In future version, the program file for the LM32 will be included into the gateware.
Compile & install
------------------------
A Makefile in the [spec-sw] project has been written to compile and install easily the drivers and the tools used below.
~~~~{.sh}
## Go to spec-sw project
>:$ cd spec-sw
## In the root folder (spec-sw), run
>:$ make
## then, install the driver in your system so that they load automatically
>:$ sudo make install
~~~~~~~~~~~
If everything works well you should see the driver in
~~~~{.sh}
>:$ ls -l /lib/modules/$(uname -r)/extra
~~~~~~~~~~~
> ***Notes:*** In some distribution such as Ubuntu 12.04, you might need to force the creation of dependancy
to load the modules using modprobe.
~~~~{.sh}
>:$ sudo depmod -a
~~~~~~~~~~~
Download, install & load the gateware
--------------------------------------
You need to install the gateware[^version] to `/lib/firmware/fmc`
If you have used our package you will already have the proper binary
## Download all the firware files (from OHWR website).
>:$ wget -nv http://www.ohwr.org/attachments/download/1815/wr-starting-kit-v1.0_gw.tar.gz -O- | tar -xvz
~~~~~~~~~~~
<!-- TODO: Put the source and tag of the binaries -->
Once you have the file you need to install them to your system in order to make them load automatically
~~~~{.bash}
# Install the HDL binaries in /lib/firmware/fmc (require sudo)
$ sudo cp -v gateware/*.bin /lib/firmware/fmc
~~~~{.sh}
## Install the HDL binaries in /lib/firmware/fmc (require sudo)
>:$ sudo cp -v firmware/*.bin /lib/firmware/fmc
~~~~~~~~~~~~~
[^version]: The HDL binaries (gateware) came from other project, you can find in
the [Developers Section](#quick-start-guide-for-developers) where to obtain them and
how to compile them.
### Automatic installation
You can also use the script `wr-ssk-get` in `wr-starting-kit/scripts` folder
to ease the installation. `sudo` is required
~~~~{.sh}
## Fetch and install the firmware
>:$ scripts/wr-ssk-get --all
~~~~~~~~~~~~~~
Compile & install
------------------------
A Makefile has been wrote to compile and install easily the drivers and the tools used below.
~~~~{.bash}
# In the root folder (spec-sw), run
make
#then, install the driver in your system so that they load automatically
sudo make
~~~~~~~~~~~
If everything works well you should see the driver in
~~~~{.bash}
$ ls -l /lib/modules/$(uname -r)/extra
~~~~~~~~~~~
> ***Notes:*** In some distribution such as Ubuntu 12.04, you might need to force the creation of dependancy
to load the modules using modprobe.
[^version]:The HDL binaries (gateware) came from other project, you can find in
the [Developers Section](#quick-start-guide-for-developers) where to obtain them and
how to compile them.
~~~~{.bash}
$ sudo depmod -a
~~~~~~~~~~~
Loading the driver
...
...
@@ -302,32 +290,29 @@ Loading the driver
To enable the wr-nic you should execute the modprobe[^errmodprobe] command to load everything
~~~~{.bash}
$ sudo modprobe wr-nic
~~~~{.sh}
>:$ sudo modprobe wr-nic
~~~~~~~~
[^errmodprobe]:We have found a problem in some distribution with `modprobe` command.
You should use `insmod` instead and look at the [Know bugs sections](#known-bugs).
You shoudl expect to obtain one (or two) new interface(s):
You should expect to obtain one (or two) new interface(s):
~~~~{.bash}
$ ifconfig -a | grep wr
~~~~{.sh}
>:$ ifconfig -a | grep wr
wr0 Link encap:Ethernet HWaddr XX:XX:XX:XX:XX:XX
~~~~~~~~~~~~
Setting Master & Slave using White Rabbit Core
=============================================
A "*SPEC+FMC DIO*" board is considered as a slave node, however in a standard
White Rabbit network the synchronization is done using a master such as the White Rabbit switch.
In order to enable the synchronization capabilities we need to setup one board in master mode
In order to enable the synchronization capabilities we need to setup one board in master mode
(faking to be the switch) and the other one in slave mode (default mode). This is done through the
shell of White Rabbit Core that give this functionality among others.
...
...
@@ -342,9 +327,9 @@ To configure the SPEC board in master/slave mode you need to access to the White
To access to the physical, you first need to connect the mini-USB of the SPEC to your PC. Then, you need to run
a terminal emulator[^sudomc](such as minicom) on the device created while plug-in the USB cable.
~~~~~{.bash}
$ sudo minicom --device=/dev/ttyUSB0 -b 115200
$ sudo minicom --device=/dev/ttyUSB1 -b 115200
~~~~~{.sh}
>:$ sudo minicom --device=/dev/ttyUSB0 -b 115200
>:$ sudo minicom --device=/dev/ttyUSB1 -b 115200
~~~~~~~~~~
> ***Notes:*** ttyUSB0 might not correspond to your first board, and ttyUSB1 to the second one.
...
...
@@ -357,18 +342,18 @@ You first need to know which is the bus_id of your board
> ***Notes:*** The VUART is currently not working for this package, but the information is given for the next version. See [Know bugs sections](#known-bugs)
@@ -424,7 +409,7 @@ and check the [wrpc.pdf] that explain how to add SFPs parameters.
* Setup one board in master (the one with the purple SFP)
~~~~~{.bash}
~~~~~{.sh}
wrc1# mode master
SPLL_Init: running as Free-running Master, 1 ref channels, 2 out channels
Locking PLL...
...
...
@@ -432,7 +417,7 @@ Locking PLL...
* And let the other one in slave mode (this should not be necessecary but you might have set it before in master mode)
~~~~~{.bash}
~~~~~{.sh}
wrc2# mode slave
slave
~~~~~~~
...
...
@@ -442,8 +427,10 @@ slave
You should run the PTP daemon on both card
wrc1# ptp start
wrc2# ptp start
~~~~~{.sh}
wrc1# ptp start
wrc2# ptp start
~~~~~~~
And you should obtain the following message on the slave board:
...
...
@@ -458,9 +445,11 @@ And you should obtain the following message on the slave board:
Finally you can run the WRC shell in `gui` mode to obtain more information
wrc2# gui
~~~~~{.sh}
wrc2# gui
~~~~~~~~~~
~~~~~{}
~~~~~{.sh}
WR PTP Core Sync Monitor v 1.0
Esc = exit
...
...
@@ -494,7 +483,7 @@ Update counter: 117
You can see that the slave node is locked, calibrated and that the phase tracking is enabled.
> ***Notes: *** We also recommand you to setup an init script if you do not want to repeat these operations at each
> ***Notes: *** We also recommand you to setup an init script if you do not want to repeat these operations at each
reboot. You can look at the [wrpc.pdf] for more information or use the `init show` command to check the
one you have running.
...
...
@@ -505,18 +494,17 @@ Bring up the network interface
-------------------------------
Once the drivers are loaded and the PTP has started you might need to bring the new network interfaces up.
In order to to this you should just execute:
In order to do this you should just execute:
~~~~{.bash}
$ sudo ifconfig wr0
$ sudo ifconfig wr1
~~~~{.sh}
>:$ sudo ifconfig wr0
>:$ sudo ifconfig wr1
~~~~~~~~~~~~
And then check if they are mount by doing
~~~~{.bash}
$ sudo ifconfig | grep wr
And then check if they are mounted by doing
~~~~{.sh}
>:$ sudo ifconfig | grep wr
wr0 Link encap:Ethernet HWaddr 08:00:30:0d:e8:6b
wr1 Link encap:Ethernet HWaddr 08:00:30:0d:e4:cd
~~~~~~~~~~~~
...
...
@@ -535,7 +523,7 @@ oscilloscope by using the LEMO-BNC adapter provided in your package.
It is also recommended to follow the order of the tutorial as the concept you need to understand
are explained in the same order as the experiments.
> **Notes:** Before each experiment you should be sure to setup that your boards are in *master/slave* mode and that the PTP deamon are running on both.
> **Notes:** Before each experiment you should be sure to setup that your boards are in *master/slave* mode and that the PTP deamon are running on both.
Playing with the DIO channels
...
...
@@ -569,9 +557,9 @@ The available modes are:
For example you can set it up like this
~~~~~{.bash}
# Configure channel 0 as input with termination, 1 as input, 4 as fixed low
$ sudo wr-dio-cmd wr0 mode Ii--0
~~~~~{.sh}
## Configure channel 0 as input with termination, 1 as input, 4 as fixed low
>:$ sudo wr-dio-cmd wr0 mode Ii--0
~~~~~~~~~~~~~~~~
> ***Notes:*** please note that the `pulse` command activate the DIO mode (without changing the termination)
...
...
@@ -589,17 +577,17 @@ You should plug the LEMO cable in the connector #5 (channel 4), and connect the
Finally you need to trigger pulse in your oscilloscope. Then you can try the following commands:
~~~~~{.bash}
# Pulse channel 4 for 0.1 seconds now
$ sudo wr-dio-cmd wr0 pulse 4 .1 now
~~~~~{.sh}
## Pulse channel 4 for 0.1 seconds now
>:$ sudo wr-dio-cmd wr0 pulse 4 .1 now
#Pulse for 10 microseconds in the middle of the next second
$ sudo wr-dio-cmd wr0 pulse 4 .00001 +1.5
## Pulse for 10 microseconds in the middle of the next second
>:$ sudo wr-dio-cmd wr0 pulse 4 .00001 +1.5
# Pulse for 1ms at 17:00 today
# Set the datetime of the next event (60 seconds from now)
# NOTE: this only work if the date is correctly set in the master SPEC,
@@ -1231,16 +1220,19 @@ and how to calibrate them.
If you get and error like the following:
$ sudo modprobe wr-nic
FATAL: Module wr_nic not found.
~~~~~~~{.sh}
>:$ sudo modprobe wr-nic
FATAL: Module wr_nic not found.
~~~~~~~~~
Be sure that you have run the `sudo depmod -a` command.
Otherwise you can still load the kernel modules with insmod using the following order:
$ sudo insmod kernel/fmc.ko
$ sudo insmod kernel/spec.ko
$ sudo insmod kernel/wr-nic.ko
~~~~~~~{.sh}
>:$ sudo insmod kernel/fmc.ko
>:$ sudo insmod kernel/spec.ko
>:$ sudo insmod kernel/wr-nic.ko
~~~~~~~~~~~~~
### The system hangs-up
...
...
@@ -1271,7 +1263,7 @@ to bring them up. This is explained in the [Bring up the network interface](#bri
You have run
~~~~~{.bash}
~~~~~{.sh}
wrc# calibration force
Enabling ptracker channel: 0
LNK:
...
...
@@ -1283,7 +1275,7 @@ And the calibration is doing an infinite loop.
Calibration is only available for slave and you need to be connected to a **working PTP master** master (SPEC in master mode or the switch) to be completed.
To configure your SPEC as a working PTP master, just execute in the wrpc shell of the other board:
~~~~~{.bash}
~~~~~{.sh}
wrc# sfp match
wrc# mode master
wrc# ptp start
...
...
@@ -1305,7 +1297,7 @@ and use the *fmc-write-eeprom* module from the [spec-sw] project to flash the ee