Handle multi-step flashing on Protected Devices #766
Merged
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.
Description
This is only applicable for device-os 6.1.1 and lower.
The flashing operation is a multi-step process where each step obtains the device handle, sets the device to the appropriate mode (normal or DFU) based on the binary type, and then flashes the binary onto the device.
Currently, a generic wrapper is used to manage Protected Devices, placing the device in Service Mode only once at the beginning of the flashing process. However, this approach has a limitation: the devices on 6.1.0 and 6.0.0 exit Service Mode and return to a Protected state after flashing the bootloader. You could think of starting in DFU mode, but these device-os versions don't work well on Protected Devices in DFU mode.
The PR throws a downgrade error on Protected Devices if downgrading device-os from 6.1.1 to either 6.1.0 or 6.0.0.
One alternative to downgrade is to convert the Protected Device to Open Device via cloud, and then downgrade via CLI.
How to Test
Related Issues / Discussions
Completeness