在 UHD 下使用USRP2和N系列

原文地址:在 UHD 下使用 USRP2 和 N 系列 作者:super

将映像文件装入 SD卡中(仅对 USRP2)


提示!谨慎使用命令 usrp2_card_burner.py。如若指向错误的设备节点,可能会重写硬盘。请确认 --dev= 指向 SD 卡。

提示! 尽管理论上 USRP2 可以使用第三方 SD卡。但是有些类型的 SD 卡不能同 CPLD 进行交互:

  • 该卡可能是 SDHC,它不支持同 CPLD 的交互。
  • 该卡有意外的时间特性。

鉴于上面的这些因数,建议使用随机的 SD卡。

使用 Unix烧卡工具

sudo/share/uhd/utils/usrp2_card_burner_gui.py

-- OR --

cd /share/uhd/utils
sudo./usrp2_card_burner.py --dev=/dev/sd --fpga=
sudo./usrp2_card_burner.py --dev=/dev/sd --fw=

使用 选项 --list 可获取可能的原始设备清单。list 将会剔除容量太大无法装入 SD卡的磁盘扇区和设备。 Linux, Mac OS X, 和 Windows 都具有该 --list 选项。

使用windows 烧卡工具

/share/uhd/utils/usrp2_card_burner_gui.py

将映像文件装入板上闪存中 (仅对 USRP-N 系列)


USRP-N系列产品可以通过网络进行重新编程来更新或更改固件(firmware)和 FPGA映像(images)。但每当在更新映像(images)过程中,总是在系统重新启动(powercycling)之前对 FPGA和固件两者的映像烧结。这便可确保设备一旦被重启,其映像文件与之配套。

使用 Unix的网络烧卡工具

sudo/share/uhd/utils/usrp_n2xx_net_burner_gui.py

-- OR --

cd /share/uhd/utils
./usrp_n2xx_net_burner.py --addr=--fw=
./usrp_n2xx_net_burner.py --addr=--fpga=

使用Windows 的网络烧卡工具

/share/uhd/utils/usrp_n2xx_net_burner_gui.py

设备的恢复 - Device recoveryand bricking

载入有问题的映像文件可能会招致设备处于无法工作的状态。幸运的是,USRP-N系列可以启用安全(只读)映像模式。如若启用安全映像模式,用户便可试图再次装入映像文件。

壳体内的按钮(S2)便是安全模式按钮。在上电启动过程中按下该按钮便可启动安全映像模式。持续按住该按钮直到前面板的LED 从闪烁到稳定(blink and remainsolid)。

在安全模式中,USRP-N 设备的 IP地址总是 192.168.10.2 。

配置网络 - Setupnetworking


USRP2仅支持千兆级以太网,所以其无法同 10/100 Mbps接口直接相互工作。尽管如此,10/100 Mbps 接口还是可以通过一个千兆级的以太网交换机间接同USRP2 相连接。

配置主机接口- Setup the host interface

USRP2的通过千兆级以太网的通信是基于 IP/UDP 层。其缺省 IP 地址为192.168.10.2。这样只需配置计算机侧一个静态 IP地址便可使其相互通信。推荐使用 IP 地址 192.168.10.1 和子网掩码255.255.255.0.

备注:在使用 UHD 情况下,如若 USRP2的 IP 地址没有被指定,应用软件便会使用 UDP 广播的数据包来定位 USRP2。存在这样一些情况,防火墙软件会阻碍 UDP 广播的数据包。在此建议更改或取消防火墙相关功用。

单口多机化 - Multiple devices perhost

为最大化数据处理能力,建议一个以太网接口配置一台USRP2 设备。尽管如此,通过千兆级的交换机也可以同多台设备相互连接。无论哪种情况,每个以太网接口单元都必须有自己的子网,其相关的USRP2 的地址应当处于其子网范围内。例如:

USRP2 设备 0 的配置:

  • 以太网接口 IPv4 地址:192.168.10.1
  • 以太网接口子网掩码: 255.255.255.0
  • USRP2 设备的 IPv4 地址:192.168.10.2

USRP2 设备 1 的配置:

  • 以太网接口 IPv4地址:192.168.20.1
  • 以太网接口子网掩码: 255.255.255.0
  • USRP2 设备的 IPv4地址:192.168.20.2

更改 USRP 的 IP 地址 - Changethe USRP2's IP address

基于下面可能的原因需要对 USRP2 的 IP地址进行更改:
  • 满足特定的网络配置要求
  • 在同一宿主计算下使用多台 USRP2
  • 使用(用户)熟知的 IP 地址(以防遗忘)

方法 1: 更改 USRP2 IP地址的先决条件是必须清楚其正在使用的地址,网络也必须如上所述地被恰当的配置成功。然后运行下面的命令:

cd /share/uhd/utils
./usrp_burn_mb_eeprom--args= --key=ip-addr --val=192.168.10.3

方法 2(仅适用于 Linux): 此方法假定在对设备现在使用的 IP 地址不清楚的情况下。它使用以太网的原始数据包短接(bypass)IP/UDP 协议层而直接同 USRP2通信。如下运行命令:

cd /share/uhd/utils sudo
./usrp2_recovery.py--ifc=eth0 --new-ip=192.168.10.3

通信问题 - Communicationproblems


首次构建一个开发平台时,碰到各种各样的 USRP通信问题是不足为奇的。下面便是一些简化的问题和诊断的建议。

防火墙 - Firewall issues

在 没有配置设备的IP 地址的情况下,设备查询机制便会通过各个以太网接口广播 UDP数据包来试图建立相互间的通信。众多防火墙会阻碍对这些广播信息的反馈。如若(如此,只能)禁止系统的防火墙功能、或明晰需确认的设备的 IP地址。在此情况下的建议是:要么关闭防火墙、要么建立一个规则为端口号为 49152 的 UDP的数据源建立通道。

“Ping” 设备 - Ping thedevice

USRP响应 icmp echo 。 成功的 ping意味着设备已经被成功地启动,也意味着希望的 IP 地址被成功的配置。

ping 192.168.10.2

监视串口 - Monitor the serialoutput


Read theserial port to get debug verbose from the embedded microcontroller.The microcontroller prints useful information about IP addresses,MAC addresses, control packets, fast-path settings, andbootloading. Use a standard USB to 3.3v-level serial converter at230400 baud. Connect GND to the converter ground, and connect TXDto the converter receive. The RXD pin can be left unconnected asthis is only a one-way communication.

  • USRP2:Serial port located on the rear edge
  • N210:Serial port located on the left side

监视主网流量 - Monitor thehost network traffic

Use wiresharkto monitor packets sent to and received from thedevice.

赋予设备地址 - Addressing thedevice


单一设备的配置 - Single deviceconfiguration

In asingle-device configuration, the USRP device must have a uniqueIPv4 address on the host computer. The USRP can be identifiedthrough its IPv4 address, resolvable hostname, or by other means.See the application notes on deviceidentification. Use thisaddressing scheme with the single_usrp interface.

Exampledevice address string representation for a USRP2 with IPv4 address192.168.10.2 addr=192.168.10.2

多台设备的配置 - Multipledevice configuration

In amulti-device configuration, each USRP device must have a uniqueIPv4 address on the host computer. The device address parameterkeys must be suffixed with the device index. Each parameter keyshould be of the format . Use this addressing scheme with themulti_usrp interface.

  • The order in whichdevices are indexed corresponds to the indexing of the transmit andreceive channels.
  • The key indexingprovides the same granularity of device identification as in thesingle device case.

Exampledevice address string representation for 2 USRP2s with IPv4addresses 192.168.10.2 and 192.168.20.2

addr0=192.168.10.2,addr1=192.168.20.2

使用 MIMO 电缆 - Using the MIMOCable


The MIMOcable allows two USRP devices to share reference clocks, timesynchronization, and the ethernet interface.

共享网络模式 - Sharedethernet mode

Inshared ethernet mode, only one device in the configuration can beattached to the ethernet. This device will be referred to as themaster, and the other device, the slave.
  • Themaster provides reference clock and time synchronization to theslave.
  • All datapassing between the host and the slave is routed over the MIMOcable.
  • Bothmaster and slave must have different IPv4 addresses in the samesubnet.
  • Themaster and slave may be used individually or in a multi-deviceconfiguration.
  • Externalclocking is optional, and should only be supplied to the masterdevice.
  • The roleof slave and master may be switched with the "mimo_mode" deviceaddress (see dual ethernet mode).
Exampledevice address string representation for 2 USRP2s with IPv4addresses 192.168.10.2 (master) and 192.168.10.3(slave)

-- Multi-device example--

addr0=192.168.10.2,addr1=192.168.10.3

-- Two single devices example--

addr=192.168.10.2
addr=192.168.10.3

双网模式 - Dual ethernetmode

In dualethernet mode, both devices in the configuration must be attachedto the ethernet. One of the devices in the configuration will beconfigured to provide synchronization. This device will be referredto as the master, and the other device, the slave.
  • Themaster provides reference clock and time synchronization to theslave.
  • Thedevices require the special device address argument "mimo_mode"set.
  • Bothmaster and slave must have different IPv4 addresses in differentsubnets.
  • Themaster and slave may be used individually or in a multi-deviceconfiguration.
  • Externalclocking is optional, and should only be supplied to the masterdevice.
Exampledevice address string representation for 2 USRP2s with IPv4addresses 192.168.10.2 (master) and 192.168.20.2(slave)

-- Multi-device example--

addr0=192.168.10.2, mimo_mode0=master,addr1=192.168.20.2, mimo_mode1=slave

-- Two single devices example--

addr=192.168.10.2,mimo_mode=master
addr=192.168.20.2,mimo_mode=slave

硬件配置注解 - Hardware setupnotes


前面板指示灯 - Front panelLEDs

The LEDson the front panel can be useful in debugging hardware and softwareissues. The LEDs reveal the following about the state of thedevice:

  • LED A:transmitting
  • LED B:mimo cable link
  • LED C:receiving
  • LED D:firmware loaded
  • LED E:reference lock
  • LED F:CPLD loaded

参考时钟 -10MHz

Using anexternal 10MHz reference clock, square wave will offer the bestphase noise performance, but sinusoid is acceptable. The referenceclock requires the following power level:

  • USRP2 5to 15dBm
  • N2XX 0 to15dBm

PPS - Pulse PerSecond

Using aPPS signal for timestamp synchronization requires a square wavesignal with the following amplitude:

  • USRP25Vpp
  • N2XX 3.3to 5Vpp

Test thePPS input with the following app:

  • aredevice address arguments (optional if only one USRP is on yourmachine)
cd/share/uhd/examples
./test_pps_input--args=

内部 GPS 伺服时钟 - InternalGPSDO

Please seethe GPSDO application note for information on configuring and usingthe internal GPSDO.

Installationinstructions:
  1. Removethe daughterboard.
  2. Move J510jumper on the motherboard from 1-2 to 2-3 in order to switch fromexternal 10 MHz Ref Clock to GPSDO’s 10 MHz RefClock
  3. Screw theGPSDO module in place with the screws provided. The screws aretreated to avoid loosening with vibration.
  4. Connectthe GPSDO power cable to J509 on the motherboard, and then toconnector D on the GPSDO module
  5. Connectan SMB to SMA cable between connectors B and J506(PPS2)
  6. Connectan SMB to SMA cable between connectors C and J507 (CLKREF2)
  7. Connectthe serial cable between connectors A and J312 (RS232-3) on themotherboard. If J312 on your USRP isn’t a keyed connector, pleaseensure to connect pin1 (TX) of connector A to pin3 (RX) onJ312.
  8. Removethe washer and nut from the MMCX to SMA-Bulkhead cable. Connect itto connector E and then insert SMA-Bulkhead connector through thehole in the rear panel. Tighten nut to fasten inplace.
  9. Replacethe daughterboard pushing all the cablesunderneath.

Then runthe following commands:

cd /share/uhd/utils
./usrp_burn_mb_eeprom --args=--key=gpsdo --val=internal

Removalinstructions:

Restorethe jumper setting, disconnect the cables, and unscrew the GPSDOunit. Then run the following commands:

cd /share/uhd/utils
./usrp_burn_mb_eeprom --args=--key=gpsdo --val=none

AntennaTypes:

The GPSDO iscapable of supplying a 3V for active GPS antennas or supportingpassive antennas

杂类 - Miscellaneous


可选传感单元 - AvailableSensors

Thefollowing sensors are available for the USRP2/N-Seriesmotherboards; they can be queried through theAPI.

  • mimo_locked - clock reference lockedover the MIMO cable
  • ref_locked - clock reference locked(internal/external)
  • gps_time- GPS epoch seconds (available when GPSDOinstalled)
  • gps_locked - GPS lockstatus

多接收链路 - Multiple RXchannels

There aretwo complete DDC chains in the FPGA. In the single channel case,only one chain is ever used. To receive from both channels, theuser must set the RX subdevice specification. This hardware hasonly one daughterboard slot, which has been aptly named slot"0".

In thefollowing example, a TVRX2 is installed. Channel 0 is sourced fromsubdevice RX1, channel 1 is sourced from subdeviceRX2:

usrp->set_rx_subdev_spec("0:RX10:RX2");


from:http://kb.microembedded.com/usrp2uhdmanual

你可能感兴趣的:(在 UHD 下使用USRP2和N系列)