当前位置:网站首页>[Nordic] nrf52810 OTA upgrade (II) – how to use DFU
[Nordic] nrf52810 OTA upgrade (II) – how to use DFU
2022-07-22 18:39:00 【ZHONGCAI0901】
List of articles
Related articles
1.《【Nordic】nRF52810 OTA upgrade ( One )–DFU Environment building 》
2.《【Nordic】nRF52810 OTA upgrade ( Two )–DFU How to use 》
3.《【Nordic】nRF52810 OTA upgrade ( 3、 ... and )–DFU The theoretical analysis 》
1. Preface
This article is based on 《【Nordic】nRF52810 OTA upgrade ( One )–DFU Environment building 》 On the basis of , To achieve DFU OTA Upgrade firmware functions .
2. Generate micro_ecc_lib_nrf52.lib library
Nordic In the use of DFU Conduct OTA Upgrade will use ECC Verify the certified firmware , So in DFU The project needs to produce micro_ecc_lib_nrf52.lib
.
Download the last article
micro-ecc-master
Copy the source code to SDK In the catalogexternal\micro-ecc
in , And rename tomicro-ecc
open Cygwin Command line
cd To micro-ecc Project directory :
nRF5_SDK_17.0.2_d674dde\external\micro-ecc\nrf52nf_keil\armgcc
perform
make
command
Because I didn't find it here gcc An error is reported in the tool , Modify file :nRF5_SDK_17.0.2_d674dde\components\toolchain\gcc\Makefile.windows
takeGNU_INSTALL_ROOT := C:/Program Files (x86)/GNU Tools ARM Embedded/9 2019-q4-major/bin/ GNU_VERSION := 9.2.1 GNU_PREFIX := arm-none-eabi
It is amended as follows gcc Actual installation directory :
GNU_INSTALL_ROOT := D:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2020-q4-major/bin/ GNU_VERSION := 10.2.1 GNU_PREFIX := arm-none-eabi
Re execution
make
, Compile successfully .
3. Generate dfu_public_key.c And add
- Generate private key
stay D Create a new folder on disk , Name it key, stay cmd Enter the following in the command :nrfutil keys generate D:\key\private.key
Instructions , Generate private key file private.keyBe careful : To save the private key private.key, Every new firmware upgrade in the future , You must sign through this private key first , Once lost ,DFU Will not be able to
- Generate public key
Enter the generate public key instruction :nrfutil keys display --key pk --format code D:\key\private.key --out_file public_key.c
Produce public keys on the desktop public_key.c - Add the public key to the project
Public key public_key.c Renamed as dfu_public_key.c, And replace the directory with this filenRF5_SDK_17.0.2_d674dde\examples\dfu
Under the dfu_public_key.c
4. compile bootloader
Because I use here nRF52810 platform , So choose dfu bootloader Path as follows :nRF5_SDK_17.0.2_d674dde\examples\dfu\secure_bootloader\pca10040e_s112_ble\arm5_no_packs
Compile successfully :
5. burn bootloader and SoftDevice hex file
Use jlink burn bootloader
and SoftDevice
:
- burn bootloader
nRF5_SDK_17.0.2_d674dde\examples\dfu\secure_bootloader\pca10040e_s112_ble\arm5_no_packs\_build\nrf52810_xxaa_s112.hex
- burn SoftDevice
nRF5_SDK_17.0.2_d674dde\components\softdevice\s112\hex\s112_nrf52_7.2.0_softdevice.hex
After burning , Installed by mobile phone nRF Connect
APP Search for BLE, appear DfuTarg It means that we have entered bootloader Pattern . Because there is no burning application hex, So I entered directly bootloader Pattern .
6.nRF Connect APP Conduct OTA upgrade
upgrade application The firmware of is the firmware compiled by the previous project :nRF5_SDK_17.0.2_d674dde\examples\ble_peripheral\ble_app_uart\pca10040e\s112\arm5_no_packs\_build
Make OTA Upgrade package
nrfutil pkg generate --hw-version 52 --application-version 1 --application nrf52810_xxaa.hex --sd-req 0x0103 --key-file D:\key\private.key dfufile.zip
take OTA Upgrade package
dfufile.zip
Copy to cell phoneConnect BLE DfuTarg
Click on the DFU Small icons , choice ZIP file
dfufile.zip
Upgrading …
Upgrade success , appear application ble The name of Nordic_UART, Here's the picture :
7. Errors occurred
error 1
..\..\..\..\..\components\libraries\crypto\backend\micro_ecc\micro_ecc_backend_ecc.h(52): error: #5: cannot open source input file "uECC.h": No such file or directory #include "uECC.h" ..\..\..\..\..\components\libraries\bootloader\dfu\nrf_dfu_validation.c: 0 warnings, 1 error
error analysis :
Prompt not founduECC.h
The header file
terms of settlement :
Reference resources 2. Generate micro_ecc_lib_nrf52.lib library We can solve this problem .error 2
compiling dfu_public_key.c... ..\..\..\dfu_public_key.c(20): error: #35: #error directive: "Debug public key not valid for production. Please see https://github.com/NordicSemiconductor/pc-nrfutil/blob/master/README.md to generate it" #error "Debug public key not valid for production. Please see https://github.com/NordicSemiconductor/pc-nrfutil/blob/master/README.md to generate it" ..\..\..\dfu_public_key.c: 0 warnings, 1 error
error analysis :
There is no effective dfu Encrypt public key
terms of settlement :
Reference resources 3. Generate dfu_public_key.c And add We can solve this problem .
边栏推荐
- Lesson 12 MySQL high availability component MHA
- glibc 源码分析
- 【STM32】STM32 SDIO SD卡读写测试(一)-- SD卡硬件设计和软件移植
- 折腾凤凰系统 (by quqi99)
- 堡垒机,DMZ区
- Computer network learning notes 7-tcp programming process and interview questions
- 力扣解法汇总241-为运算表达式设计优先级
- Four methods of initializing C language structure
- Internet download manager2022 intelligent win latest version Downloader
- Fabric. JS centered element
猜你喜欢
主动降噪耳机排行榜10强,主动降噪耳机十大品牌
uniapp 微信小程序地图,在高德app、腾讯app、百度app、苹果地图app 中打开
ip,子网掩码,网关,IPS与IDS
MySQL优化之强制索引的使用
PHP实现删除一维数组中某一个值
Fabric. JS control element level
this指向问题
Is it really necessary to define VO, Bo, Po, do, dto?
2. Raspberry pie system backup
Laravel 解决【1045】Access denied for user ‘homestead‘@‘localhost‘ (usin g password: YES)
随机推荐
Js高级-函数的理解
Using pypyodbc in Ubuntu cannot connect to SQL Server
主动降噪耳机排行榜10强,主动降噪耳机十大品牌
DOM添加
ip,子网掩码,网关,IPS与IDS
【SDIO】SD2.0协议分析总结(一)-- SD卡基本概率介绍
力扣解法汇总558- 四叉树交集
MySQL实现从其他表查询数据并插入另外一张表
sshfs + autofs + sshpass (by quqi99)
Fabric. JS control element level
腾讯持久化框架MMKV原理探究
微信小程序本地访问本地TP5的路由接口正常,为何在手机上扫码预览获取不到数据?
Go 管道模式的实际例子——计算一系列文件的 md5 值
uniapp 微信小程序地图,在高德app、腾讯app、百度app、苹果地图app 中打开
Laravel 解决【1045】Access denied for user ‘homestead‘@‘localhost‘ (usin g password: YES)
Interview experience of Android Internet manufacturers
double类型不能进行精确计算的问题
MySQL修改密码不成功(无效)的解决办法
2.树莓派系统备份
【Nordic】nRF52810 OTA升级(二)–DFU如何使用