简介

nrfutil是Nordic提供的命令行工具集。支持以下功能:

  • 基于Jlink的固件烧录、读取、flash擦除、recover
  • 基于MCUBOOT的固件升级(DFU)
  • 基于nRF5 bootloader的固件升级(DFU)
  • 其他功能(Trace,工具更新...)

它采用包管理器的形式,可以在线检查各个工具的最新版本,并更新。

下载地址:https://www.nordicsemi.com/Products/Development-tools/nrf-util

地址里除了nrfutil本身的下载链接,还有一些依赖软件的链接,以及软件的说明。一定要仔细阅读。

下载完毕后可以添加到PATH环境变量,方便使用。

首次运行

下载好nrfutil的可执行文件,以及它的各种依赖软件后,就可以运行(为了方便使用,记得添加到PATH环境变量)。

如果你的电脑可以魔法上网,那么可以直接运行成功。

首次运行时,会连接到raw.githubusercontent.com去获取最新的工具软件列表,然后下载对应操作系统的工具。但我们知道,这个网站在国内是裸连不了的,运行会报以下错误:

nrfutil.exe
Error: Failed to bootstrap core functionality before executing command. HTTP request to default bootstrap resource https://raw.githubusercontent.com/NordicSemiconductor/nrfutil-package-index/master/bootstrap.json failed. Please check that your internet connection is functioning. If you use a proxy, please try the --detect-proxy flag or
manually set the appropriate HTTP_PROXY-style environment variable(s). To use a custom bootstrap config, set NRFUTIL_BOOTSTRAP_CONFIG_URL. To bootstrap directly from a nrfutil-core package
tarball, set NRFUTIL_BOOTSTRAP_TARBALL_PATH.

通过阅读输出日志,我们可以知道。如果我们想设置自己的工具软件列表,需要设置NRFUTIL_BOOTSTRAP_CONFIG_URL环境变量。我们先用一台可以魔法上网的电脑访问一下日志中提到的无法访问的网址,可以看到这个Json文件的内容:

{
"nrfutil_core_tarball_urls": {
"aarch64-apple-darwin": "https://developer.nordicsemi.com/.pc-tools/nrfutil/nrfutil-aarch64-apple-darwin-7.6.0.tar.gz",
"x86_64-apple-darwin": "https://developer.nordicsemi.com/.pc-tools/nrfutil/nrfutil-x86_64-apple-darwin-7.6.0.tar.gz",
"x86_64-pc-windows-msvc": "https://developer.nordicsemi.com/.pc-tools/nrfutil/nrfutil-x86_64-pc-windows-msvc-7.6.0.tar.gz",
"x86_64-unknown-linux-gnu": "https://developer.nordicsemi.com/.pc-tools/nrfutil/nrfutil-x86_64-unknown-linux-gnu-7.6.0.tar.gz"
}
}

原来是记录了各个操作系统平台下,最新版的工具压缩包(tarball)下载地址。那么这里我们可以根据链接,下载自己操作系统对应的压缩包,存放到电脑本地。

然后,根据日志的提示,我们直接设置NRFUTIL_BOOTSTRAP_TARBALL_PATH临时环境变量,将其设置为压缩包在本地的绝对地址

PS C:\software> $env:NRFUTIL_BOOTSTRAP_TARBALL_PATH="C:\Software\nrfutil-x86_64-pc-windows-msvc-7.6.0.tar.gz"

PS C:\software> .\nrfutil.exe
nrfutil Usage:
nrfutil [+MODIFIER] [OPTIONS] [SUBCOMMAND] Options:
--log-level <LOG_LEVEL> Set the maximum log level [env: NRFUTIL_LOG=] [possible values: off, error, warn, info,
debug, trace]
--log-output <LOG_OUTPUT> Set log output type: --log-output=stdout --log-output=file ... [possible values: file,
stdout]
--json Print output in a JSON Lines format
--json-pretty Print output as formatted JSON
--skip-overhead Skip all message overhead when in JSON output mode, outputting only the data part of
"info" messages and ignoring the rest
--changelog Print the latest changelog entry
--changelog-full Print the full changelog
-V, --version
--help-extended Show comprehensive documentation
--license Show license information for in-built dependencies
--detect-proxy Invoke libproxy's 'proxy' utility program to retrieve proxy server info and use it
-h, --help Print help (see more with '--help') Built-in nrfutil commands (see installed commands with `list`):
help Show comprehensive documentation
install Download and install nrfutil commands
upgrade Upgrade nrfutil commands to the latest version
uninstall Uninstall nrfutil commands [aliases: remove]
prepare-offline Prepare local package and resource repositories for offline installs of nrfutil commands
search Search for installable nrfutil commands in the package index
list List installed nrfutil commands
self-upgrade Upgrades the nrfutil core functionality to the latest version

然后就可以看到nrfutil可以正常运行了。

注意:

  • Windows平台请使用powershell,而非cmd。其他平台请使用对应的设置临时环境变量的方法。
  • 只有第一次运行时才需要设置这个环境变量。第一次运行成功后,会在${HOME}/.nrfutil隐藏文件夹内保存这些信息:



    后续都可以直接执行nrfutil,不需要网络和这个临时环境变量。

安装子命令

查看有哪些子命令可安装(需网络)

PS C:\> nrfutil search
Command Installed Latest Status
ble-sniffer 0.12.0 0.12.0 Installed
completion 1.4.0 1.4.0 Installed
device 2.1.1 2.1.1 Installed
npm 0.3.0 0.3.0 Installed
nrf5sdk-tools 1.0.1 1.0.1 Installed
toolchain-manager 0.14.1 0.14.1 Installed
trace 2.1.0 2.1.0 Installed

安装想要的子命令(需网络)

nrfutil install nrf5sdk-tools

工具包离线导出与导入

在首次安装之后,我们可以用能连网的电脑下载、更新一些新的工具。这些工具就存放在用户目录的.nrfutil中。如果想拷贝到不能连网的电脑中,就可以导出到U盘,再从U盘导入到电脑里。

导出到U盘:

nrfutil prepare-offline E:/nrfutils

从U盘安装想要的子命令

nrfutil install nrf5sdk-tools --from-offline E:/nrfutils

具体请参考:https://docs.nordicsemi.com/bundle/nrfutil/page/guides/getting_started.html#installing-nrf-util-when-offline

其他推荐阅读

nrfutil博客:https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/nrf-util-unified-command-line-utility

nrfutil文档:https://docs.nordicsemi.com/bundle/nrfutil/page/README.html

离线版nrfutil工具安装方法的更多相关文章

  1. Windows下解压版mysql的安装方法

    1 首先下载mysql的解压版的rar安装包 1 将安装包解压到安装路径.C:\Program Files (x86)\MySQL2 将安装路径下的bin追加到环境变量"PATH" ...

  2. ubuntu 下rar解压工具安装方法

    1.压缩功能安装 sudo apt-get install rar卸载 sudo apt-get remove rar2.解压功能安装 sudo apt-get install unrar卸载 sud ...

  3. Tensorflows安装(cpu版最简安装方法)

    一.说明 首先声明,本人系统是Windows10 64位,Win7未试. 本文旨在帮助园友以更简单的方式安装Tensorflow,下面介绍的是如何安装Python的Tensorflow cpu版本. ...

  4. 离线版centos8环境部署迁移监控操作笔记

    嗨咯,前两天总结记录了离线版centos8下docker的部署笔记,今天正好是2021年的最后一天,今天正好坐在本次出差回家的列车上,车上没有上面事做,索性不如把本次离线版centos8环境安装的其他 ...

  5. [官网]SQLSERVER ON linux 的最低要求 以及安装方法

    快速入门:在 Red Hat 上安装 SQL Server 并创建数据库 总体说明: 适用于: SQL Server (仅限 Linux)Azure SQL 数据库Azure SQL 数据仓库并行数据 ...

  6. 缺陷管理工具JIRA破解版及其安装方法

    JIRA是一个优秀的问题(or bugs,task,improvement,new feature )跟踪及管理软件.    它由Atlassian开发,采用J2EE技术.它正被广泛的开源软件组织,以 ...

  7. Visual Studio 2017正式版离线安装方法

    Visual Studio 2017 RTM正式版离线安装及介绍. 首先至官网下载:https://www.visualstudio.com/zh-hans/downloads/ VS 2017 正式 ...

  8. visual studio 2015离线版msdn下载和安装

    2014年11月13日,微软发布了Visual Studio 2015 Preview,但是Visual Studio 2015 的msdn该如何安装呢?下面脚本之家就为大家分享一篇visual st ...

  9. Visual Studio 2013 离线版msdn下载和安装

    Visual Studio 2013出来后,并没有自带msdn安装包,而变成了在线安装msdn,好处是msdn可以随时进行更新,坏处是难道以后每次重新安装系统,都需要重新下载吗,如何解决这个问题呢?本 ...

  10. 免安装版Tomcat6.0启动方法

    免安装版Tomcat6.0启动方法 1.下载Tomcat Zip压缩包,解压. 2.修改startup.bat文件: 在第一行前面加入如下两行 SET JAVA_HOME=JDK目录 SET CATA ...

随机推荐

  1. Solution -「CF 590E」Birthday

    \(\mathscr{Description}\)   Link.   给定 \(n\) 个字符串 \(S_{1..n}\),选出其一个最大子集 \(T\),使得 \(T\) 中的字符串两两不存在包含 ...

  2. CDS标准视图:日期迁移视图 I_ShiftedCalendarDate

    视图名称:I_ShiftedCalendarDate 视图类型:带参数的视图 时间期间偏移量单位(P_TimePeriodOffsetUnit): D代表天 W代表周 M代表月 Q代表季 Y代表年 期 ...

  3. 前端(二)-CSS

    1.样式 1.1 行内样式 <h1 style="color:red;">行内样式</h1> 1.2 内部样式 CSS代码写在 <head> 的 ...

  4. Android平台架构及特性

    Android平台架构及特性 Android系统的底层是建立在Linux系统之上,改平台由操作系统.中间件.用户界面和应用软件四层组成,它采用一种被称为软件叠层(Software Stack)的方式进 ...

  5. weixueyuan-Nginx在Kubernetes10

    https://www.weixueyuan.net/nginx/kubernetes/ Kubernetes(k8s)分布式容器管理系统简述 Kubernetes 是分布式容器管理系统,它提供了对容 ...

  6. SpringCloud(1)---入门篇

    SpringCloud理解篇 一.微服务概述 1.什么是微服务 目前的微服务并没有一个统一的标准,一般是以业务来划分将传统的一站式应用,拆分成一个个的服务,彻底去耦合,一个微服务就是单功能业务,只做一 ...

  7. Redis常用指令(详细)

    # Redis 常用指令## 基础命令### 启动与连接```bash# 启动 Redis 服务redis-server# 连接 Redis 客户端redis-cli```### 基本操作```bas ...

  8. 搭建 VuePress 站点必做的 10 个优化

    前言 在 <一篇带你用 VuePress + Github Pages 搭建博客>中,我们使用 VuePress 搭建了一个博客,最终的效果查看:TypeScript 中文文档. 在搭建这 ...

  9. Java02-基础语法

    Java基础语法 [ 任务列表 ] 1.注释 2.字面量 3.变量 4.关键字.标识符 5.方法 6.类型转换 7.输入输出 8.运算符 9.其他 -------------------------- ...

  10. oracle19.3打补丁

    补丁 36582781 - 数据库发布更新 19.24.0.0.240716 本文档在发布时准确无误.有关数据库版本更新 19.24.0.0.240716 的任何更改和其他信息,请参阅 My Orac ...