逆风起笔
c++ and web developer
主页
分类
标签
归档
About Me
友链
My Github
Proudly powered by
Leanote
Theme by ©
mrbird
文章 - ubuntu 16.04 烧写usrp固件和FPGA
Dark
ubuntu 16.04 烧写usrp固件和FPGA
发布于
2018-03-29
1170人围观 0条评论
发表于
2018-03-29
1170人围观 0条评论
## 安装uhd 安装gnuradio的过程中会安装uhd的一套东西,如果没有,需要去安装。如果没有镜像,则从[ettus的官网下载地址](http://files.ettus.com/binaries/images/)下载。这里由于已经在安装gnuradio的时候安装过了,我这里安装目录在`/usr/local/lib/uhd/utils` ## 连接usrp 为了使得PC和usrp相互连接,需要将这两者的ip设为同一网段。比如我这里有限连接的ip的地址设置为192.168.10.1,子网掩码是24。下面会介绍如何设置usrp的地址(这里设备为N210)。 首先,执行 ``` ruiy2@ruiy2-All-Series:/usr/local/lib/uhd/utils$ uhd_find_devices [INFO] [UHD] linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_3.11.0.1-2-g3939fa90 -------------------------------------------------- -- UHD Device 0 -------------------------------------------------- Device Address: serial: 306E981 addr: 192.168.40.3 name: type: usrp2 ``` 可以看到这里usrp的ip和pc并不在同一网段下面,所以需要修改usrp的ip。 如果显示错误信息`No UHD Devices Found`,可以参考[这里](https://stackoverflow.com/questions/33304828/when-trying-to-use-my-usrp-in-gnu-radio-i-get-a-no-devices-found-for)去排查问题。可能原因有三点: * UHD的版本太老,比较新的板子需要下载较新版本的UHD。 * USB方面的原因 * 网络设备不在同一网段 实际上,这里我遇到了第三个问题,导致`uhd_find_device`未找到。但是又不知道设备ip之前是什么,所以就把有限连接的子网掩码改为了8,才有了上面的正确的信息。。。之后才能针对该设备烧写固件、改ip带等等操作。 修改ip的操作比较简单,利用uhd安装目录下的工具 ``` /usrp_burn_mb_eeprom --values="ip-addr=192.168.10.2" ``` 修改过后,需要重启usrp,才会看到新的ip(下面的记录,第一次`uhd_find_devices`时未重启,所以ip未变,重启之后再执行发现ip已修改),过程如下: ``` ruiy2@ruiy2-All-Series:/usr/local/lib/uhd/utils$ ./usrp_burn_mb_eeprom --values="ip-addr=192.168.10.2" Creating USRP device from address: [INFO] [UHD] linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_3.11.0.1-2-g3939fa90 [INFO] [USRP2] Opening a USRP2/N-Series device... [INFO] [USRP2] Current recv frame size: 1472 bytes [INFO] [USRP2] Current send frame size: 1472 bytes [WARNING] [UDP] The recv buffer could not be resized sufficiently. Target sock buff size: 50000000 bytes. Actual sock buff size: 1000000 bytes. See the transport application notes on buffer resizing. Please run: sudo sysctl -w net.core.rmem_max=50000000 [WARNING] [UDP] The recv buffer could not be resized sufficiently. Target sock buff size: 50000000 bytes. Actual sock buff size: 1000000 bytes. See the transport application notes on buffer resizing. Please run: sudo sysctl -w net.core.rmem_max=50000000 [WARNING] [UDP] The send buffer could not be resized sufficiently. Target sock buff size: 1048576 bytes. Actual sock buff size: 1000000 bytes. See the transport application notes on buffer resizing. Please run: sudo sysctl -w net.core.wmem_max=1048576 Fetching current settings from EEPROM... EEPROM ["ip-addr"] is "192.168.40.3" Setting EEPROM ["ip-addr"] to "192.168.10.2"... Power-cycle the USRP device for the changes to take effect. Done ruiy2@ruiy2-All-Series:/usr/local/lib/uhd/utils$ uhd_find_devices [INFO] [UHD] linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_3.11.0.1-2-g3939fa90 -------------------------------------------------- -- UHD Device 0 -------------------------------------------------- Device Address: serial: 306E981 addr: 192.168.40.3 name: type: usrp2 ruiy2@ruiy2-All-Series:/usr/local/lib/uhd/utils$ uhd_find_devices [INFO] [UHD] linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_3.11.0.1-2-g3939fa90 -------------------------------------------------- -- UHD Device 0 -------------------------------------------------- Device Address: serial: 306E981 addr: 192.168.10.2 name: type: usrp2 ruiy2@ruiy2-All-Series:/usr/local/lib/uhd/utils$ ``` ## 烧写固件 因为手上这台usrp已经烧写好了,只是ip不对,所以这里烧写固件的命令没有试。这里只作记录。 ``` uhd_image_loader --args="type=usrp2,addr=192.168.10.2" --fw-path /usr/share/uhd/images/usrp_n210_fw.bin --fpga-path /usr/share/uhd/images/usrp_n210_r4_fpga.bin ``` 提示:如果没有固件,可以从之前提到的官网下载镜像。
上一篇:
GIt 子模块
下一篇:
find_package的作用
0
赞
提交评论
立即登录
,发表评论
没有帐号?
立即注册
0
条评论
More...
没有帐号?立即注册