天天看點

USRP B210 運作gnuradio時 FPGA固件版本沖突錯誤解決方法

事情起源于昨天拿到USRP後開始調試,結果整了一個下午都沒解決這個問題。

昨天晚上自己思考了一下,覺得還是版本問題。

首先,uhd_find_devices和uhd_usrp_probe均可以正常運作,沒有報錯,固件正常加載,序列号也可看到。

[email protected]:~$ uhd_find_devices
[INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; UHD_3.15.0.HEAD-0-g4e06022c
--------------------------------------------------
-- UHD Device 0
--------------------------------------------------
Device Address:
    serial: 86680AA
    name: Zhixun-wireless_B210
    product: B210
    type: b200
           
[email protected]:~$ uhd_usrp_probe
[INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; UHD_3.15.0.HEAD-0-g4e06022c
[INFO] [B200] Detected Device: B210
[INFO] [B200] Loading FPGA image: /usr/local/share/uhd/images/usrp_b210_fpga.bin...
           

可以看到固件加載完全正常,但是當我們使用apt安裝的gnuradio-companion

出現報錯如下:

RuntimeError: RuntimeError: Expected FPGA compatibility number 14, but got 16:
The FPGA build is not compatible with the host code build.
Please run:
 "/usr/lib/x86_64-linux-gnu/uhd/utils/uhd_images_downloader.py"
           

首先遇到這個不能慌張,不要按照上面所提示的運作固件下載下傳器更新固件,因為那些下載下傳的是最新版本的固件,對解決問題沒有幫助。

到官方git上找一個比較古老的版本,比如on 17 May 2018釋出的v3.11.1.0

解壓後,在解壓的目錄使用sudo運作gnuradio

~/software/uhd_firm/uhd-images_3.11.1.0$ sudo gnuradio-companion
           

因為Gnuradio在運作UHD時,是從目前檔案夾位置尋找固件上傳給fpga使用的,這裡也可能是因為沒有映射好路徑造成的,那麼現在直接從這個檔案夾運作,就可以找到固件,并且版本也與之對應

再次運作流程圖

Generating: '/home/teray/\xe6\xa1\x8c\xe9\x9d\xa2/gnuradio projects/USRP/top_block.py'

Executing: /usr/bin/python -u /home/teray/桌面/gnuradio projects/USRP/top_block.py

linux; GNU C++ version 7.3.0; Boost_106501; UHD_003.010.003.000-0-unknown


(top_block.py:7109): IBUS-WARNING **: 11:47:52.488: The owner of /home/teray/.config/ibus/bus is not root!
-- Detected Device: B210
-- Loading FPGA image: /home/teray/software/uhd_firm/uhd-images_3.11.1.0/usrp_b210_fpga.bin... done
-- Operating over USB 3.
-- Detecting internal GPSDO.... No GPSDO found
-- Initialize CODEC control...
-- Initialize Radio control...
-- Performing register loopback test... pass
-- Performing register loopback test... pass
-- Performing CODEC loopback test... pass
-- Performing CODEC loopback test... pass
-- Setting master clock rate selection to 'automatic'.
-- Asking for clock rate 16.000000 MHz... 
-- Actually got clock rate 16.000000 MHz.
-- Performing timer loopback test... pass
-- Performing timer loopback test... pass
-- Asking for clock rate 40.000000 MHz... 
-- Actually got clock rate 40.000000 MHz.
-- Performing timer loopback test... pass
-- Performing timer loopback test... pass
           

成功。

以上。

繼續閱讀