This repository has been archived by the owner on Jan 17, 2023. It is now read-only.
Add Zigbee DFU image support #161
Merged
bihanssen
merged 7 commits into
NordicSemiconductor:master
from
tomchy:feature/zigbee_dfu_image
Sep 21, 2018
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
535851e
Add Zigbee DFU image support
tomchy 287038b
Remove additional commas inside README.md
tomchy 5151c68
BUGFIX: open binary file in a binary mode
tomchy f9cec1e
Update DFU settings backup page together with DFU settings
tomchy 3bcc766
Add setting for DFU settings backup page placement
tomchy 8163c4b
Extend unit tests by backup page checks
tomchy 1348f91
Add a warning about overwriting nRF DFU settings backup page
tomchy File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ This application and its library offer the following features: | |
* Bootloader DFU settings generation and display | ||
* Device Firmware Update procedure over Bluetooth Low Energy | ||
* Device Firmware Update procedure over Thread | ||
* Device Firmware Update procedure over Zigbee | ||
|
||
## License | ||
|
||
|
@@ -44,7 +45,7 @@ This will also retrieve and install all additional required packages. | |
|
||
**Note**: When installing on macOS, you may need to add ` --ignore-installed six` when running pip. See [issue #79](https://github.com/NordicSemiconductor/pc-nrfutil/issues/79). | ||
|
||
**Note**: To use the `dfu ble` or `dfu thread` option you will need to set up your boards to be able to communicate with your computer. You can find additional information here: [Hardware setup](https://github.com/NordicSemiconductor/pc-ble-driver/blob/master/Installation.md#hardware-setup). | ||
**Note**: To use the `dfu ble`, `dfu thread`, or `dfu zigbee` option you will need to set up your boards to be able to communicate with your computer. You can find additional information here: [Hardware setup](https://github.com/NordicSemiconductor/pc-ble-driver/blob/master/Installation.md#hardware-setup). | ||
|
||
## Downloading precompiled Windows executable | ||
|
||
|
@@ -102,7 +103,7 @@ pyinstaller /full/path/to/nrfutil.spec | |
|
||
**Note**: Please refer to the [pc-ble-driver-py PyPI installation note on Windows](https://github.com/NordicSemiconductor/pc-ble-driver-py#installing-from-pypi) if you are running nrfutil on this operating system. | ||
|
||
**Note**: To use the `dfu ble` or `dfu thread` option you will need to set up your boards to be able to communicate with your computer. You can find additional information here: [Hardware setup](https://github.com/NordicSemiconductor/pc-ble-driver/blob/master/Installation.md#hardware-setup). | ||
**Note**: To use the `dfu ble`, `dfu thread`, or `dfu zigbee` option you will need to set up your boards to be able to communicate with your computer. You can find additional information here: [Hardware setup](https://github.com/NordicSemiconductor/pc-ble-driver/blob/master/Installation.md#hardware-setup). | ||
|
||
## Usage | ||
|
||
|
@@ -157,7 +158,7 @@ SoftDevice | FWID (sd-req) | |
`s140_nrf52_6.0.0` | 0xA9 | ||
`s140_nrf52_6.1.0` | 0xAE | ||
|
||
**Note**: The Thread stack doesn't use a SoftDevice but --sd-req option is required for compatibility reasons. You can provide any value for the option as it is ignored during DFU. | ||
**Note**: The Thread, and Zigbee stacks don't use a SoftDevice but --sd-req option is required for compatibility reasons. You can provide any value for the option as it is ignored during DFU. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comma: /The Thread, and Zigbee stacks/The Thread and Zigbee stacks/ |
||
|
||
Not all combinations of Bootloader, SoftDevice and Application are possible when generating a package. The table below summarizes the support for different combinations. | ||
|
||
|
@@ -183,6 +184,12 @@ SD + APP | Yes | **See notes 1 and 2 below** | |
was added in nrfutil 3.1.0 and is required since 3.2.0 in case the package should contain SD (+ BL) + APP. Also, since version 3.2.0 the new ID is copied to `--sd-req` list so that | ||
in case of a link loss during APP update the DFU process can be restarted. In that case the new SD would overwrite itself, so `--sd-req` must contain also the ID of the new SD. | ||
|
||
The boolean option '--zigbee' enables the generation of Zigbee update file in addition to the zip package. The following example demostrates the generation of such update file: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo: /demostrates/demonstrates/ |
||
``` | ||
nrfutil pkg generate --hw-version 52 --sd-req 0 --application-version 0x01020101 --application nrf52840_xxaa.hex --key-file ../priv.pem app_dfu_package.zip --zigbee True --manufacturer-id 0xCAFE --image-type 0x1234 --comment good_image | ||
``` | ||
**Note 3:** The generated Zigbee update file is named according to the recomendation of the Zigbee Specification ([Zigbee Cluster Library Specification 11.5 - Zigbee Document 07-5123-06](http://www.zigbee.org/~zigbeeor/wp-content/uploads/2014/10/07-5123-06-zigbee-cluster-library-specification.pdf)), so the user doesn't provide the name of the Update file. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo: /recomendation/recommendation/ |
||
|
||
##### display | ||
Use this option to display the contents of a DFU package in a .zip file. | ||
``` | ||
|
@@ -218,7 +225,19 @@ nrfutil dfu ble -pkg app_dfu_package.zip -p COM3 -f | |
``` | ||
The `-f` option instructs nrfutil to actually program the board connected to COM3 with the connectivity software required to operate as a network co-processor (NCP). Use with caution as this will overwrite the contents of the IC's flash memory. | ||
|
||
##### serial | ||
##### Zigbee | ||
**Note**: DFU over Zigbee OTA is experimental | ||
|
||
Perform a full DFU procedure over Zigbee network using ZCL OTA Upgrade Cluster. This command takes several options that you can list using: | ||
``` | ||
nrfutil dfu zigbee --help | ||
``` | ||
Below is an example of the execution of a DFU procedure using a file generated above using a OTA Upgrade server deployed on a DK with a OTA Upgrade Server operating on the 802.15.4 channel. | ||
``` | ||
nrfutil dfu zigbee -f CAFE-1234-good_image.zigbee -snr 683604699 -chan 20 | ||
``` | ||
|
||
##### Serial | ||
|
||
Perform a full DFU procedure over a UART serial line. The DFU target shall be configured to use some of its digital I/O pins as UART. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,4 +37,4 @@ | |
|
||
""" Version definition for nrfutil. """ | ||
|
||
NRFUTIL_VERSION = "3.5.1" | ||
NRFUTIL_VERSION = "3.6.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# | ||
# Copyright (c) 2018 Nordic Semiconductor ASA | ||
# All rights reserved. | ||
# | ||
# Redistribution and use in source and binary forms, with or without modification, | ||
# are permitted provided that the following conditions are met: | ||
# | ||
# 1. Redistributions of source code must retain the above copyright notice, this | ||
# list of conditions and the following disclaimer. | ||
# | ||
# 2. Redistributions in binary form must reproduce the above copyright notice, this | ||
# list of conditions and the following disclaimer in the documentation and/or | ||
# other materials provided with the distribution. | ||
# | ||
# 3. Neither the name of Nordic Semiconductor ASA nor the names of other | ||
# contributors to this software may be used to endorse or promote products | ||
# derived from this software without specific prior written permission. | ||
# | ||
# 4. This software must only be used in or with a processor manufactured by Nordic | ||
# Semiconductor ASA, or in or with a processor manufactured by a third party that | ||
# is used in combination with a processor manufactured by Nordic Semiconductor. | ||
# | ||
# 5. Any software provided in binary or object form under this license must not be | ||
# reverse engineered, decompiled, modified and/or disassembled. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR | ||
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
# | ||
|
||
"""Package with Zigbee OTA file functionality.""" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammar: I believe the last comma should be left out: /
dfu thread
, ordfu zigbee
/dfu thread
ordfu zigbee
/Same on line 106.