Skip to content

Commit 83c3b6b

Browse files
authored
[Chef] Implement Z2 flashing through flash.sh script (#23011) (#23486)
1 parent dab60d4 commit 83c3b6b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

examples/chef/chef.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,7 @@ def main() -> int:
715715
elif config['ameba']['MODEL'] == 'Z2':
716716
shell.run_cmd(
717717
f"cd {config['ameba']['AMEBA_SDK']}/project/realtek_amebaz2_v0_example/GCC-RELEASE")
718+
shell.run_cmd("rm -f project_include.mk")
718719
with open(f"{config['ameba']['AMEBA_SDK']}/project/realtek_amebaz2_v0_example/GCC-RELEASE/project_include.mk", "w") as f:
719720
f.write(textwrap.dedent(f"""\
720721
SAMPLE_NAME = {options.sample_device_type_name}
@@ -840,8 +841,11 @@ def main() -> int:
840841
shell.run_cmd(
841842
f"{config['ameba']['AMEBA_SDK']}/tools/AmebaD/Image_Tool_Linux/flash.sh {config['ameba']['TTY']} {config['ameba']['AMEBA_SDK']}/project/realtek_amebaD_va0_example/GCC-RELEASE/out", raise_on_returncode=False)
842843
else:
843-
flush_print(
844-
"Ameba Z2 currently does not support flashing image through script, stil WIP")
844+
shell.run_cmd(f"cd {_CHEF_SCRIPT_PATH}/ameba")
845+
shell.run_cmd(
846+
f"cd {config['ameba']['AMEBA_SDK']}/tools/AmebaZ2/Image_Tool_Linux")
847+
shell.run_cmd(
848+
f"{config['ameba']['AMEBA_SDK']}/tools/AmebaZ2/Image_Tool_Linux/flash.sh {config['ameba']['TTY']} {config['ameba']['AMEBA_SDK']}/project/realtek_amebaz2_v0_example/GCC-RELEASE/application_is/Debug/bin", raise_on_returncode=False)
845849

846850
#
847851
# Terminal interaction

0 commit comments

Comments
 (0)