Ubuntu16.04の新しいパソコンでUSRPを使うためにN210Rev4のファームウエアとFPGAイメージのアップデートを行った。
USRPを認識するところまではできている。
$uhd_find_devices
linux;GNU C++ version 5.3.1 20151219; Boost_105800;UHD_003.009.002-0-unknown
--------------------------------------------------
--UHD Device 0
--------------------------------------------------
DeviceAddress:
type:usrp2
addr:192.168.10.2
name:
serial:F3A4BE
ファームウエアとFPGAイメージのアップデートが必要なようだ。
$uhd_usrp_probe
linux;GNU C++ version 5.3.1 20151219; Boost_105800;UHD_003.009.002-0-unknown
--Opening a USRP2/N-Series device...
--Current recv frame size: 1472 bytes
--Current send frame size: 1472 bytes
Error:RuntimeError:
Pleaseupdate the firmware and FPGA images for your device.
Seethe application notes for USRP2/N-Series for instructions.
ExpectedFPGA compatibility number 11, but got 10:
TheFPGA build is not compatible with the host code build.
Couldnot find usrp_n210_fw.bin and usrp_n210_r4_fpga.bin in your imagespath!
Pleaserun:
"/usr/lib/uhd/utils/uhd_images_downloader.py"
上で言われているとおりに"/usr/lib/uhd/utils/uhd_images_downloader.py"を実行する。
$cd /usr/lib/uhd//utils
$ls
b2xx_fx3_utils uhd_images_downloader.py usrp_n2xx_net_burner.py
fx2_init_eeprom usrp2_card_burner.py usrp_n2xx_net_burner_gui.py
latency usrp2_card_burner_gui.py usrp_n2xx_simple_net_burner
octoclock_burn_eeprom usrp2_recovery.py usrp_x3xx_fpga_burner
query_gpsdo_sensors usrp_burn_db_eeprom
uhd-usrp.rules usrp_burn_mb_eeprom
$ sudo uhd_images_downloader
Images destination: /usr/share/uhd/images
Downloading images from: http://files.ettus.com/binaries/images/uhd-images_003.009.002-release.zip
Downloading images to: /tmp/tmpOp8MqY/uhd-images_003.009.002-release.zip
26296 kB / 26296 kB (100%)
イメージをダウンロードできたのでアップデートを行う。
N200の時のアップデートを参考にした。http://dsp.jpn.org/index.php?action=journal_view_main_detail&block_id=87&post_id=192&comment_flag=1
まずフォルダの中身をかくにんする。
$ cd /usr/share/uhd/images
$ ls
003.009.002.tag usrp_e110_fpga.bin
LICENSE usrp_e310_fpga.bit
bit usrp_e310_fpga_idle.bit
octoclock_bootloader.hex usrp_e310_fpga_sg3.bit
octoclock_r4_fw.hex usrp_e3xx_fpga_idle.bit
usrp1_fpga.rbf usrp_e3xx_fpga_idle_sg3.bit
usrp1_fpga_4rx.rbf usrp_n200_fw.bin
usrp1_fw.ihx usrp_n200_r2_fpga.bin
usrp2_fpga.bin usrp_n200_r3_fpga.bin
usrp2_fw.bin usrp_n200_r4_fpga.bin
usrp_b100_fpga.bin usrp_n210_fw.bin
usrp_b100_fpga_2rx.bin usrp_n210_r2_fpga.bin
usrp_b100_fw.ihx usrp_n210_r3_fpga.bin
usrp_b200_fpga.bin usrp_n210_r4_fpga.bin
usrp_b200_fw.hex usrp_x300_fpga_HGS.bit
usrp_b200mini_fpga.bin usrp_x300_fpga_HGS.lvbitx
usrp_b205mini_fpga.bin usrp_x310_fpga_HGS.bit
usrp_b210_fpga.bin usrp_x310_fpga_HGS.lvbitx
usrp_e100_fpga_v2.bin winusb_driver
今回アップデートしたいのはN210Rev4なので、
usrp_n210_r4_fpga.bin
usrp_n210_fw.bin
を使用する。
$ cd /usr/lib/uhd/utils
$ ls
b2xx_fx3_utils uhd_images_downloader.py usrp_n2xx_net_burner.py
fx2_init_eeprom usrp2_card_burner.py usrp_n2xx_net_burner_gui.py
latency usrp2_card_burner_gui.py usrp_n2xx_simple_net_burner
octoclock_burn_eeprom usrp2_recovery.py usrp_x3xx_fpga_burner
query_gpsdo_sensors usrp_burn_db_eeprom
uhd-usrp.rules usrp_burn_mb_eeprom
usrp_n2xx_net_burner.pyを使用して、FPGAイメージからアップデートする。
$ ./usrp_n2xx_net_burner.py --addr=192.168.10.2 --fpga=/usr/share/uhd/images/usrp_n210_r4_fpga.bin
USRP-N2XX found.
************************************************************************************************
WARNING: This utility will be removed in an upcoming version of UHD. In the future, use
this command:
uhd_image_loader --args="type=usrp2,addr=192.168.10.2" \
--no-fw \
--fpga-path="/usr/share/uhd/images/usrp_n210_r4_fpga.bin"
************************************************************************************************
Hardware type: n210_r4
Flash size: 4194304
Sector size: 65536
Begin FPGA write: this should take about 1 minute...
Erasing 1572864 bytes at 1572864
Writing image
Verifying data
Read back 1299084 bytes
Success.
Time elapsed: 44.175792 seconds
同様にファームウエアもアップデート。
$ sudo ./usrp_n2xx_net_burner.py --addr=192.168.10.2 --fw=/usr/share/uhd/images/usrp_n210_fw.bin
USRP-N2XX found.
************************************************************************************************
WARNING: This utility will be removed in an upcoming version of UHD. In the future, use
this command:
uhd_image_loader --args="type=usrp2,addr=192.168.10.2" \
--fw-path="/usr/share/uhd/images/usrp_n210_fw.bin" \
--no-fpga
************************************************************************************************
Hardware type: n210_r4
Flash size: 4194304
Sector size: 65536
Begin firmware write: this should take about 1 second...
Erasing 31744 bytes at 3145728
Writing image
Verifying data
Read back 16383 bytes
Success.
Time elapsed: 1.071108 seconds
アップデート出来ました。
アップデートの時のwarningで
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"
を次のバージョンからは使えと言われている?
uhd_usrp_probe した時に
UHD Warning:
Unable to set the thread priority. Performance may be negatively affected.
Please see the general application notes in the manual for instructions.
EnvironmentError: OSError: error in pthread_setschedparam
が出ているので後で調べておく。
http://files.ettus.com/manual/index.html
の中にthread priorityの設定に関する情報がありますね。Linux側での設定のようです。harmlessな警告だとも書いてあるように読めますが。