From b3b54150818eebeb770432d54ce77eb8f0dc97bf Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 29 Oct 2018 19:48:25 +1100 Subject: [PATCH] waf: added --use-nuttx-iofw configure option this allows building with the old NuttX based IO firmware. The default is the ChibiOS based firmware --- Tools/ardupilotwaf/boards.py | 8 ++++++++ wscript | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/Tools/ardupilotwaf/boards.py b/Tools/ardupilotwaf/boards.py index 7ff8a70016..b8fcb0eb44 100644 --- a/Tools/ardupilotwaf/boards.py +++ b/Tools/ardupilotwaf/boards.py @@ -225,6 +225,14 @@ class Board: def embed_ROMFS_files(self, ctx): '''embed some files using AP_ROMFS''' import embed + if ctx.env.USE_NUTTX_IOFW: + # use fmuv2_IO_NuttX.bin instead of fmuv2_IO.bin + for i in range(len(ctx.env.ROMFS_FILES)): + (name,filename) = ctx.env.ROMFS_FILES[i] + if name == 'io_firmware.bin': + filename = 'Tools/IO_Firmware/fmuv2_IO_NuttX.bin' + print("Using IO firmware %s" % filename) + ctx.env.ROMFS_FILES[i] = (name,filename); header = ctx.bldnode.make_node('ap_romfs_embedded.h').abspath() if not embed.create_embedded_h(header, ctx.env.ROMFS_FILES): bld.fatal("Failed to created ap_romfs_embedded.h") diff --git a/wscript b/wscript index b5f3714d2e..d7144d6276 100644 --- a/wscript +++ b/wscript @@ -71,6 +71,11 @@ def options(opt): action='store_true', default=False, help='enable OS level asserts.') + + g.add_option('--use-nuttx-iofw', + action='store_true', + default=False, + help='use old NuttX IO firmware for IOMCU') g.add_option('--bootloader', action='store_true', @@ -193,6 +198,7 @@ def configure(cfg): cfg.env.DEBUG = cfg.options.debug cfg.env.ENABLE_ASSERTS = cfg.options.enable_asserts cfg.env.BOOTLOADER = cfg.options.bootloader + cfg.env.USE_NUTTX_IOFW = cfg.options.use_nuttx_iofw # Allow to differentiate our build from the make build cfg.define('WAF_BUILD', 1)