码迷,mamicode.com
首页 > 其他好文 > 详细

hackrf one环境搭建以及升级固件

时间:2020-09-18 17:11:40      阅读:103      评论:0      收藏:0      [点我收藏+]

标签:one   驱动   upd   版本号   说明   etc   软件   ror   git   

一、环境配置

操作系统: Ubuntu 18

硬件:hackrf

  • 第一步 配置国内源

备份 /etc/apt/sources.list 文件

sudo mv /etc/apt/sources.list /etc/apt/sourses.list.backup
sudo touch /etc/apt/sources.list && sudo gedit /etc/apt/sources.list

然后把选择如下源中的一个复制进去。

#中科大源
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

#阿里云源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

#清华源
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

更新软件源和系统

sudo apt-get update
sudo apt-get upgrade
  • 第二步 配置环境
sudo apt-get install gnuradio hackrf libhackrf-dev gqrx-sdr rtl-sdr gr-osmosdr osmo-sdr libusb-1.0

二、升级驱动&&固件

  • 升级驱动

配置好环境后,输入 hackrf_info ,如果出现下图所示,hackrf_info versionlibhackrf version 都是未知的,说明系统安装的驱动版本和 hackrf one 的固件版本不匹配,需要升级驱动。

技术图片

从该网址 https://github.com/mossmann/hackrf/releases 下载最新的版本(这里的版本是2018.01.1,需要找到对应的版本,不过很建议升级到最新固件)

xz -d hackrf-2018.01.1.tar.xz
tar xvf hackrf-2018.01.1.tar

cd hackrf-2018.01.1/host
mkdir build && cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make
sudo make install
sudo ldconfig
  • 升级固件

如果 Firmware Version 的版本比较老,需要更新固件。进入firmware-bin目录,执行以下操作

Flash hackrf_spiflash -w hackrf_one_usb.bin # 更新Flash
hackrf_cpldjtag -x hackrf_cpld_default.xsvf # 更新CPLD

更新后,按一下hackrfreset 键,或者拔了USB线后重新再插上,输入 hackrf_info 可以看到驱动版本号。说明安装成功。

技术图片

hackrf one环境搭建以及升级固件

标签:one   驱动   upd   版本号   说明   etc   软件   ror   git   

原文地址:https://www.cnblogs.com/zhangyazhou/p/13690431.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!