From 81006611deac415245f453977da306e111369e6f Mon Sep 17 00:00:00 2001 From: pankore <86098180+pankore@users.noreply.github.com> Date: Wed, 5 Oct 2022 04:07:30 +0800 Subject: [PATCH] [Chef] Implement Z2 flashing through flash.sh script (#23011) --- examples/chef/chef.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/chef/chef.py b/examples/chef/chef.py index 411151a8def953..7d296d937e911c 100755 --- a/examples/chef/chef.py +++ b/examples/chef/chef.py @@ -696,6 +696,7 @@ def main() -> int: elif config['ameba']['MODEL'] == 'Z2': shell.run_cmd( f"cd {config['ameba']['AMEBA_SDK']}/project/realtek_amebaz2_v0_example/GCC-RELEASE") + shell.run_cmd("rm -f project_include.mk") with open(f"{config['ameba']['AMEBA_SDK']}/project/realtek_amebaz2_v0_example/GCC-RELEASE/project_include.mk", "w") as f: f.write(textwrap.dedent(f"""\ SAMPLE_NAME = {options.sample_device_type_name} @@ -819,8 +820,11 @@ def main() -> int: shell.run_cmd( 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) else: - flush_print( - "Ameba Z2 currently does not support flashing image through script, stil WIP") + shell.run_cmd(f"cd {_CHEF_SCRIPT_PATH}/ameba") + shell.run_cmd( + f"cd {config['ameba']['AMEBA_SDK']}/tools/AmebaZ2/Image_Tool_Linux") + shell.run_cmd( + 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) # # Terminal interaction