summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2021-11-29 13:26:14 +1100
committerDamien George <damien@micropython.org>2021-11-30 10:21:18 +1100
commit0c9f5b388eae485625b15c8f6e15f2bed9446138 (patch)
tree05594e9b950229767081c31c1f0b947fc169337e
parent7e61a12eb1e153bf09b93c19f491237d72de2cf6 (diff)
stm32: Include HAL MMC code in F4 builds.
So that the MMC driver can be used on F4 MCUs. Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r--ports/stm32/Makefile5
-rw-r--r--ports/stm32/boards/stm32f4xx_hal_conf_base.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/ports/stm32/Makefile b/ports/stm32/Makefile
index 7a869d3c0..c3b281650 100644
--- a/ports/stm32/Makefile
+++ b/ports/stm32/Makefile
@@ -422,6 +422,11 @@ HAL_SRC_C += $(addprefix $(HAL_DIR)/Src/stm32$(MCU_SERIES)xx_,\
hal_dma_ex.c \
hal_dcmi.c \
)
+ifeq ($(MCU_SERIES),$(filter $(MCU_SERIES),f4))
+# HAL F4-1.16.0 has a bug with missing parentheses in HAL_MMC_Erase.
+# This function is unused so let the error go by as a warning.
+$(BUILD)/$(HAL_DIR)/Src/stm32$(MCU_SERIES)xx_hal_mmc.o: CFLAGS += -Wno-error=parentheses
+endif
endif
ifeq ($(CMSIS_MCU),$(filter $(CMSIS_MCU),STM32H743xx STM32H750xx STM32H7A3xx STM32H7A3xxQ STM32H7B3xx STM32H7B3xxQ))
diff --git a/ports/stm32/boards/stm32f4xx_hal_conf_base.h b/ports/stm32/boards/stm32f4xx_hal_conf_base.h
index f09990fd9..d42f3ba19 100644
--- a/ports/stm32/boards/stm32f4xx_hal_conf_base.h
+++ b/ports/stm32/boards/stm32f4xx_hal_conf_base.h
@@ -42,6 +42,7 @@
#include "stm32f4xx_hal_i2c.h"
#include "stm32f4xx_hal_i2s.h"
#include "stm32f4xx_hal_iwdg.h"
+#include "stm32f4xx_hal_mmc.h"
#include "stm32f4xx_hal_pcd.h"
#include "stm32f4xx_hal_pwr.h"
#include "stm32f4xx_hal_rcc.h"
@@ -74,6 +75,7 @@
#define HAL_I2C_MODULE_ENABLED
#define HAL_I2S_MODULE_ENABLED
#define HAL_IWDG_MODULE_ENABLED
+#define HAL_MMC_MODULE_ENABLED
#define HAL_PCD_MODULE_ENABLED
#define HAL_PWR_MODULE_ENABLED
#define HAL_RCC_MODULE_ENABLED