diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py index e01e4283a45d3..937d3b6844ad0 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py @@ -32,6 +32,7 @@ def __init__(self, quiet=False, bootloader=False, signed_fw=False, outdir=None, self.signed_fw = signed_fw self.default_params_filepath = default_params_filepath self.quiet = quiet + self.have_defaults_file = False # if true then parameters will be appended in special apj-tool # section at end of binary: @@ -2613,6 +2614,13 @@ def write_hwdef_header(self, outfilename): self.write_board_validate_macro(f) self.write_check_firmware(f) + if self.have_defaults_file: + f.write(''' +#ifndef AP_FILESYSTEM_ROMFS_ENABLED +#define AP_FILESYSTEM_ROMFS_ENABLED 1 +#endif +''') + self.write_peripheral_enable(f) if os.path.exists(self.processed_defaults_filepath()): @@ -3241,6 +3249,7 @@ def write_default_parameters(self): return self.romfs_add('defaults.parm', filepath) + self.have_defaults_file = True def process_hwdefs(self): for fname in self.hwdef: