Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bouffalolab] Generate Bouffalolab format OTA image after compile done. #27337

Merged
merged 4 commits into from
Jun 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions examples/lighting-app/bouffalolab/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
./<output_firmware_name>.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 ./<output_firmware_name>.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
`<output_firmware_name>.flash.py` to generate `Bouffalo Lab` OTA format
image as above, and put it under out folder with name likes
`<output_firmware_name>.bin.xz.hash`

* Build Matter `*.ota` OTA image with `Bouffalo Lab` OTA image under
**connectedhomeip** repo folder
Expand Down
24 changes: 24 additions & 0 deletions scripts/build/builders/bouffalolab.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)