diff --git a/bsps/arm/stm32h7/boards/stm/stm32h747i-disco/system_stm32h7xx.c b/bsps/arm/stm32h7/boards/stm/stm32h747i-disco/system_stm32h7xx.c index 269288d2c0..2075594518 100644 --- a/bsps/arm/stm32h7/boards/stm/stm32h747i-disco/system_stm32h7xx.c +++ b/bsps/arm/stm32h7/boards/stm/stm32h747i-disco/system_stm32h7xx.c @@ -174,11 +174,13 @@ /** @addtogroup STM32H7xx_System_Private_FunctionPrototypes * @{ */ -#ifndef __rtems__ #if defined (DATA_IN_ExtSDRAM) +#if defined(__rtems__) + void SystemInit_ExtMemCtl(void); +#else static void SystemInit_ExtMemCtl(void); -#endif /* DATA_IN_ExtSDRAM */ #endif /* __rtems__ */ +#endif /* DATA_IN_ExtSDRAM */ /** * @} */ @@ -559,7 +561,12 @@ void SystemInit_ExtMemCtl(void) for (index = 0; index<1000; index++); /* PALL command */ + #if defined(__rtems__) + /* RTEMS build detects incorrect/misleading indentation */ + FMC_Bank5_6_R->SDCMR = 0x0000000A; + #else FMC_Bank5_6_R->SDCMR = 0x0000000A; + #endif timeout = 0xFFFF; while((tmpreg != 0) && (timeout-- > 0)) { diff --git a/bsps/arm/stm32h7/boards/stm/stm32h757i-eval/system_stm32h7xx.c b/bsps/arm/stm32h7/boards/stm/stm32h757i-eval/system_stm32h7xx.c index 59e66e133e..5358e1e55c 100644 --- a/bsps/arm/stm32h7/boards/stm/stm32h757i-eval/system_stm32h7xx.c +++ b/bsps/arm/stm32h7/boards/stm/stm32h757i-eval/system_stm32h7xx.c @@ -178,11 +178,13 @@ /** @addtogroup STM32H7xx_System_Private_FunctionPrototypes * @{ */ -#ifndef __rtems__ #if defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM) +#if defined(__rtems__) + void SystemInit_ExtMemCtl(void); +#else static void SystemInit_ExtMemCtl(void); -#endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */ #endif /* __rtems__ */ +#endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */ /** * @} diff --git a/bsps/arm/stm32h7/boards/stm/stm32h7b3i-dk/ext-mem-ctl.c b/bsps/arm/stm32h7/boards/stm/stm32h7b3i-dk/ext-mem-ctl.c index a2ab9d8f1f..5cc276263c 100644 --- a/bsps/arm/stm32h7/boards/stm/stm32h7b3i-dk/ext-mem-ctl.c +++ b/bsps/arm/stm32h7/boards/stm/stm32h7b3i-dk/ext-mem-ctl.c @@ -34,6 +34,9 @@ */ #include +#ifdef __rtems__ +#include /* for SystemInit_ExtMemCtl */ +#endif #define DATA_IN_ExtSRAM #define DATA_IN_ExtSDRAM