Skip to content
This repository was archived by the owner on Jan 17, 2023. It is now read-only.

Commit 804bc0f

Browse files
authored
Merge pull request #389 from NordicSemiconductor/fix/jira-issue-NCP-3900
Revert PR 349
2 parents f4a51ac + 0dcb578 commit 804bc0f

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

nordicsemi/dfu/package.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,6 @@ def __init__(self,
176176

177177
self.firmwares_data = {}
178178

179-
if sd_req is not None:
180-
init_packet_vars[PacketField.REQUIRED_SOFTDEVICES_ARRAY] = sd_req
181179

182180
if app_fw:
183181
firmware_type = HexType.EXTERNAL_APPLICATION if is_external else HexType.APPLICATION
@@ -187,6 +185,26 @@ def __init__(self,
187185
boot_validation_type=app_boot_validation_type,
188186
init_packet_data=init_packet_vars)
189187

188+
# WARNING
189+
# Do not move the setting of the `REQUIRED_SOFTDEVICES_ARRAY`
190+
# field to be `sd_req` to before the `self__.add_firmware_info` call
191+
# for HexType.EXTERNAL_APPLICATION.
192+
#
193+
# When doing a dfu update, the sd_req, specifies that whatever is being
194+
# updated requires some version of the softdevice. In the case when
195+
# somebody does a an update with both an application and a softdevice,
196+
# both sd_req and sd_id are used at the same time. Moving assignment up
197+
# will cause the versions accepted for the softdevice to also be
198+
# accepted for the application, which can lead to invalid updates. If
199+
# the value 0x00 is provided, it can also lead to the softdevice being
200+
# deleted.
201+
#
202+
# Moving was tried https://github.com/NordicSemiconductor/pc-nrfutil/pull/349, but a
203+
# stable solution is currently favored over one solving this particular
204+
# issue. Any changes will have to be sufficiently tested to enusre a
205+
# similar bug has not been introduced.
206+
if sd_req is not None:
207+
init_packet_vars[PacketField.REQUIRED_SOFTDEVICES_ARRAY] = sd_req
190208

191209
if bootloader_fw:
192210
self.__add_firmware_info(firmware_type=HexType.BOOTLOADER,

nordicsemi/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@
3737

3838
""" Version definition for nrfutil. """
3939

40-
NRFUTIL_VERSION = "6.1.6"
40+
NRFUTIL_VERSION = "6.1.7"

0 commit comments

Comments
 (0)