在 UHD 下使用USRP2和N系列


将映像文件装入 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

<think>好的,我现在需要帮助用户查找关于USRP使用教程软件定义无线电(SDR)的操作指南。首先,我需要回顾用户提供的引用内容,看看里面有没有相关的信息。 根据引用[2]引用[3],USRP通常与GNU Radio一起使用,并且市面上有技术书籍实践案例,这可能包含教程。另外,引用[5]提到了Gqrx的使用教程,虽然这是针对接收器的,但可能USRP有关联。用户的问题主要集中在USRP使用教程操作指南上,所以我需要整理这些引用中的相关信息。 首先,用户可能希望知道如何开始使用USRP,需要哪些软件硬件配置。引用[3]提到USRPUHD驱动控制,并且常与GNU Radio一起使用,所以安装这两个软件是关键步骤。然后,引用[2]提到技术书籍中的实践案例代码示例,这可能涉及具体的教程资源,比如书籍推荐或在线文档。 另外,引用[4]讨论了ADC/DAC的性能,这可能属于硬件配置的一部分,用户可能需要了解如何根据项目需求选择合适的USRP型号。比如,处理高速数据需要更高性能的硬件,如USRP B210/B200。 用户还可能对实际应用案例感兴趣,比如如何监听特定频率或处理通信信号。引用[5]中的Gqrx示例展示了设置频率解调模式,这可能适用于USRP的某些场景,但需要确认Gqrx是否支持USRP设备。 接下来,我需要将信息结构化,分步骤回答用户的问题。可能的结构包括:软件安装(UHD、GNU Radio)、硬件连接、基础教程资源、进阶应用、书籍推荐等。同时,需要引用正确的来源,比如引用[2][3]提到的书籍开源软件,引用[4]的硬件选型建议。 还要考虑用户可能的后续问题,比如如何处理高速数据或优化性能,这可以放在相关问题中。例如,引用[4]提到计算机处理高速数据的挑战,这可能涉及数据存储处理技巧,但当前问题主要是教程,所以可能需要生成相关问题供用户进一步探索。 最后,确保回答符合系统级指令:使用正确的LaTeX格式,中文回答,生成相关问题,引用标注正确。检查是否有遗漏的信息,比如引用[1]可能不直接相关,但引用[2][3][4][5]提供了足够的细节来构建回答。</think>### USRP 使用教程与软件定义无线电(SDR)操作指南 #### 1. **基础软件安装与配置** USRP(通用软件无线电外设)通常与 **GNU Radio** **UHD驱动** 配合使用。以下是基础步骤: - **安装UHD驱动**:所有USRP设备均需通过开源UHD驱动控制[^3]。可从[Ettus Research官网](https://www.ettus.com/)下载对应版本。 - **配置GNU Radio**:GNU Radio是构建SDR系统的开源工具包,支持USRP硬件。安装后可通过流程图式编程实现信号处理。 - **验证硬件连接**:使用`uhd_usrp_probe`命令检测USRP是否被识别[^3]。 #### 2. **基础操作教程** - **接收信号示例**: ```python # GNU Radio示例:接收FM广播信号 from gnuradio import gr from gnuradio import uhd usrp_source = uhd.usrp_source(device_addr="", stream_args=uhd.stream_args('fc32')) usrp_source.set_center_freq(98.5e6) # 设置频率为98.5MHz(FM广播) usrp_source.set_gain(30) # 调整增益 ``` 通过GNU Radio Companion(GRC)可拖拽模块构建流程图,无需手动编码。 - **监听特定频段**:参考Gqrx教程(如设置中心频率解调模式)[^5],但需替换为USRP硬件支持的工具。 #### 3. **进阶应用与资源** - **书籍与文档**: - 《Software Defined Radio using GNU Radio and USRP》提供实践案例[^2]。 - 官方UHD手册涵盖API调用硬件配置细节[^3]。 - **处理高速数据**: USRP B210/B200支持40MHz带宽的802.11n信号,但需优化计算机数据处理能力(如使用SSD存储或FPGA加速)[^4]。 #### 4. **硬件选型建议** - **精度与采样率**: - 14-bit DAC的USRP B100适用于高精度场景(如气象卫星图像接收)[^4]。 - 高速通信(如WiFi)需选择USRP B210/B200[^4]。 --- ###
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值