From 3e8b5ccee43fb9d7ef65eb53614cb8daad3ae7d6 Mon Sep 17 00:00:00 2001 From: bugobliterator Date: Wed, 24 Jul 2024 09:54:15 +1000 Subject: [PATCH] AP_Bootloader: fix build for STM32H7 without heap disables ecc check for those boards as well --- Tools/AP_Bootloader/AP_Bootloader.cpp | 2 +- Tools/AP_Bootloader/support.cpp | 4 ++-- Tools/AP_Bootloader/support.h | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Tools/AP_Bootloader/AP_Bootloader.cpp b/Tools/AP_Bootloader/AP_Bootloader.cpp index 79fdb759b0..5c1efea998 100644 --- a/Tools/AP_Bootloader/AP_Bootloader.cpp +++ b/Tools/AP_Bootloader/AP_Bootloader.cpp @@ -74,7 +74,7 @@ int main(void) flash_init(); -#ifdef STM32H7 +#if defined(STM32H7) && CH_CFG_USE_HEAP check_ecc_errors(); #endif diff --git a/Tools/AP_Bootloader/support.cpp b/Tools/AP_Bootloader/support.cpp index a7873fcb18..d3046a228a 100644 --- a/Tools/AP_Bootloader/support.cpp +++ b/Tools/AP_Bootloader/support.cpp @@ -533,7 +533,7 @@ void port_setbaud(uint32_t baudrate) } #endif // BOOTLOADER_DEV_LIST -#ifdef STM32H7 +#if defined(STM32H7) && CH_CFG_USE_HEAP /* check if flash has any ECC errors and if it does then erase all of flash @@ -580,5 +580,5 @@ void check_ecc_errors(void) } __enable_fault_irq(); } -#endif // STM32H7 +#endif // defined(STM32H7) && CH_CFG_USE_HEAP diff --git a/Tools/AP_Bootloader/support.h b/Tools/AP_Bootloader/support.h index 5dda7a38b2..8928ff9442 100644 --- a/Tools/AP_Bootloader/support.h +++ b/Tools/AP_Bootloader/support.h @@ -51,7 +51,9 @@ void thread_sleep_ms(uint32_t ms); void custom_startup(void); +#if defined(STM32H7) && CH_CFG_USE_HEAP void check_ecc_errors(void); +#endif // printf to debug uart (or USB) extern "C" {