Statistics
| Branch: | Tag: | Revision:

root / host / docs / usrp2.rst @ e4d3f63c

History | View | Annotate | Download (16.9 KB)

1
========================================================================
2
UHD - USRP2 and N Series Application Notes
3
========================================================================
4

    
5
.. contents:: Table of Contents
6

    
7
------------------------------------------------------------------------
8
Load the images onto the SD card (USRP2 only)
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
**Warning!**
15
It is possible to use 3rd party SD cards with the USRP2.
16
However, certain types of SD cards will not interface with the CPLD:
17

    
18
* Cards can be SDHC, which is not a supported interface.
19
* Cards can have unexpected timing characteristics.
20

    
21
For these reasons, we recommend that you use the SD card that was supplied with the USRP2.
22

    
23
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24
Use the card burner tool (unix)
25
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
26
::
27

    
28
    sudo <install-path>/share/uhd/utils/usrp2_card_burner_gui.py
29

    
30
    -- OR --
31

    
32
    cd <install-path>/share/uhd/utils
33
    sudo ./usrp2_card_burner.py --dev=/dev/sd<XXX> --fpga=<path_to_fpga_image>
34
    sudo ./usrp2_card_burner.py --dev=/dev/sd<XXX> --fw=<path_to_firmware_image>
35

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

    
40
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
41
Use the card burner tool (windows)
42
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
43
::
44

    
45
    <path_to_python.exe> <install-path>/share/uhd/utils/usrp2_card_burner_gui.py
46

    
47
------------------------------------------------------------------------
48
Load the images onto the on-board flash (USRP-N Series only)
49
------------------------------------------------------------------------
50
The USRP-N Series can be reprogrammed over the network
51
to update or change the firmware and FPGA images.
52
When updating images, always burn both the FPGA and firmware images before power cycling.
53
This ensures that when the device reboots, it has a compatible set of images to boot into.
54

    
55
**Note:**
56
Different hardware revisions require different FPGA images.
57
Determine the revision number from the sticker on the rear of the chassis.
58
Use this number to select the correct FPGA image for your device.
59

    
60
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
61
Use the net burner tool (unix)
62
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
63
::
64

    
65
    <install-path>/share/uhd/utils/usrp_n2xx_net_burner_gui.py
66

    
67
    -- OR --
68

    
69
    cd <install-path>/share/uhd/utils
70
    ./usrp_n2xx_net_burner.py --addr=<ip address> --fw=<path for firmware image>
71
    ./usrp_n2xx_net_burner.py --addr=<ip address> --fpga=<path to FPGA image>
72

    
73
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
74
Use the net burner tool (Windows)
75
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
76
::
77

    
78
    <path_to_python.exe> <install-path>/share/uhd/utils/usrp_n2xx_net_burner_gui.py
79

    
80
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
81
Device recovery and bricking
82
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
83
Its possible to put the device into an unusable state by loading bad images.
84
Fortunately, the USRP-N Series can be booted into a safe (read-only) image.
85
Once booted into the safe image, the user can once again load images onto the device.
86

    
87
The safe-mode button is a pushbutton switch (S2) located inside the enclosure.
88
To boot into the safe image, hold-down the safe-mode button while power-cycling the device.
89
Continue to hold-down the button until the front-panel LEDs blink and remain solid.
90

    
91
When in safe-mode, the USRP-N device will always have the IP address 192.168.10.2
92

    
93
------------------------------------------------------------------------
94
Setup networking
95
------------------------------------------------------------------------
96
The USRP2 only supports gigabit ethernet,
97
and will not work with a 10/100 Mbps interface.
98
However, a 10/100 Mbps interface can be connected indirectly
99
to a USRP2 through a gigabit ethernet switch.
100

    
101
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
102
Setup the host interface
103
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
104
The USRP2 communicates at the IP/UDP layer over the gigabit ethernet.
105
The default IP address of the USRP2 is **192.168.10.2**
106
You will need to configure the host's ethernet interface with a static IP
107
address to enable communication.  An address of **192.168.10.1** and a subnet
108
mask of **255.255.255.0** is recommended.
109

    
110
On a Linux system, you can set a static IP address very easily by using the
111
'ifconfig' command:
112
::
113

    
114
    sudo ifconfig <interface> 192.168.10.1
115

    
116
Note that <interface> is usually something like 'eth0'.  You can discover the
117
names of the network interfaces in your computer by running 'ifconfig' without
118
any parameters:
119
::
120

    
121
    ifconfig -a
122

    
123
**Note:**
124
When using the UHD, if an IP address for the USRP2 is not specified,
125
the software will use UDP broadcast packets to locate the USRP2.
126
On some systems, the firewall will block UDP broadcast packets.
127
It is recommended that you change or disable your firewall settings.
128

    
129
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
130
Multiple devices per host
131
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
132
For maximum throughput, one ethernet interface per USRP2 is recommended,
133
although multiple devices may be connected via a gigabit ethernet switch.
134
In any case, each ethernet interface should have its own subnet,
135
and the corresponding USRP2 device should be assigned an address in that subnet.
136
Example:
137

    
138
**Configuration for USRP2 device 0:**
139

    
140
* Ethernet interface IPv4 address: 192.168.10.1
141
* Ethernet interface subnet mask: 255.255.255.0
142
* USRP2 device IPv4 address: 192.168.10.2
143

    
144
**Configuration for USRP2 device 1:**
145

    
146
* Ethernet interface IPv4 address: 192.168.20.1
147
* Ethernet interface subnet mask: 255.255.255.0
148
* USRP2 device IPv4 address: 192.168.20.2
149

    
150
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
151
Change the USRP2's IP address
152
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
153
You may need to change the USRP2's IP address for several reasons:
154

    
155
* to satisfy your particular network configuration
156
* to use multiple USRP2s on the same host computer
157
* to set a known IP address into USRP2 (in case you forgot)
158

    
159
**Method 1:**
160
To change the USRP2's IP address
161
you must know the current address of the USRP2,
162
and the network must be setup properly as described above.
163
Run the following commands:
164
::
165

    
166
    cd <install-path>/share/uhd/utils
167
    ./usrp_burn_mb_eeprom --args=<optional device args> --key=ip-addr --val=192.168.10.3
168

    
169
**Method 2 (Linux Only):**
170
This method assumes that you do not know the IP address of your USRP2.
171
It uses raw ethernet packets to bypass the IP/UDP layer to communicate with the USRP2.
172
Run the following commands:
173
::
174

    
175
    cd <install-path>/share/uhd/utils
176
    sudo ./usrp2_recovery.py --ifc=eth0 --new-ip=192.168.10.3
177

    
178
------------------------------------------------------------------------
179
Communication problems
180
------------------------------------------------------------------------
181
When setting up a development machine for the first time,
182
you may have various difficulties communicating with the USRP device.
183
The following tips are designed to help narrow-down and diagnose the problem.
184

    
185
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
186
RuntimeError: no control response
187
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
188
This is a common error that occurs when you have set the subnet of your network
189
interface to a different subnet than the network interface of the USRP.  For
190
example, if your network interface is set to 192.168.20.1, and the USRP is
191
192.168.10.2 (note the difference in the third numbers of the IP addresses), you
192
will likely see a 'no control response' error message.
193

    
194
Fixing this is simple - just set the your host PC's IP address to the same
195
subnet as your USRP. Instructions for setting your IP address are in the
196
previous section of this documentation.
197

    
198

    
199
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
200
Firewall issues
201
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
202
When the IP address is not specified,
203
the device discovery sends broadcast UDP packets from each ethernet interface.
204
Many firewalls will block the replies to these broadcast packets.
205
If disabling your system's firewall,
206
or specifying the IP address yeilds a discovered device,
207
then your firewall may be blocking replies to UDP broadcast packets.
208
If this is the case, we recommend that you disable the firewall,
209
or create a rule to allow all incoming packets with UDP source port 49152.
210

    
211
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
212
Ping the device
213
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
214
The USRP will reply to icmp echo requests.
215
A successful ping response means that the device has booted properly,
216
and that it is using the expected IP address.
217

    
218
::
219

    
220
    ping 192.168.10.2
221

    
222
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
223
Monitor the serial output
224
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
225
Read the serial port to get debug verbose from the embedded microcontroller.
226
The microcontroller prints useful information about IP addresses,
227
MAC addresses, control packets, fast-path settings, and bootloading.
228
Use a standard USB to 3.3v-level serial converter at 230400 baud.
229
Connect GND to the converter ground, and connect TXD to the converter receive.
230
The RXD pin can be left unconnected as this is only a one-way communication.
231

    
232
* **USRP2:** Serial port located on the rear edge
233
* **N210:** Serial port located on the left side
234

    
235
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
236
Monitor the host network traffic
237
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
238
Use wireshark to monitor packets sent to and received from the device.
239

    
240
------------------------------------------------------------------------
241
Addressing the device
242
------------------------------------------------------------------------
243

    
244
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
245
Single device configuration
246
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
247
In a single-device configuration,
248
the USRP device must have a unique IPv4 address on the host computer.
249
The USRP can be identified through its IPv4 address, resolvable hostname, or by other means.
250
See the application notes on `device identification <./identification.html>`_.
251
Use this addressing scheme with the *single_usrp* interface.
252

    
253
Example device address string representation for a USRP2 with IPv4 address 192.168.10.2
254

    
255
::
256

    
257
    addr=192.168.10.2
258

    
259
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
260
Multiple device configuration
261
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
262
In a multi-device configuration,
263
each USRP device must have a unique IPv4 address on the host computer.
264
The device address parameter keys must be suffixed with the device index.
265
Each parameter key should be of the format <key><index>.
266
Use this addressing scheme with the *multi_usrp* interface.
267

    
268
* The order in which devices are indexed corresponds to the indexing of the transmit and receive channels.
269
* The key indexing provides the same granularity of device identification as in the single device case.
270

    
271
Example device address string representation for 2 USRP2s with IPv4 addresses 192.168.10.2 and 192.168.20.2
272
::
273

    
274
    addr0=192.168.10.2, addr1=192.168.20.2
275

    
276
------------------------------------------------------------------------
277
Using the MIMO Cable
278
------------------------------------------------------------------------
279
The MIMO cable allows two USRP devices to share reference clocks,
280
time synchronization, and the ethernet interface.
281
One of the devices will sink its clock and time references to the MIMO cable.
282
This device will be referred to as the slave, and the other device, the master.
283

    
284
* The slave device acquires the clock and time references from the master device.
285
* The master and slave may be used individually or in a multi-device configuration.
286
* External clocking is optional, and should only be supplied to the master device.
287

    
288
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
289
Shared ethernet mode
290
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
291
In shared ethernet mode,
292
only one device in the configuration can be attached to the ethernet.
293

    
294
* Clock reference, time reference, and data are communicated over the MIMO cable.
295
* Both master and slave must have different IPv4 addresses in the same subnet.
296

    
297
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
298
Dual ethernet mode
299
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
300
In dual ethernet mode,
301
both devices in the configuration must be attached to the ethernet.
302

    
303
* Only clock reference and time reference are communicated over the MIMO cable.
304
* Both master and slave must have different IPv4 addresses in different subnets.
305

    
306
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
307
Configuring the slave
308
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
309
In order for the slave to synchronize to the master over MIMO cable,
310
the following clock configuration must be set on the slave device:
311
::
312

    
313
    uhd::clock_config_t clock_config;
314
    clock_config.ref_source = uhd::clock_config_t::REF_MIMO;
315
    clock_config.pps_source = uhd::clock_config_t::PPS_MIMO;
316
    usrp->set_clock_config(clock_config, slave_index);
317

    
318

    
319
------------------------------------------------------------------------
320
Alternative stream destination
321
------------------------------------------------------------------------
322
It is possible to program the USRP to send RX packets to an alternative IP/UDP destination.
323

    
324
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
325
Set the subnet and gateway
326
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
327
To use an alternative streaming destination,
328
the device needs to be able to determine if the destination address
329
is within its subnet, and ARP appropriately.
330
Therefore, the user should ensure that subnet and gateway addresses
331
have been programmed into the device's EEPROM.
332

    
333
Run the following commands:
334
::
335

    
336
    cd <install-path>/share/uhd/utils
337
    ./usrp_burn_mb_eeprom --args=<optional device args> --key=subnet --val=255.255.255.0
338
    ./usrp_burn_mb_eeprom --args=<optional device args> --key=gateway --val=192.168.10.1
339

    
340
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
341
Create a receive streamer
342
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
343
Set the stream args "addr" and "port" values to the alternative destination.
344
Packets will be sent to this destination when the user issues a stream command.
345

    
346
::
347

    
348
    //create a receive streamer, host type does not matter
349
    uhd::stream_args_t stream_args("fc32");
350

    
351
    //resolvable address and port for a remote udp socket
352
    stream_args.args["addr"] = "192.168.10.42";
353
    stream_args.args["port"] = "12345";
354

    
355
    //create the streamer
356
    uhd::rx_streamer::sptr rx_stream = usrp->get_rx_stream(stream_args);
357

    
358
    //issue stream command
359
    uhd::stream_cmd_t stream_cmd(uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE);
360
    stream_cmd.num_samps = total_num_samps;
361
    stream_cmd.stream_now = true;
362
    usrp->issue_stream_cmd(stream_cmd);
363

    
364
**Note:**
365
Calling recv() on this streamer object should yield a timeout.
366

    
367
------------------------------------------------------------------------
368
Hardware setup notes
369
------------------------------------------------------------------------
370

    
371
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
372
Front panel LEDs
373
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
374
The LEDs on the front panel can be useful in debugging hardware and software issues.
375
The LEDs reveal the following about the state of the device:
376

    
377
* **LED A:** transmitting
378
* **LED B:** mimo cable link
379
* **LED C:** receiving
380
* **LED D:** firmware loaded
381
* **LED E:** reference lock
382
* **LED F:** CPLD loaded
383

    
384

    
385
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
386
Ref Clock - 10MHz
387
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
388
Using an external 10MHz reference clock, square wave will offer the best phase
389
noise performance, but sinusoid is acceptable.  The reference clock requires the following power level:
390

    
391
* **USRP2** 5 to 15dBm
392
* **N2XX** 0 to 15dBm
393

    
394

    
395
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
396
PPS - Pulse Per Second
397
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
398
Using a PPS signal for timestamp synchronization requires a square wave signal with the following amplitude:
399

    
400
* **USRP2** 5Vpp
401
* **N2XX** 3.3 to 5Vpp
402

    
403
Test the PPS input with the following app:
404

    
405
* <args> are device address arguments (optional if only one USRP is on your machine)
406

    
407
::
408

    
409
    cd <install-path>/share/uhd/examples
410
    ./test_pps_input --args=<args>
411

    
412
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
413
Internal GPSDO
414
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
415
Please see the `Internal GPSDO Application Notes <./gpsdo.html>`_
416
for information on configuring and using the internal GPSDO.
417

    
418
------------------------------------------------------------------------
419
Miscellaneous
420
------------------------------------------------------------------------
421

    
422
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
423
Available Sensors
424
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
425
The following sensors are available for the USRP2/N-Series motherboards;
426
they can be queried through the API.
427

    
428
* mimo_locked - clock reference locked over the MIMO cable
429
* ref_locked - clock reference locked (internal/external)
430
* other sensors are added when the GPSDO is enabled
431

    
432
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
433
Multiple RX channels
434
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
435
There are two complete DDC chains in the FPGA.
436
In the single channel case, only one chain is ever used.
437
To receive from both channels,
438
the user must set the RX subdevice specification.
439
This hardware has only one daughterboard slot,
440
which has been aptly named slot "A".
441

    
442
In the following example, a TVRX2 is installed.
443
Channel 0 is sourced from subdevice RX1,
444
channel 1 is sourced from subdevice RX2:
445
::
446

    
447
    usrp->set_rx_subdev_spec("A:RX1 A:RX2");