root / host / docs / usrp2.rst @ a67486ff
History | View | Annotate | Download (15.2 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 that of 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 broadcasts 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 yields 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 output 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 sync 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 Tthernet. |
| 293 |
|
| 294 |
* Clock reference, time reference, and data are communicated over the MIMO cable. |
| 295 |
* 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 |
* The 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 |
Hardware setup notes |
| 320 |
------------------------------------------------------------------------ |
| 321 |
|
| 322 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 323 |
Front panel LEDs |
| 324 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 325 |
The LEDs on the front panel can be useful in debugging hardware and software issues. |
| 326 |
The LEDs reveal the following about the state of the device: |
| 327 |
|
| 328 |
* **LED A:** transmitting |
| 329 |
* **LED B:** mimo cable link |
| 330 |
* **LED C:** receiving |
| 331 |
* **LED D:** firmware loaded |
| 332 |
* **LED E:** reference lock |
| 333 |
* **LED F:** CPLD loaded |
| 334 |
|
| 335 |
|
| 336 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 337 |
Ref Clock - 10MHz |
| 338 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 339 |
Using an external 10MHz reference clock, a square wave will offer the best phase |
| 340 |
noise performance, but a sinusoid is acceptable. The reference clock requires the following power level: |
| 341 |
|
| 342 |
* **USRP2** 5 to 15dBm |
| 343 |
* **N2XX** 0 to 15dBm |
| 344 |
|
| 345 |
|
| 346 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 347 |
PPS - Pulse Per Second |
| 348 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 349 |
Using a PPS signal for timestamp synchronization requires a square wave signal with the following amplitude: |
| 350 |
|
| 351 |
* **USRP2** 5Vpp |
| 352 |
* **N2XX** 3.3 to 5Vpp |
| 353 |
|
| 354 |
Test the PPS input with the following app: |
| 355 |
|
| 356 |
* <args> are device address arguments (optional if only one USRP is on your machine) |
| 357 |
|
| 358 |
:: |
| 359 |
|
| 360 |
cd <install-path>/share/uhd/examples |
| 361 |
./test_pps_input --args=<args> |
| 362 |
|
| 363 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 364 |
Internal GPSDO |
| 365 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 366 |
Please see the `Internal GPSDO Application Notes <./gpsdo.html>`_ |
| 367 |
for information on configuring and using the internal GPSDO. |
| 368 |
|
| 369 |
------------------------------------------------------------------------ |
| 370 |
Miscellaneous |
| 371 |
------------------------------------------------------------------------ |
| 372 |
|
| 373 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 374 |
Available Sensors |
| 375 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 376 |
The following sensors are available for the USRP2/N-Series motherboards; |
| 377 |
they can be queried through the API. |
| 378 |
|
| 379 |
* **mimo_locked** - clock reference locked over the MIMO cable |
| 380 |
* **ref_locked** - clock reference locked (internal/external) |
| 381 |
* other sensors are added when the GPSDO is enabled |
| 382 |
|
| 383 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 384 |
Multiple RX channels |
| 385 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 386 |
There are two complete DDC chains in the FPGA. |
| 387 |
In the single channel case, only one chain is ever used. |
| 388 |
To receive from both channels, |
| 389 |
the user must set the RX subdevice specification. |
| 390 |
This hardware has only one daughterboard slot, |
| 391 |
which has been aptly named slot "A". |
| 392 |
|
| 393 |
In the following example, a TVRX2 is installed. |
| 394 |
Channel 0 is sourced from subdevice RX1, |
| 395 |
channel 1 is sourced from subdevice RX2: |
| 396 |
:: |
| 397 |
|
| 398 |
usrp->set_rx_subdev_spec("A:RX1 A:RX2");
|