From edd0f74ec0cb3d9722f58c43790e16252c094ab1 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Tue, 20 Mar 2018 20:25:12 +1100 Subject: [PATCH] Tools: ardupilotwaf: chibios: hand apj tool an absolute path to parameters Any waf build specifying an --out which is not at the same level as the default "build" will fail without this --- Tools/ardupilotwaf/chibios.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Tools/ardupilotwaf/chibios.py b/Tools/ardupilotwaf/chibios.py index e464e0cf17..e6b96f64b4 100644 --- a/Tools/ardupilotwaf/chibios.py +++ b/Tools/ardupilotwaf/chibios.py @@ -65,10 +65,16 @@ class upload_fw(Task.Task): class set_default_parameters(Task.Task): color='CYAN' - run_str='python ${APJ_TOOL} --set-file ${DEFAULT_PARAMETERS} ${SRC}' always_run = True def keyword(self): return "apj_tool" + def run(self): + rel_default_parameters = self.env.get_flat('DEFAULT_PARAMETERS') + abs_default_parameters = os.path.join(self.env.STANDARD_BUILDDIR, + rel_default_parameters) + run_str = ("python ${APJ_TOOL} --set-file %s ${SRC}" % + (abs_default_parameters,)) + class generate_fw(Task.Task): color='CYAN' @@ -188,6 +194,7 @@ def configure(cfg): env.TOOLS_SCRIPTS = srcpath('Tools/scripts') env.APJ_TOOL = srcpath('Tools/scripts/apj_tool.py') env.SERIAL_PORT = srcpath('/dev/serial/by-id/*_STLink*') + env.STANDARD_BUILDDIR = srcpath("build/some-board") # relative paths to pass to make, relative to directory that make is run from env.CH_ROOT_REL = os.path.relpath(env.CH_ROOT, env.BUILDROOT)