From 9543eecf233d20a0a01c07711bfa49d2e2c13aa7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 2 Aug 2024 18:58:16 +1000 Subject: [PATCH] HAL_ChibiOS: fixed AP_FILESYSTEM_ROMFS_ENABLED for peripherals with defaults.parm now that defaults are in ROMFS we must enable AP_FILESYSTEM_ROMFS_ENABLED --- libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py index c910cc5233..32e82c6a42 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py @@ -38,6 +38,7 @@ class ChibiOSHWDef(object): 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: @@ -2644,6 +2645,13 @@ Please run: Tools/scripts/build_bootloaders.py %s 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()): @@ -3277,6 +3285,7 @@ Please run: Tools/scripts/build_bootloaders.py %s return self.romfs_add('defaults.parm', filepath) + self.have_defaults_file = True def process_hwdefs(self): for fname in self.hwdef: