Currently, particle flash --local command flashes all the assets that are provided by the Particle project or the user app bundle. This PR skips flashing an asset which is already existing on the device. The reason for this change is to improve flashing times, which can be especially beneficial for large projects or when working with devices that have a significant amount of existing assets.
This PR only makes changes to the particle flash --local command and others are unchanged.
Create a Particle project with a single asset (say, assetA)
Create a bundle using particle bundle myApp.bin --assets /path/to/assets
Flash it using particle flash --local myApp.zip. Watch the progress
Verify that myApp.bin and assetA are flashed
Add an additional asset to this Particle project (say, assetB)
Create a new bundle using particle bundle myApp.bin --assets /path/to/assets
Flash it using particle flash --local myApp.zip. Watch the progress
Verify that myApp.bin and assetB are flashed. assetA will be skipped with a log message saying Skipping asset assetA because it is already on the device
Flashing p2 0a10aced202194944a02c4d4
Skipping asset random.txt because it is already on the device
[█████████████████████████] 100% | Flashing random2.txt
Flash success!
Description
Currently,
particle flash --local
command flashes all the assets that are provided by the Particle project or the user app bundle. This PR skips flashing an asset which is already existing on the device. The reason for this change is to improve flashing times, which can be especially beneficial for large projects or when working with devices that have a significant amount of existing assets.This PR only makes changes to the
particle flash --local
command and others are unchanged.How to Test
Setup:
particle-usb
to this branch: https://github.com/particle-iot/particle-usb/pull/96device-os
this branch on the device: https://github.com/particle-iot/device-os/pull/2711Test:
particle bundle myApp.bin --assets /path/to/assets
particle flash --local myApp.zip
. Watch the progressmyApp.bin
andassetA
are flashedparticle bundle myApp.bin --assets /path/to/assets
particle flash --local myApp.zip
. Watch the progressmyApp.bin
andassetB
are flashed.assetA
will be skipped with a log message sayingSkipping asset assetA because it is already on the device
Related Issues / Discussions
SC: https://app.shortcut.com/particle/story/123873/flash-asset-only-if-it-s-not-existing-on-the-device Protobuf PR: https://github.com/particle-iot/device-os-protobuf/pull/22 Particle USB PR: https://github.com/particle-iot/particle-usb/pull/96 Device OS PR: https://github.com/particle-iot/device-os/pull/2711
Completeness