diff --git a/examples/lighting-app/bouffalolab/README.md b/examples/lighting-app/bouffalolab/README.md index 7e42d3bcc45b0a..3ce3cb46c98305 100644 --- a/examples/lighting-app/bouffalolab/README.md +++ b/examples/lighting-app/bouffalolab/README.md @@ -261,16 +261,23 @@ After successful commissioning, cluster commands available to control the board. Please take [guide](../../ota-provider-app/linux/README.md) for more detail on ota-provider-app build and usage. -### Create the Matter OTA with Bouffalolab OTA bin `FW_OTA.bin.xz.hash` +### Create the Matter OTA image with Bouffalolab OTA `bin.xz.hash` format image -- Build `Bouffalo Lab` OTA image as following execution using python script - `*.flash.py` under firmware build out folder, - ```shell - ./.flash.py --build - ``` - After script executed, a folder `ota_images` and an image - `FW_OTA.bin.xz.hash` will be generated. `FW_OTA.bin.xz.hash` is compressed - with hash verification for build out firmware. +- `Bouffalo Lab` OTA `bin.xz.hash` format image + + - Build `Bouffalo Lab` OTA image as following execution using python + script `*.flash.py` under firmware build out folder, + `shell ./.flash.py --build` After script executed, + a folder `ota_images` and an image `FW_OTA.bin.xz.hash` will be + generated. `FW_OTA.bin.xz.hash` is compressed with hash verification for + build out firmware. + + - `bin.xz.hash` image + + After compile done, the build script will call + `.flash.py` to generate `Bouffalo Lab` OTA format + image as above, and put it under out folder with name likes + `.bin.xz.hash` * Build Matter `*.ota` OTA image with `Bouffalo Lab` OTA image under **connectedhomeip** repo folder diff --git a/scripts/build/builders/bouffalolab.py b/scripts/build/builders/bouffalolab.py index 9646803828df72..cf4f09158fdbe7 100644 --- a/scripts/build/builders/bouffalolab.py +++ b/scripts/build/builders/bouffalolab.py @@ -141,3 +141,27 @@ def build_outputs(self): } return items + + def PostBuildCommand(self): + + # Generate Bouffalo Lab format OTA image for development purpose. + + ota_images_folder_path = self.output_dir + "/ota_images" + ota_images_dev_image = self.output_dir + "/" + self.app.AppNamePrefix(self.chip_name) + ".bin.xz.hash" + ota_images_image = self.output_dir + "/ota_images/FW_OTA.bin.xz.hash" + ota_images_firmware = self.output_dir + "/" + self.app.AppNamePrefix(self.chip_name) + ".bin" + + ota_images_flash_tool = self.output_dir + "/" + self.app.AppNamePrefix(self.chip_name) + ".flash.py" + + os.system("rm -rf " + ota_images_folder_path) + os.system("rm -rf " + ota_images_dev_image) + + if not os.path.isfile(ota_images_firmware): + return + + os.system("python " + ota_images_flash_tool + " --build") + + if not os.path.isfile(ota_images_image): + return + + os.system("cp " + ota_images_image + " " + ota_images_dev_image)