MCPcopy Create free account
hub / github.com/ARMmbed/DAPLink / mbedcli_run

Function mbedcli_run

tools/mbedcli_tools/mbedcli_run.py:36–56  ·  view source on GitHub ↗
(daplink_dir, build_folder, project, toolchain, clean, verbosity)

Source from the content-addressed store, hash-verified

34 exit(1)
35
36def mbedcli_run(daplink_dir, build_folder, project, toolchain, clean, verbosity):
37 generate_mbedcli_files(os.path.join(daplink_dir, "projects.yaml"), project)
38 project_dir=os.path.join(daplink_dir, build_folder, project.upper())
39 if clean is True and os.path.exists(project_dir):
40 print("Deleting %s" % project_dir)
41 shutil.rmtree(project_dir, ignore_errors=True)
42 args = ["mbed", "compile", "-m", project, "-t", toolchain, "--profile", "custom_profile.json"]
43 if verbosity is not None:
44 args.append("-" + "v" * verbosity)
45 call_and_copy_output(args)
46 cli_name_out = os.path.basename(daplink_dir)
47 build_dir = os.path.join(project_dir, toolchain+"-CUSTOM_PROFILE")
48 for file in os.listdir(build_dir):
49 if file.startswith(cli_name_out):
50 rename_file = os.path.join(build_dir, file.replace(cli_name_out, project, 1))
51 if os.path.exists(rename_file):
52 os.remove(rename_file)
53 os.rename(os.path.join(build_dir, file), rename_file)
54 cli_hex_output = os.path.join(build_dir, project + ".hex")
55 crc_file_output = os.path.join(build_dir, project + "_crc")
56 return (cli_hex_output,crc_file_output)

Callers

nothing calls this directly

Calls 2

generate_mbedcli_filesFunction · 0.90
call_and_copy_outputFunction · 0.85

Tested by

no test coverage detected