| # Copyright (c) 2020 Project CHIP Authors |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| import("//build_overrides/build.gni") |
| import("//build_overrides/chip.gni") |
| import("//build_overrides/mt793x_sdk.gni") |
| import("${build_root}/toolchain/flashable_executable.gni") |
| |
| template("mt793x_executable") { |
| output_base_name = get_path_info(invoker.output_name, "name") |
| |
| objcopy_image_name = output_base_name + ".bin" |
| objcopy_image_format = "binary" |
| objcopy = "arm-none-eabi-objcopy" |
| |
| flash_target_name = target_name + ".flash_executable" |
| flashbundle_name = "${target_name}.flashbundle.txt" |
| flashable_executable(flash_target_name) { |
| forward_variables_from(invoker, "*") |
| } |
| |
| action("scatter_file") { |
| script = "${mt793x_sdk_build_root}/filogic/project/mt7933_hdk/apps/matter_sdk/scripts/scatter_file_generator.py" |
| outputs = [ "${target_gen_dir}/scatter.ini" ] |
| |
| args = [ |
| "--output", |
| "/" + rebase_path(root_out_dir, "/") + "/scatter.ini", |
| "--bl_path", |
| "mt7931an_bootloader-xip.sgn", |
| "--img_path", |
| "${objcopy_image_name}", |
| "--bt_path", |
| "BT_RAM_CODE_MT7933_2_1_hdr.bin", |
| "--wifi_path", |
| "WIFI_RAM_CODE_MT7933_ALL.bin", |
| ] |
| |
| gen_deps = [ ":$flash_target_name" ] |
| } |
| |
| action("copy_file") { |
| script = "${mt793x_sdk_build_root}/filogic/project/mt7933_hdk/apps/matter_sdk/scripts/copy_file.py" |
| outputs = [ "${target_out_dir}" ] |
| |
| args = [ |
| "--outputdir", |
| "/" + rebase_path(root_out_dir, "/"), |
| "--bl_path", |
| rebase_path(mt793x_sdk_build_root, root_out_dir) + "/filogic/project/mt7933_hdk/apps/matter_sdk/bootloader/mt7931an_bootloader-xip.sgn", |
| "--bt_path", |
| rebase_path(mt793x_sdk_build_root, root_out_dir) + |
| "/filogic/prebuilt/driver/chip/mt7933/BT_RAM_CODE_MT7933_2_1_hdr.bin", |
| "--wifi_path", |
| rebase_path(mt793x_sdk_build_root, root_out_dir) + |
| "/filogic/prebuilt/driver/chip/mt7933/WIFI_RAM_CODE_MT7933_ALL.bin", |
| ] |
| |
| gen_deps = [ ":$flash_target_name" ] |
| } |
| group(target_name) { |
| deps = [ |
| ":$flash_target_name", |
| ":copy_file", |
| ":scatter_file", |
| ] |
| } |
| } |