-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[OTA] EFR32: Parse Matter OTA header, update documentation (#16120)
* Add header parsing logic to OTAImageProcessorImpl * Use a local variable for the buffer when parsing the header * Test added march 8 (#15957) * Added new manual scripts * Added Auto generated File * [OTA] Fix OTARequestorDriverImpl inclusion (#15981) * Regen to fix CI failures (#15990) * [ota] Store Default OTA Providers in flash (#15970) * [ota] Store Default OTA Providers in flash Store Default OTA Providers in flash each time the attribute is modified and load it back on the application startup. * Restyled by clang-format * Fix build and reduce flash usage Co-authored-by: Restyled.io <[email protected]> * Set periodic query timeout * Make OTAImageProcessorImpl::Apply() schedule work instead of running directly * Update error logs * Remove files that got out of synch with the upstream repo * Return after bootloader errors * Update OTA documentation for EFR32 * Fix spelling * Add OTA_PERIODIC_TIMEOUT to the lock-app build * Fix typo * Add OTA_periodic_query_timeout to EFR32 light-switch and window-app * Restyled by clang-format * Restyled by gn * Restyled by prettier-markdown * Fix typos * Update dictionary Co-authored-by: kowsisoundhar12 <[email protected]> Co-authored-by: Carol Yang <[email protected]> Co-authored-by: Boris Zbarsky <[email protected]> Co-authored-by: Damian Królik <[email protected]> Co-authored-by: Restyled.io <[email protected]>
- Loading branch information
Showing
14 changed files
with
226 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Matter Software Update with EFR32 example applications | ||
|
||
The Over The Air (OTA) Software Update functionality can be added to any of the | ||
EFR32 example applications by passing the `chip_enable_ota_requestor=true` | ||
option to the build script. This option is supposed to be enabled by default for | ||
all of the EFR32 example applications. | ||
|
||
## Running the OTA Download scenario | ||
|
||
- For Matter with OpenThread: Bring up the OpenThread Border Router as | ||
discussed in examples/lighting-app/efr32/README.md and get its operational | ||
dataset. | ||
|
||
- On a Linux or Darwin platform build the chip-tool and the ota-provider-app | ||
as follows: | ||
|
||
scripts/examples/gn_build_example.sh examples/chip-tool out/ | ||
scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug chip_config_network_layer_ble=false | ||
|
||
- Build or download the Gecko Bootloader binary. Bootloader should be built | ||
with the Gecko SDK version 3.2.1 or earlier, type "external SPI" configured | ||
with a single slot of at least 1000 KB. Pre-built binaries should be | ||
available in | ||
|
||
third_party/efr32_sdk/repo/platform/bootloader/sample-apps/bootloader-storage-spiflash-single | ||
|
||
- Using the commander tool upload the bootloader to the device running the | ||
application. | ||
|
||
- Create a bootable image file (using the Lighting application image as an | ||
example): | ||
|
||
commander gbl create chip-efr32-lighting-example.gbl --app chip-efr32-lighting-example.s37 | ||
|
||
- Create the Matter OTA file from the bootable image file: | ||
|
||
./src/app/ota_image_tool.py create -v 0xFFF1 -p 0x8005 -vn 1 -vs "1.0" -da sha256 chip-efr32-lighting-example.gbl chip-efr32-lighting-example.ota | ||
|
||
- In a terminal start the Provider app passing to it the path to the Matter | ||
OTA file created in the previous step: | ||
|
||
rm -r /tmp/chip_* | ||
./out/debug/chip-ota-provider-app -f chip-efr32-lighting-example.ota | ||
|
||
- In a separate terminal run the chip-tool commands to provision the Provider: | ||
|
||
./out/chip-tool pairing onnetwork 1 20202021 | ||
./out/chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": null, "targets": null}]' 1 0 | ||
|
||
- If the application device had been previously commissioned hold Button 0 for | ||
six seconds to factory-reset the device. | ||
|
||
- In the chip-tool terminal enter: | ||
|
||
./out/chip-tool pairing ble-thread 2 hex:<operationalDataset> 20202021 3840 | ||
|
||
where operationalDataset is obtained from the OpenThread Border Router. | ||
|
||
- Once the commissioning process completes enter: | ||
|
||
./out/chip-tool otasoftwareupdaterequestor announce-ota-provider 1 0 0 0 2 0 | ||
|
||
- The application device will connect to the Provider and start the image | ||
download. Once the image is downloaded the device will reboot into the | ||
downloaded image. | ||
|
||
## Managing the Software Version, Vendor and Product ID | ||
|
||
Starting the ota-provider-app with the --otaImageList command line option allows | ||
the user to supply a JSON file specifying the Software Version, Vendor and | ||
Product ID that identify the image served by the Provider, see | ||
[ota-provider-app](../../examples/ota-provider-app/linux/README.md) | ||
|
||
Example provider configuration file: | ||
|
||
``` | ||
{ "foo": 1, // ignored by parser | ||
"deviceSoftwareVersionModel": | ||
[ | ||
{ "vendorId": 65521, "productId": 32773, "softwareVersion": 1, "softwareVersionString": "1.0.0", "cDVersionNumber": 18, "softwareVersionValid": true, "minApplicableSoftwareVersion": 0, "maxApplicableSoftwareVersion": 100, "otaURL": "chip-efr32-lighting-example.ota" } | ||
] | ||
} | ||
``` | ||
|
||
In order for the Provider to successfully serve the image to a device during the | ||
OTA Software Update process the softwareVersion parameter in the Provider config | ||
file must be greater than the CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION | ||
parameter set in the application's CHIPProjectConfig.h file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,121 +1,6 @@ | ||
# CHIP EFR32 OTA Requestor Example | ||
For the description of Software Update process with EFR32 example applications | ||
see | ||
[EFR32 OTA Software Update](../../../docs/guides/silabs_efr32_software_update.md) | ||
|
||
An example showing the use of the Matter OTA Requestor functionality on the | ||
Silicon Labs EFR32 MG12. | ||
|
||
<a name="intro"></a> | ||
|
||
## Introduction | ||
|
||
The EFR32 OTA Requestor example provides a baseline demonstration the Matter OTA | ||
Requestor functionality built with the Silicon Labs gecko SDK. It can be | ||
controlled by a Chip controller over OpenThread network. | ||
|
||
<a name="building"></a> | ||
|
||
## Building | ||
|
||
For initial setup steps please see the CHIP EFR32 Lighting Example README at | ||
examples/lighting-app/efr32/README.md | ||
|
||
- Supported hardware: | ||
|
||
MG12 boards: | ||
|
||
- BRD4161A / SLWSTK6000B / Wireless Starter Kit / 2.4GHz@19dBm | ||
- BRD4164A / SLWSTK6000B / Wireless Starter Kit / 2.4GHz@19dBm | ||
- BRD4166A / SLTB004A / Thunderboard Sense 2 / 2.4GHz@10dBm | ||
- BRD4170A / SLWSTK6000B / Multiband Wireless Starter Kit / 2.4GHz@19dBm, | ||
915MHz@19dBm | ||
- BRD4304A / SLWSTK6000B / MGM12P Module / 2.4GHz@19dBm | ||
|
||
MG21 boards: Currently not supported due to RAM limitation. | ||
|
||
- BRD4180A / SLWSTK6006A / Wireless Starter Kit / 2.4GHz@20dBm | ||
|
||
MG24 boards : | ||
|
||
- BRD4186A / SLWSTK6006A / Wireless Starter Kit / 2.4GHz@10dBm | ||
- BRD4187A / SLWSTK6006A / Wireless Starter Kit / 2.4GHz@20dBm | ||
|
||
* Build the example application: | ||
|
||
cd ~/connectedhomeip | ||
./scripts/examples/gn_efr32_example.sh ./examples/ota-requestor-app/efr32/ ./out/ota-requestor-app BRD4161A | ||
|
||
- To delete generated executable, libraries and object files use: | ||
|
||
$ cd ~/connectedhomeip | ||
$ rm -rf ./out/ | ||
|
||
<a name="Flashing the Application"></a> | ||
|
||
## Flashing the Application | ||
|
||
- On the command line: | ||
|
||
$ cd ~/connectedhomeip/out/ota-requestor-app/BRD4161A | ||
$ python3 chip-efr32-ota-requestor-example.flash.py | ||
|
||
- Or with the Ozone debugger, just load the .out file. | ||
|
||
<a name="view-logging"></a> | ||
|
||
## Viewing Logging Output | ||
|
||
See `examples/lighting-app/efr32/README.md` | ||
|
||
<a name="Running the OTA Download scenario"></a> | ||
|
||
## Running the OTA Download scenario | ||
|
||
- Bring up the OpenThread Border Router as discussed in | ||
examples/lighting-app/efr32/README.md and get its operational dataset. | ||
|
||
- On a Linux or Darwin platform build the chip-tool and the ota-provider-app | ||
as follows: | ||
|
||
scripts/examples/gn_build_example.sh examples/chip-tool out/ | ||
scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug chip_config_network_layer_ble=false | ||
|
||
- Build or download the Gecko Bootloader binary. Bootloader should be built | ||
with the Gecko SDK version 3.2.1 or earlier, type "external SPI" configured | ||
with a single slot of at least 1000 KB. Pre-built binaries should be | ||
available in | ||
|
||
third_party/efr32_sdk/repo/platform/bootloader/sample-apps/bootloader-storage-spiflash-single | ||
|
||
- Using the commander tool upload the bootloader to the device running the | ||
requestor application. | ||
|
||
- Create a bootable image file: | ||
|
||
commander gbl create chip-efr32-ota-requestor-example.gbl --app chip-efr32-ota-requestor-example.s37 | ||
|
||
- In a terminal start the provider app passing to it the path to the bootable | ||
image file created in the previous step: | ||
|
||
rm -r /tmp/chip_* | ||
./out/debug/chip-ota-provider-app -f chip-efr32-ota-requestor-example.gbl | ||
|
||
- In a separate terminal run the chip-tool commands to provision the Provider: | ||
|
||
./out/chip-tool pairing onnetwork 1 20202021 | ||
./out/chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": null, "targets": null}]' 1 0 | ||
|
||
- If the Requestor had been previously commissioned hold Button 0 for six | ||
seconds to factory-reset the device. | ||
|
||
- In the chip-tool terminal enter: | ||
|
||
./out/chip-tool pairing ble-thread 2 hex:<operationalDataset> 20202021 3840 | ||
|
||
where operationalDataset is obtained from the OpenThread Border Router. | ||
|
||
- Once the commissioning process completes enter: | ||
|
||
./out/chip-tool otasoftwareupdaterequestor announce-ota-provider 1 0 0 0 2 0 | ||
|
||
- The Requestor will connect to the Provider and start the image download. | ||
Once the image is downloaded the Requestor will reboot into the downloaded | ||
image. | ||
The EFR32 ota-requestor-app example app has been deprecated. The OTA Software | ||
Update functionality can be used in any EFR32 example application. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.