Statistics
| Branch: | Tag: | Revision:

root / host / docs / usrp2.rst @ aa4a6b66

History | View | Annotate | Download (8.1 kB)

1
========================================================================
2
UHD - USRP2 Application Notes
3
========================================================================
4

    
5
.. contents:: Table of Contents
6

    
7
------------------------------------------------------------------------
8
Load the images onto the SD card
9
------------------------------------------------------------------------
10
**Warning!**
11
Use the usrp2_card_burner.py with caution. If you specify the wrong device node,
12
you could overwrite your hard drive. Make sure that --dev= specifies the SD card.
13

    
14
Use the *--list* option to get a list of possible raw devices.
15
The list result will filter out disk partitions and devices too large to be the sd card.
16
The list option has been implemented on Linux, Mac OS X, and Windows.
17

    
18
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19
Use the card burner tool (unix)
20
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21
::
22

    
23
    sudo <prefix>/share/uhd/utils/usrp2_card_burner_gui.py
24

    
25
    -- OR --
26

    
27
    cd <prefix>/share/uhd/utils
28
    sudo ./usrp2_card_burner.py --dev=/dev/sd<XXX> --fpga=<path_to_fpga_image>
29
    sudo ./usrp2_card_burner.py --dev=/dev/sd<XXX> --fw=<path_to_firmware_image>
30

    
31
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32
Use the card burner tool (windows)
33
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
34
::
35

    
36
    <path_to_python.exe> <prefix>/share/uhd/utils/usrp2_card_burner_gui.py
37

    
38

    
39
------------------------------------------------------------------------
40
Setup networking
41
------------------------------------------------------------------------
42
The USRP2 only supports gigabit ethernet, and
43
will not work with a 10/100 Mbps interface.
44
Because the USRP2 uses gigabit ethernet pause frames for flow control,
45
you cannot use multiple USRP2s with a switch or a hub.
46
It is recommended that each USRP2 be plugged directly into its own
47
dedicated gigabit ethernet interface on the host computer.
48

    
49
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
50
Setup the host interface
51
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
52
The USRP2 communicates at the IP/UDP layer over the gigabit ethernet.
53
The default IP address of the USRP2 is **192.168.10.2**
54
You will need to configure the host's ethernet interface with a static IP address to enable communication.
55
An address of **192.168.10.1** and a subnet mask of **255.255.255.0** is recommended.
56

    
57
**Note:**
58
When using the UHD, if an IP address for the USRP2 is not specified,
59
the software will use UDP broadcast packets to locate the USRP2.
60
On some systems, the firewall will block UDP broadcast packets.
61
It is recommended that you change or disable your firewall settings. 
62

    
63
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
64
Multiple device configuration
65
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
As described above, you will need one ethernet interface per USRP2.
67
Each ethernet interface should have its own subnet,
68
and the corresponding USRP2 device should be assigned an address in that subnet.
69
Example:
70

    
71
**Configuration for USRP2 device 0:**
72

    
73
* Ethernet interface IPv4 address: 192.168.10.1
74
* Ethernet interface subnet mask: 255.255.255.0
75
* USRP2 device IPv4 address: 192.168.10.2
76

    
77
**Configuration for USRP2 device 1:**
78

    
79
* Ethernet interface IPv4 address: 192.168.20.1
80
* Ethernet interface subnet mask: 255.255.255.0
81
* USRP2 device IPv4 address: 192.168.20.2
82

    
83
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
84
Change the USRP2's IP address
85
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
86
You may need to change the USRP2's IP address for several reasons:
87

    
88
* to satisfy your particular network configuration
89
* to use multiple USRP2s on the same host computer
90
* to set a known IP address into USRP2 (in case you forgot)
91

    
92
**Method 1:**
93
To change the USRP2's IP address
94
you must know the current address of the USRP2,
95
and the network must be setup properly as described above.
96
Run the following commands:
97
::
98

    
99
    cd <prefix>/share/uhd/utils
100
    ./usrp_addr_burner --addr=192.168.10.2 --new-ip=192.168.10.3
101

    
102
**Method 2 (Linux Only):**
103
This method assumes that you do not know the IP address of your USRP2.
104
It uses raw ethernet packets to bypass the IP/UDP layer to communicate with the USRP2.
105
Run the following commands:
106
::
107

    
108
    cd <prefix>/share/uhd/utils
109
    sudo ./usrp2_recovery.py --ifc=eth0 --new-ip=192.168.10.3
110

    
111
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
112
Debugging networking problems
113
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
114
**Disable the firewall:**
115
If uhd_find_devices gives you nothing
116
but uhd_find_devices --args addr=192.168.10.2 yeilds a discovered device,
117
then your firewall may be blocking replies to UDP broadcast packets.
118

    
119
**Ping the USRP2:**
120
The USRP2 will reply to icmp echo requests.
121
::
122

    
123
    ping 192.168.10.2
124

    
125
**Monitor the USRP2:**
126
You can read the serial port on the rear of the USRP2
127
to get debug verbose from the embedded microcontroller.
128
Use a standard USB to 3.3v-level serial converter at 230400 baud.
129
The microcontroller prints useful information about IP addresses,
130
MAC addresses, control packets, and fast-path settings.
131

    
132
**Monitor the host network traffic:**
133
Use wireshark to monitor packets sent to and received from the USRP2.
134

    
135
------------------------------------------------------------------------
136
Addressing the device
137
------------------------------------------------------------------------
138

    
139
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
140
Single device configuration
141
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
142
A USRP2 can be identified though its IPv4 address or resolvable hostname.
143
The USRP2 device is referenced through the "addr" key in the device address.
144
Use this addressing scheme with the *simple_usrp* interface.
145

    
146
The device address string representation for a USRP2 with IPv4 address 192.168.10.2
147

    
148
::
149

    
150
    addr=192.168.10.2
151

    
152
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
153
Soft-MIMO configuration
154
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
155
In a soft-mimo configuration, each USRP2 must have a unique IPv4 address (per computer)
156
and be attached to its own dedicated network port.
157
The value for the addr key is a white-space separated list
158
of IPv4 addresses or resolvable hostnames.
159
The first address in the list will represent channel 0,
160
the second channel 1, and so on...
161
Use this addressing scheme with the *mimo_usrp* interface.
162

    
163
The device address string representation for 2 USRP2s with IPv4 addresses 192.168.10.2 and 192.168.20.2
164
::
165

    
166
    addr=192.168.10.2 192.168.20.2
167

    
168
------------------------------------------------------------------------
169
Resize the send and receive buffers
170
------------------------------------------------------------------------
171
It may be useful increase the size of the socket buffers to
172
move the burden of buffering samples into the kernel, or to
173
buffer incoming samples faster than they can be processed.
174
However, if you application cannot process samples fast enough,
175
no amount of buffering can save you.
176

    
177
By default, the UHD will try to request a reasonably large buffer size for both send and receive.
178
A warning will be printed on instantiation if the actual buffer size is insufficient.
179
See the OS specific notes below:
180

    
181
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
182
OS specific notes
183
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
184
On linux, the maximum buffer sizes are capped by the sysctl values
185
**net.core.rmem_max** and **net.core.wmem_max**.
186
To change the maximum values, run the following commands:
187
::
188

    
189
    sudo sysctl -w net.core.rmem_max=<new value>
190
    sudo sysctl -w net.core.wmem_max=<new value>
191

    
192
Set the values permanently by editing */etc/sysctl.conf*
193

    
194
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
195
Device address params
196
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
197
To manually set the size of the buffers,
198
the usrp2 will accept two optional parameters in the device address.
199
Each parameter will accept a numeric value for the number of bytes.
200

    
201
* recv_buff_size
202
* send_buff_size
203

    
204
Example, set the args string to the following:
205
::
206

    
207
    addr=192.168.10.2, recv_buff_size=100e6
208

    
209
------------------------------------------------------------------------
210
Hardware setup notes
211
------------------------------------------------------------------------
212

    
213
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
214
Ref Clock - 10MHz
215
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
216
Using an external 10MHz reference clock requires a signal level between +5dBm and +20dBm at 10MHz applied to the Ref Clock SMA port on the front panel.
217

    
218

    
219
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
220
PPS - Pulse Per Second
221
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
222
Using a PPS signal for timestamp synchronization requires a 5Vpp square wave signal