diff --git a/Tools/ardupilotwaf/boards.py b/Tools/ardupilotwaf/boards.py index f92feeedd0..58685d1bf6 100644 --- a/Tools/ardupilotwaf/boards.py +++ b/Tools/ardupilotwaf/boards.py @@ -407,6 +407,15 @@ class chibios(Board): env.GIT_SUBMODULES += [ 'ChibiOS', ] + + try: + import intelhex + env.HAVE_INTEL_HEX = True + cfg.msg("Checking for intelhex module:", 'OK') + except Exception: + cfg.msg("Checking for intelhex module:", 'disabled', color='YELLOW') + env.HAVE_INTEL_HEX = False + cfg.load('chibios') def build(self, bld): diff --git a/Tools/ardupilotwaf/chibios.py b/Tools/ardupilotwaf/chibios.py index 288ff8993a..a8b2a492b5 100644 --- a/Tools/ardupilotwaf/chibios.py +++ b/Tools/ardupilotwaf/chibios.py @@ -142,7 +142,7 @@ def chibios_firmware(self): abin_task.set_run_after(generate_apj_task) bootloader_bin = self.bld.srcnode.make_node("Tools/bootloaders/%s_bl.bin" % self.env.BOARD) - if os.path.exists(bootloader_bin.abspath()): + if os.path.exists(bootloader_bin.abspath()) and self.bld.env.HAVE_INTEL_HEX: hex_target = self.bld.bldnode.find_or_declare('bin/' + link_output.change_ext('.hex').name) hex_task = self.create_task('build_intel_hex', src=[bin_target, bootloader_bin], tgt=hex_target) hex_task.set_run_after(generate_bin_task)