Skip to content

Commit 6cdf81d

Browse files
committed
scripts: hid_configurator: remove SUIT support
Removed the SUIT support from the HID configurator script due to the general migration to the IronSide SE solution for the nRF54H20 platform. As part of the IronSide SE transition, the DFU solution based on the SUIT has been first deprecated and then removed from the nRF Connect SDK. This change aligns the script with the remaining parts of the nRF Connect SDK. The nRF Desktop application now supports the MCUboot-based DFU for the nRF54H20 DK target. Ref: NCSDK-34151 Signed-off-by: Kamil Piszczek <[email protected]>
1 parent ace125c commit 6cdf81d

File tree

1 file changed

+0
-59
lines changed
  • scripts/hid_configurator/modules

1 file changed

+0
-59
lines changed

scripts/hid_configurator/modules/dfu.py

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,6 @@
1717
from NrfHidDevice import EVENT_DATA_LEN_MAX
1818
import imgtool.image
1919

20-
try:
21-
from suit_generator.envelope import SuitEnvelope
22-
except ImportError as e:
23-
print('Exception when importing SUIT generator:{}'.format(e))
24-
print('The SUIT generator Python package is necassary to handle device with SUIT')
25-
print('The SUIT generator can be installed from ncs/modules/lib/suit-generator')
26-
2720
DFU_SYNC_INTERVAL = 1
2821

2922
class DFUInfo:
@@ -304,8 +297,6 @@ def __init__(self, dfu_package, dev_fwinfo, dev_board_name, dev_bootloader_varia
304297
if zipfile.is_zipfile(dfu_package):
305298
self._initialize_from_zip_file(dfu_package, dev_fwinfo, dev_board_name,
306299
dev_bootloader_variant)
307-
elif dfu_package.endswith('.suit'):
308-
self._initialize_from_suit_file(dfu_package, dev_fwinfo)
309300
else:
310301
print('Invalid DFU package format')
311302
return
@@ -334,56 +325,6 @@ def _initialize_from_zip_file(self, dfu_package, dev_fwinfo, dev_board_name,
334325
except Exception:
335326
print("Parsing zip file failed")
336327

337-
def _initialize_from_suit_file(self, dfu_package, dev_fwinfo):
338-
try:
339-
envelope = SuitEnvelope()
340-
envelope.load(dfu_package)
341-
sequence_number = envelope.sequence_number
342-
except Exception as e:
343-
print("Exception during retrieving manifest sequence number")
344-
print(e)
345-
return
346-
347-
if not isinstance(sequence_number, int):
348-
print("Invalid sequence number type. \
349-
Is of type: {} and should be: int".format(type(sequence_number)))
350-
return
351-
352-
if not hasattr(envelope, 'current_version'):
353-
print("The current_version field is not found in the SuitEnvelope class. \
354-
Upgrade suit-generator package to the newer version")
355-
return
356-
357-
current_version = envelope.current_version
358-
if current_version is not None and not isinstance(current_version, list):
359-
print("Invalid current_version type. \
360-
Is of type: {} and should be: list or None".format(type(current_version)))
361-
return
362-
363-
booted_fw_version = dev_fwinfo.get_fw_version()
364-
assert len(booted_fw_version) == 4
365-
if booted_fw_version[:3] == (0, 0, 0):
366-
# Semantic versioning is not supported in the booted firmware:
367-
# fallback to sequence number versioning
368-
image_bin_version = (0, 0, 0, sequence_number)
369-
else:
370-
if current_version is None:
371-
print("The semantic version is not defined in the SUIT envelope. \
372-
Generate the SUIT package with the semantic version")
373-
return
374-
375-
# It is assumed that the version list uses the following order of elements:
376-
# (major, minor, patch, type, pre_release_number)
377-
# Field names are documented in the suit_version_t structure from:
378-
# nrf/subsys/suit/metadata/include/suit_metadata.h
379-
assert len(current_version) >= 3
380-
major, minor, patch = current_version[:3]
381-
image_bin_version = (major, minor, patch, sequence_number)
382-
383-
self.image_bin_path = dfu_package
384-
self.bootloader_variant = "SUIT"
385-
self.image_bin_version = image_bin_version
386-
387328
@staticmethod
388329
def _is_dfu_file_correct(dfu_bin):
389330
if dfu_bin is None:

0 commit comments

Comments
 (0)