macOS上安装nrfutil

在Macbook Pro上安装nrfutil
CPU为intel。
macOS版本已经为12.4的Monterey。

python3 -V

显示python版本为3.10.5。

参考文档:https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_nrfutil%2FUG%2Fnrfutil%2Fnrfutil_intro.html

pip3 install --ignore-installed six nrfutil

执行命令

nrfutil --help

在这里插入图片描述
貌似OK了!

执行

nrfutil dfu ble --help

在这里插入图片描述

试着dfu一把

nrfutil dfu ble -ic NRF52 -pkg tag_tb1_lib12_c_fw_dfu_v22.07.1.3.zip -n "LS_DFU" -f

在这里插入图片描述
输入0,回车。
在这里插入图片描述
居然报错了!错误日志:nordicsemi.dfu.package.PackageException: Package /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pc_ble_driver_py/hex/sd_api_v5/connectivity_4.1.2_usb_with_s132_5.1.0_dfu_pkg.zip not found.

Google了一圈,最终在DevZone找到了一篇帖子。说是要把-f参数去掉,改为:

nrfutil dfu ble -ic NRF52 -pkg tag_tb1_lib12_c_fw_dfu_v22.07.1.3.zip -n "LS_DFU"

常见错误

Board not found

斗大的字,板子未找到。未插Dongle或者没插好啦。

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.10/bin/nrfutil", line 33, in <module>
    sys.exit(load_entry_point('nrfutil==6.1.5', 'console_scripts', 'nrfutil')())
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/nordicsemi/__main__.py", line 1173, in ble
    is_jlink = port_is_jlink(port)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/nordicsemi/__main__.py", line 1110, in port_is_jlink
    raise NordicSemiException('Board not found')

Device not found

连接失败,未找到设备。一般是设备进入DFU未成功,找不到,所以连接失败。

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.10/bin/nrfutil", line 33, in <module>
    sys.exit(load_entry_point('nrfutil==6.1.5', 'console_scripts', 'nrfutil')())
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/nordicsemi/__main__.py", line 1215, in ble
    dfu.dfu_send_images()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/nordicsemi/dfu/dfu.py", line 127, in dfu_send_images
    self._dfu_send_image(self.manifest.application)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/nordicsemi/dfu/dfu.py", line 88, in _dfu_send_image
    self.dfu_transport.open()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/nordicsemi/dfu/dfu_transport_ble.py", line 475, in open
    self.target_device_name, self.target_device_addr = self.dfu_adapter.connect(
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/nordicsemi/dfu/dfu_transport_ble.py", line 153, in connect
    self.verify_stable_connection()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/nordicsemi/dfu/dfu_transport_ble.py", line 264, in verify_stable_connection
    raise Exception("Connection Failure - Device not found!")
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值