Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Adding support for pushing cache images for SUIT updates #190

Merged
merged 15 commits into from
Oct 8, 2024

Conversation

philips77
Copy link
Member

This PR adds a new feature to DFU updates using SUIT bootloader.

SUIT

In general, a SUIT (Software Update for Internet of Things) allows a .suit file (an Envelope) to contain multiple firmware images or fetch them from different locations given with a URI. #160 added support for polling additional images from the phone. In some cases, a device with SUIT bootloader requires all images to be present before the update is started (e.g. to decrease required memory). For that, nRF Connect SDK 2.8 added support for raw cache images. This PR is adding support for this feature in the Android library.

Changes:

  1. SUIT group extended by 2 commands:
    1. Upload raw cache image - uploads a cache image with a target_id parameter
    2. Clean up - erases all images that were sent to the device before
  2. A new parameter added to Upload Envelope command: defer_install. When false (default) the update will start immediately after uploading the .suit file (SUIT Envelope). When true, the device will wait for cache images and another call of Upload Envelope, this time with len=0, off=0, defer_install=false, which will initiate processing the Envelope.

Note

This change should not break backward compatibility with previous devices with SUIT group, which don't support defering installation nor cache images.

Image manager

Additionally, for slome purposes, like device recovery, it is possible for a device to support SUIT update, but with Image manager instead of SUIT manager. The implementation will fall back to Image manager if a command sent to SUIT group will return an error, e.g. NOT SUPPORTED.

For that case, the Firmware Update Manager using Image manager was also modified:

  1. Allowing to add cache images to ImageSet.
  2. Uploading cache images after the Envelope.
  3. Sending confirm command with confirm=true parameter, but without hash to begin the update. Note, that the reply to this command does not contain image details, like it does in MCUboot variant. The device reboots immediately after receiving a confirm command (it may validate the Envelope before doing so).

Changes in the sample app

  1. Added support for ZIP files containing SUIT update with cache images.
  2. Option to send ANY file using Image tab / Advanced / Firmware Upload - as cache images aren't signed
  3. Option to call Erase on Image tab / Advanced / Images section after reading the images details
  4. Option to send Confirm command on Image tab / Advanced / Images section.

It is possible to:

  1. Update a device with cache images using SUIT group
  2. Fallback to Image group to update a device when SUIT group is not supported
  3. Manually upload .suit envelope and cache images in Advanced view
  4. Manually confirm update (begin update after uploading required files
  5. Manually clean up the device (Clean up command from SUIT group)

@philips77 philips77 merged commit aca6764 into main Oct 8, 2024
1 check passed
@philips77 philips77 deleted the feature/suit-push branch October 8, 2024 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant