Matter OTA For 917 SOC#
The scope of this page describes the MATTER OTA upgrade on 917 SoC mode for combined image(TA+M4) as well as single M4 and TA image upgrade.
Hardware Requirements#
To run matter ota on Silicon Labs Platform, refer to Hardware Requirements.
Software Requirements#
To run matter ota on Silicon Labs Platform, refer to Software Requirements.
Setting up OTA Environment#
To run OTA on Matter over Wi-Fi, Need to build two different application below:
OTA-A is a normal application with default or older software version. It acts as ota-requestor where it needs to update latest software version.
OTA-B is a normal application with updated software version.
Chip-tool is a controller for sending commands to ota-requestor to update the software version and receving commands from device.
OTA-Provider is the server who has the latest software version and from which ota-requestor will download the updated software.
Building OTA Application Using Simplicity Studio For 917 SOC#
To create and build Matter OTA using Simplicity Studio, refer to build OTA application using Simplicity Studio.
Combined Image Upgrade#
For 917 SoC, storing a single Matter combined upgrade image(TA+M4) and then providing sample code that can transfer the image to the co-processor and rewrite the 917 firmware as well as M4 firmware Image then boot loading with the upgraded TA processor image and the M4 processor image.
Host will initiate OTA download to receive combined image (TA+M4) on to host. Host will store M4 and TA image on flash backup location.
Use Case Of OTA#
Combined image will be created and uploaded onto Raspberry Pi which provides the firmware image chunk by chunk to the device.
Host will initiate the OTA download and provider app will start the OTA image transfer.
Host will receive combined image and host will transfer the M4 and TA firmware images on to TA chunk by chunk, TA will write the TA image onto TA flash backup location.
Once both images are downloaded, the device will reboot into the downloaded image.
Create Combined (TA+M4) Firmware Image#
The first step is to create a combined Image that contains both the firmware (TA & M4).
This image is created by combining the binary images of both images.
For Matter OTA file, create a bootable image file (using the Lighting application image as an example) and then create the Matter OTA file from the bootable image file using commands provided below.
Once combined image .ota file is created , the same will be uploaded onto raspberry pi where OTA provider application is running.
Generating The Combined OTA image#
Create TA image (.rps) with combined image flag set by using command.
commander rps convert <ta_image_combined.rps> --taapp <ta_image.rps> --combinedimage
Create M4 .rps file from .s37 using below command.
- commander rps create <m4_image.rps> --app <m4_image.s37>
Create M4 (.rps) with combined image flag set by using command.
commander rps convert <m4_image_combined.rps> --app <m4_image.rps> --combinedimage
Create combined image from the above created TA and M4 images.
commander rps convert "combined_image.rps" --app "m4_image_combined.rps" --taapp "ta_image_combined.rps"
Create the Matter OTA file from the bootable image file.
./src/app/ota_image_tool.py create -v 0xFFF1 -p 0x8005 -vn 2 -vs "2.0" -da sha256 combined_image.rps combined_image.ota
Note: For TA(alone) OTA firmware upgrade, follow the same steps as combined image
Running OTA Provider#
Locate ota-provider terminal. Run the Provider app along with the Matter OTA file created in the previous step.
rm -r /tmp/chip_*
./out/debug/chip-ota-provider-app -f combined_image.ota
Setting Up OTA-Requestor#
Before running ota-requestor app, flash the bootloader binary images for Silicon Labs Devices.
Running OTA-Requestor#
Enhancements to the Wi-Fi sdk IOT firmware upgrade application for MATTER OTA combined firmware application.
In a separate terminal, locate the chip-tool and ota-requestor and 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, commission the Device by passing below command.
./out/chip-tool pairing ble-wifi "node_id" "SSID" "PSK" 20202021 3840
where SSID and PSK are AP username and password.
Once the commissioning process completes in the same terminal, run below requestor command to start downloading the image.
./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.
Note: once image download is done, disconnect jlink. it will reboot automatically with new image.
Matter Software Update with SOC M4 Example Applications#
Host will initiate OTA download to receive M4 image on to host. Host will store M4 image on flash backup location.
Use Case M4(alone) OTA#
OTA image will be created and uploaded onto Raspberry Pi which provides the firmware image chunk by chunk to the device.
Host will initiate the OTA download, and provider app will start the OTA image transfer.
Host will receive M4 image and host will transfer the M4 image on to flash chunk by chunk.
TA will write the M4 image onto flash backup location.
Once image is downloaded, the device will reboot into the upgraded M4 image.
Generating The M4 OTA image#
Create M4 (.s37) image to (.rps) image using below command.
commander rps create <m4_image.rps> --app <m4_image.s37>
Create the Matter OTA file from the bootable image file
./src/app/ota_image_tool.py create -v 0xFFF1 -p 0x8005 -vn 2 -vs "2.0" -da sha256 m4_image.rps m4_image.ota
Running OTA Provider#
Locate ota-provider terminal, Run the Provider app along with the Matter OTA file created in the previous step.
rm -r /tmp/chip_*
./out/debug/chip-ota-provider-app -f m4_image.ota
Setting Up OTA-Requestor#
Before running ota-requestor app, flash the bootloader binary images for Silicon Labs Devices.
Running OTA-Requestor#
Enhancements to the Wi-Fi sdk IOT firmware upgrade application for matter OTA combined firmware application.
In a separate terminal, locate the chip-tool and ota-requestor, and 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, commission the Device by passing below command.
./out/chip-tool pairing ble-wifi "node_id" "SSID" "PSK" 20202021 3840
where SSID and PSK are AP username and password.
Once the commissioning process completes in the same terminal, run below requestor command to start downloading the image.
./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.
Note: once image download is done, disconnect jlink. it will reboot automatically with new image.