使用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.

使用python制作nRF52832升级包和合成烧录文件的经验(nRF52832 DFU经验分享)的更多相关文章

  1. 使用python制作ArcGIS插件(5)其他技巧

    使用python制作ArcGIS插件(5)其他技巧 by 李远祥 使用python做插件开发,除了了解ArcToolBox工具之外,还需要在了解ArcPy的相关函数和接口.只有掌握了这些,才可以顺利的 ...

  2. 使用python制作ArcGIS插件(4)界面交互

    使用python制作ArcGIS插件(4)界面交互 by 李远祥 插件界面部分,除了一开始在设计器中设计的这些界面元素之外,还可以与操作系统进行一些输入输出的交互,这部分的实现全部在pythonadd ...

  3. 使用python制作ArcGIS插件(3)ArcPy的使用说明

    使用python制作ArcGIS插件(3)ArcPy的使用说明 by 李远祥 ArcPy 是一个以成功的 arcgisscripting 模块为基础并继承了 arcgisscripting 功能进而构 ...

  4. 使用python制作ArcGIS插件(2)代码编写

    使用python制作ArcGIS插件(2)代码编写 by 李远祥 上一章节已经介绍了如何去搭建AddIn的界面,接下来要实现具体的功能,则到了具体的编程环节.由于使用的是python语言进行编程,则开 ...

  5. 使用python制作ArcGIS插件(1)工具介绍

    使用python制作ArcGIS插件(1)工具介绍 by 李远祥 ArcGIS从10.0开始支持addin(ArcGIS软件中又叫作加载项)的方式进行插件制作.相对于以往9.x系列,addin的无论是 ...

  6. python制作pdf电子书

    python制作pdf电子书 准备 制作电子书使用的是python的pdfkit这个库,pdfkit是 wkhtmltopdf 的Python封装包,因此在安装这个之前要安装wkhtmltopdf 安 ...

  7. 制作OTA升级包

    OTA 软件包工具 本文地址http://wossoneri.github.io/2018/09/21/%5BAndroid%5D%5BFramework%5Dcreate-ota-update-zi ...

  8. 使用python制作时间戳转换工具

    使用python制作时间戳转换工具 python 时间戳转日期 日期转时间戳 前言:作为一个程序员一般情况下,json和时间戳是常用的两个工具,我咨询过很多个朋友,他们一般都是通过在线工具对json进 ...

  9. python制作exe可执行文件的方法---使用pyinstaller

    python制作exe可执行文件的方法---使用pyinstaller   python生成windows下exe格式的可执行程序有三种可选方案: py2exe是大家所熟知的,今天要介绍pyinsta ...

  10. Hbuider制作app升级包的简单办法 (升级官方提供的案例)

    源文档:http://ask.dcloud.net.cn/question/11795 http://ask.dcloud.net.cn/article/199 一.生成移动App资源升级包 5+应用 ...

随机推荐

  1. 将freeswitch加入CentOS7的systemctl

    cd /usr/local/src/freeswitch/build cp freeswitch.service /usr/lib/systemd/system/ cp freeswitch.sysc ...

  2. win7下virtualbox虚拟机中安装centos后设置共享文件夹

    报错信息: building the main Guest Additions module FAILEDunable to find the sources of your current Linu ...

  3. c++ 继承访问控制初步

    访问控制方式这里有篇很好的文章,其实内容也是总结c++primer上的内容 现在就按照这篇的文章举例进行学习. 思路 不同继承方式的影响主要体现在: 1.派生类成员对基类成员的访问控制. 2.派生类对 ...

  4. ArrayList集合的方法

    ArrayList元素的增加.插入.删除.清空.排序.反转 using System; using System.Collections; using System.Collections.Gener ...

  5. java乱码处理

    package com.zhouhe.util; import java.io.UnsupportedEncodingException; /** * 自定义工具类 * @Author zhouhe ...

  6. Docker info 查看报错 WARNING: No swap limit support 解决

    docker可以通过启动命令来限制容器可以使用的最大物理内存和swap,但是通常在使用这些命令的时候经常会碰到"WARNING: No swap limit support"警告 ...

  7. 学习lua-01,遍历集合,多入参循环处理,类型判断,数字运算

    --function maxnum(tab1) -- local b = 1 -- local a = tab1[b] -- for i, v in ipairs(tab1) do -- if v & ...

  8. mySql查询-系统公告发布接收人情况

    -- display_name NZ分部所有用户SELECT user_code,display_name FROM scy_user WHERE ou_id=1627 AND is_deleted= ...

  9. gdb 脚本 简单理解

    1. gdb 脚本的语法简介: 摘录博客:https://blog.csdn.net/hejinjing_tom_com/article/details/50350865 1]   # 为脚本注释命令 ...

  10. Vue3 + echarts 统一封装

    1. 新建 echartsLib.js 文件,统一导入需要的组件 import * as echarts from "echarts/core"; import { SVGRend ...