Skip to content

Commit

Permalink
chibios_hwdef.py: allow re-use of bootloader from other boards
Browse files Browse the repository at this point in the history
  • Loading branch information
Pradeep-Carbonix authored and robertlong13 committed Aug 15, 2024
1 parent 34a9ab2 commit c2b7636
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py
Original file line number Diff line number Diff line change
Expand Up @@ -2408,12 +2408,19 @@ def bootloader_path(self):
this_dir = os.path.realpath(__file__)
rootdir = os.path.relpath(os.path.join(this_dir, "../../../../.."))
hwdef_dirname = os.path.basename(os.path.dirname(args.hwdef[0]))
# allow re-using of bootloader from different build:
use_bootloader_from_board = self.get_config('USE_BOOTLOADER_FROM_BOARD', default=None, required=False)
if use_bootloader_from_board is not None:
hwdef_dirname = use_bootloader_from_board
bootloader_filename = "%s_bl.bin" % (hwdef_dirname,)
bootloader_path = os.path.join(rootdir,
"Tools",
"bootloaders",
bootloader_filename)
return bootloader_path
"Tools",
"bootloaders",
bootloader_filename)
if os.path.exists(bootloader_path):
return os.path.realpath(bootloader_path)

return None

def embed_bootloader(self, f):
'''added bootloader to ROMFS'''
Expand Down

0 comments on commit c2b7636

Please sign in to comment.