Skip to content

Commit 6808f06

Browse files
committed
Fix stm32yyxx_ll_fmc.c build issue
Some guards missing in the G4 and H7 HAL Cube firmware. Instead of removing stm32yyxx_ll_fmc.c from the build add a fix in the HAL Cube firmware. Signed-off-by: Frederic Pillon <[email protected]>
1 parent a3b4f7a commit 6808f06

File tree

7 files changed

+16
-15
lines changed

7 files changed

+16
-15
lines changed

libraries/SrcWrapper/src/LL/stm32yyxx_ll_fmc.c

+2-10
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,10 @@
88
#include "stm32f7xx_ll_fmc.c"
99
#endif
1010
#ifdef STM32G4xx
11-
/*
12-
* Build issue as not properly guard in current
13-
* version if stm32g4xx_ll_fmc.h is not include
14-
*/
15-
/*#include "stm32g4xx_ll_fmc.c"*/
11+
#include "stm32g4xx_ll_fmc.c"
1612
#endif
1713
#ifdef STM32H7xx
18-
/*
19-
* Build issue as not properly guard in current
20-
* version if stm32h7xx_ll_fmc.h is not include
21-
*/
22-
/*#include "stm32h7xx_ll_fmc.c"*/
14+
#include "stm32h7xx_ll_fmc.c"
2315
#endif
2416
#ifdef STM32L4xx
2517
#include "stm32l4xx_ll_fmc.c"

system/Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_ll_fmc.c

+2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
* @brief FMC driver modules
6464
* @{
6565
*/
66+
#if defined (HAL_SRAM_MODULE_ENABLED) || defined(HAL_NOR_MODULE_ENABLED) || defined(HAL_NAND_MODULE_ENABLED)
6667

6768
/* Private typedef -----------------------------------------------------------*/
6869
/* Private define ------------------------------------------------------------*/
@@ -766,6 +767,7 @@ HAL_StatusTypeDef FMC_NAND_GetECC(FMC_NAND_TypeDef *Device, uint32_t *ECCval, ui
766767
/**
767768
* @}
768769
*/
770+
#endif /* HAL_SRAM_MODULE_ENABLED || HAL_NOR_MODULE_ENABLED || HAL_NAND_MODULE_ENABLED */
769771

770772
/**
771773
* @}

system/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_sdram.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
extern "C" {
2525
#endif
2626

27+
#if defined(HAL_MDMA_MODULE_ENABLED)
2728

2829
/* Includes ------------------------------------------------------------------*/
2930
#include "stm32h7xx_ll_fmc.h"
@@ -216,7 +217,7 @@ HAL_SDRAM_StateTypeDef HAL_SDRAM_GetState(SDRAM_HandleTypeDef *hsdram);
216217
/**
217218
* @}
218219
*/
219-
220+
#endif /* HAL_MDMA_MODULE_ENABLED */
220221

221222
#ifdef __cplusplus
222223
}

system/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_sram.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
extern "C" {
2525
#endif
2626

27+
#if defined(HAL_MDMA_MODULE_ENABLED)
2728

2829
/* Includes ------------------------------------------------------------------*/
2930
#include "stm32h7xx_ll_fmc.h"
@@ -210,7 +211,7 @@ HAL_SRAM_StateTypeDef HAL_SRAM_GetState(SRAM_HandleTypeDef *hsram);
210211
/**
211212
* @}
212213
*/
213-
214+
#endif /* HAL_MDMA_MODULE_ENABLED */
214215

215216
#ifdef __cplusplus
216217
}

system/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_sdram.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
* @{
119119
*/
120120

121-
#ifdef HAL_SDRAM_MODULE_ENABLED
121+
#if defined (HAL_SDRAM_MODULE_ENABLED) && defined (HAL_MDMA_MODULE_ENABLED)
122122

123123
/** @defgroup SDRAM SDRAM
124124
* @brief SDRAM driver modules
@@ -1301,7 +1301,7 @@ static void SDRAM_DMAError(MDMA_HandleTypeDef *hmdma)
13011301
* @}
13021302
*/
13031303

1304-
#endif /* HAL_SDRAM_MODULE_ENABLED */
1304+
#endif /* HAL_SDRAM_MODULE_ENABLED && HAL_MDMA_MODULE_ENABLED */
13051305

13061306
/**
13071307
* @}

system/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_sram.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
* @{
120120
*/
121121

122-
#ifdef HAL_SRAM_MODULE_ENABLED
122+
#if defined (HAL_SRAM_MODULE_ENABLED) && defined (HAL_MDMA_MODULE_ENABLED)
123123

124124
/** @defgroup SRAM SRAM
125125
* @brief SRAM driver modules

system/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_ll_fmc.c

+5
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@
6464
* @brief FMC driver modules
6565
* @{
6666
*/
67+
#if (defined (HAL_SRAM_MODULE_ENABLED) || defined(HAL_SDRAM_MODULE_ENABLED)) && defined(HAL_MDMA_MODULE_ENABLED) || \
68+
defined(HAL_NOR_MODULE_ENABLED) || defined(HAL_NAND_MODULE_ENABLED)
69+
6770

6871
/* Private typedef -----------------------------------------------------------*/
6972
/* Private define ------------------------------------------------------------*/
@@ -1043,6 +1046,8 @@ uint32_t FMC_SDRAM_GetModeStatus(FMC_SDRAM_TypeDef *Device, uint32_t Bank)
10431046
* @}
10441047
*/
10451048

1049+
#endif /* (HAL_SRAM_MODULE_ENABLED || HAL_NOR_MODULE_ENABLED) && HAL_MDMA_MODULE_ENABLED || HAL_NAND_MODULE_ENABLED || HAL_SDRAM_MODULE_ENABLED */
1050+
10461051
/**
10471052
* @}
10481053
*/

0 commit comments

Comments
 (0)