使用python制作nRF52832升级包和合成烧录文件,青风开发板的作者已经说得很明白,不过作者使用的python是2.7的,已经很落后了。目前python已经更新到3.10.4了。所以我换了台电脑之后,安装最新的python,然后就一系列错误。错误主要如下:

ERROR: Exception:
Traceback (most recent call last):
  File "C:\Users\longzhi\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\cli\base_command.py", line 167, in exc_logging_wrapper
    status = run_func(*args)
  File "C:\Users\longzhi\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\cli\req_command.py", line 205, in wrapper
    return func(self, options, args)
  File "C:\Users\longzhi\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\commands\install.py", line 405, in run
    installed = install_given_reqs(
  File "C:\Users\longzhi\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\req\__init__.py", line 68, in install_given_reqs
    uninstalled_pathset = requirement.uninstall(auto_confirm=True)
  File "C:\Users\longzhi\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\req\req_install.py", line 637, in uninstall
    uninstalled_pathset = UninstallPathSet.from_dist(dist)
  File "C:\Users\longzhi\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\req\req_uninstall.py", line 554, in from_dist
    for script in dist.iterdir("scripts"):
  File "C:\Users\longzhi\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\metadata\pkg_resources.py", line 156, in iterdir
    if not self._dist.isdir(name):
  File "C:\Users\longzhi\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2816, in __getattr__
    return getattr(self._provider, attr)
AttributeError: 'EggMetadata' object has no attribute 'isdir'

本公司使用的电脑很多文件还是加密的,一直怀疑是因为加密的原因没有制作成功,还到处找人帮忙解密python目录下的加密文件。

起始后来发现方向都错了。总结如下:

一、使用新版本的python,然后使用青风给的pc-nrfutil-master包。

二、使用python2.7,然后使用最新下载的pc-nrfutil-master(6.1.3)

三、使用python3.10.4,然后使用最新下载的pc-nrfutil-master(6.1.3)

四、使用python3.9.13,然后使用最新下载的pc-nrfutil-master(6.1.3),此步骤可以使用nrfutil工具,但是找不到mergehex.exe

上面这些步骤都是错误的体验。最后成功的是使用python3.8.5,然后加载pc-nrfutil-master(6.1.3),加载命令:使用命令行进入pc-nrfutil-master这个文件夹,然后输入"python setup.py install",然后就等待安装,安装完成就可以使用命令制作升级包了。

升级包命令过程如下:

E:\>cd hex

E:\hex>nrfutil pkg generate --application app32_new.hex --application-version 3 --hw-version 52 --sd-req 0xB7 --key-file priv.pem SDK153_app_s132.zip
Zip created at SDK153_app_s132.zip

E:\hex>nrfutil settings generate --family NRF52 --application app32_new.hex --application-version 0 --bootloader-version 0 --bl-settings-version 2 settings.hex

Note: Generating a DFU settings page with backup page included.
This is only required for bootloaders from nRF5 SDK 15.1 and newer.
If you want to skip backup page generation, use --no-backup option.

Generated Bootloader DFU settings .hex file and stored it in: settings.hex

Bootloader DFU Settings:
* File: settings.hex
* Family: nRF52
* Start Address: 0x0007F000
* CRC: 0x27DF04E1
* Settings Version: 0x00000002 (2)
* App Version: 0x00000000 (0)
* Bootloader Version: 0x00000000 (0)
* Bank Layout: 0x00000000
* Current Bank: 0x00000000
* Application Size: 0x00014030 (81968 bytes)
* Application CRC: 0x008F0116
* Bank0 Bank Code: 0x00000001
* Softdevice Size: 0x00000000 (0 bytes)
* Boot Validation CRC: 0x614833DB
* SD Boot Validation Type: 0x00000000 (0)
* App Boot Validation Type: 0x00000001 (1)

E:\hex>mergehex.exe --merge bootloader32.hex settings.hex --output b1_temp.hex
Parsing input hex files.
Merging files.
Storing merged file.

E:\hex>mergehex.exe --merge b1_temp.hex app32_new.hex s132_nrf52_6.1.1_softdevice.hex --output whole32.hex
Parsing input hex files.
Merging files.
Storing merged file.

最新文章

  1. Linux的#和$区别
  2. ubuntu 16.04 U盘多媒体不自动弹出
  3. [原创]java WEB学习笔记62:Struts2学习之路--表单标签:form,表单标签的属性,textfield, password, hidden,submit ,textarea ,checkbox ,list, listKey 和 listValue 属性,select ,optiongroup ,checkboxlist
  4. install Matlab2016b on Ubuntu 14.04
  5. Box Anemometer
  6. OK335xS mac address hacking
  7. Android图像处理2
  8. 在MAC中安装Compass的方法 (转)
  9. Objective-c中的设计模式
  10. android开发
  11. 瑞柏匡丞:国内外App市场分析报告
  12. Node.js 小工具--supervisor
  13. Oracle 多表关联更新
  14. OSG实现场景漫游(转载)
  15. 在macOS上通过pyenv安装和切换多版本Python
  16. EF数据迁移,未将对象引用设置到对象实例
  17. Redis TTL命令
  18. javascript之页面打印
  19. ES6系列之变量声明let const
  20. (BST 递归) leetcode98. Validate Binary Search Tree

热门文章

  1. WSL2 网络异常排查 [ping 不通、网络地址异常、缺少默认路由、被宿主机防火墙拦截]
  2. Hyperledger fabric 续篇
  3. Demo of canvas, canvas optimization and svg
  4. 像MIUI一样做Zabbix二次开发(6)——应用场景和规划
  5. sap 付费支持 fico付费求助
  6. vvv,具名插槽
  7. spring mvc基本介绍
  8. R8051_simulation
  9. Day 22 22.2:scrapy部署
  10. js两个数组对象中,获取不相同的值 非交集元素对象