From 8b8f5eadd6a8185b9c32aa1f57ab1b13548fa461 Mon Sep 17 00:00:00 2001 From: Andy Piper Date: Sat, 8 Apr 2023 10:29:53 +0200 Subject: [PATCH] AP_HAL_ChibiOS: detect QSPI and OSPI separately for setting NO_RESET --- .../AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py index 8d14adcbb5..55e0164304 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py @@ -1537,15 +1537,21 @@ def write_WSPI_config(f): global wspi_list # only the bootloader must reset the QSPI clock otherwise it is not possible to # bootstrap into external flash - if not args.bootloader: - f.write('#define STM32_QSPI_NO_RESET TRUE\n') + for t in list(bytype.keys()) + list(alttype.keys()): + if t.startswith('QUADSPI') and not args.bootloader: + f.write('#define STM32_QSPI_NO_RESET TRUE\n') + if t.startswith('OCTOSPI') and not args.bootloader: + f.write('#define STM32_OSPI1_NO_RESET TRUE\n') if len(wspidev) == 0: - # nothing to do + # nothing else to do return + for t in list(bytype.keys()) + list(alttype.keys()): + print(t) if t.startswith('QUADSPI') or t.startswith('OCTOSPI'): wspi_list.append(t) + wspi_list = sorted(wspi_list) if len(wspi_list) == 0: return