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
Flash 6.1.1 on your device. Enable Device Protection on it.
Upgrade to develop-6.x or 6.1.1 again -> It will work
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